That indeed is multiplication, more specifically matrix multiplication. Although keep in mind developers can write their own functionality for the * operator with metatables, so when looking at someone else's code it may not mean that, even though for the sake of readibility, it should.
CFrames can be thought of as two matrices, the position matrix (x, y, z, a 3x1 matrix) and the rotational matrix (3x3 matrix). When multiplying two matrices together, the resulting position matrix comes like:
local a = CFrame.new(
1, 1, 1
)
local b = CFrame.new(
2, 2, 2
)
local c = CFrame.new(
1 * 1 + 1 * 0 + 1 * 0 + 2 * 1 + 2 * 0 + 2 * 0,
1 * 0 + 1 * 1 + 1 * 0 + 2 * 0 + 2 * 1 + 2 * 0,
1 * 0 + 1 * 0 + 1 * 1 + 2 * 0 + 2 * 0 + 2 * 1
)
local a_by_b = a * b
print(a_by_b, "\t", c, "\t", a_by_b == c)
Where c is constructed like the a * b operation would internally construct it.
So matrix multiplication is utilizing the dot product, which itself is multiplication.
The rotational matrix is similar:
local a = CFrame.new(
1, 2, 3,
0.5, 0, 0.5,
0, 1, 0,
0, 0, 1
)
local b = CFrame.new(
1, 2, 3,
1, 0, 0,
0, 1, 0,
0, 0, 1
)
local c = CFrame.new(
1 * 1 + 2 * 0 + 3 * 0 + 1 * 0.5 + 2 * 0 + 3 * 0.5,
1 * 0 + 2 * 1 + 3 * 0 + 1 * 0 + 2 * 1 + 3 * 0,
1 * 0 + 2 * 0 + 3 * 1 + 1 * 0 + 2 * 0 + 3 * 1,
0.5 * 1 + 0 * 0 + 0.5 * 0, 0.5 * 0 + 0 * 1 + 0.5 * 0, 0.5 * 0 + 0 * 0 + 0.5 * 1,
0 * 1 + 1 * 0 + 0 * 0, 0 * 0 + 1 * 1 + 0 * 0, 0 * 0 + 1 * 0 + 0 * 1,
0 * 1 + 0 * 0 + 1 * 0, 0 * 0 + 0 * 1 + 1 * 0, 0 * 0 + 0 * 0 + 1 * 1
)
local a_by_b = a * b
print(a_by_b, "\t", c, "\t", a_by_b == c)
EgoMoose has written a bunch of great articles regarding different math topics on the wiki. Here's one related to matrices, including their multiplication.
4 comments
Interesting...
CFrames are not the same as numbers. CFrames are matrices, and when multiplying two CFrames together, your resultant CFrame is the two added together. There is a deeper explanation for this, but that's simply the syntax. You can check out http://wiki.roblox.com/index.php?title=CFrame#CFrame_.2A_CFrame and view the operators there to see what is allowed and what happens.
Multiplying matrices is not the same as element-wise adding them together, it's a bit more involved than that. Multiplying CFrames is a step more mysterious to developers, since the 4th row of the matrix is hidden. This row is always 0,0,0,1 so you can write the CFrame as a 4x4 and multiply it to see what really happens. For CFrame * Vector3 you need to upgrade the vector to a 4x1: (x,y,z,1)