First I’ll suggest an optional overload for cframe:components(), with a behavior similar to unpack:
Current behavior for unpack:
local t = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"}
print(unpack(t, 4, 9))
Output:
> d e f g h i
Suggested behavior for cframe:components(p0, p1):
local m00, m01, m02, m10, m11, m12, m20, m21, m22 = cframe:components(4, 12)
Since the vectors are stored vertically, this feature would be pretty useful too:
local cframe = workspace.CurrentCamera.CFrame
local m02, m12, m22 = cframe:components(6, 6, 9, 9, 12, 12)
assert(Vector3.new(-m02, -m12, -m22) == cframe.lookVector)
The overhead from using cframe:components() corresponds with how many Lua variables are being set, so this could help out with intense cframe math. Testing for extra arguments in the c++ would have its own overhead, but hopefully that’s insignificant.
An overload for CFrame.fromEulerAnglesXYZ/CFrame.Angles that sets the position would be very helpful as well:
What we’re doing:
local cframe = CFrame.new(1, 2, 3) * CFrame.fromEulerAnglesXYZ(2, 3, 4)
What we could be doing:
local cframe = CFrame.fromEulerAnglesXYZ(1, 2, 3, 2, 3, 4)
Also extra methods like CFrame.fromEulerAnglesYXZ and CFrame.fromEulerAnglesZXY would be cool too.
Edit:
CFrame.fromEulerAnglesYXZ(1, 2, 3)
would be the same as
CFrame.fromEulerAnglesXYZ(0, 1, 0) * CFrame.Angles(2, 0, 3)