Hello writers, good morning. I would like to know more about getElementMatrix, how does it work? What does it mean the data is what is returned to me? According to what I read on the wiki, it returns 4 'tables', with coordinates, but what does each of them mean? Might be interesting for more of an explanation on how matrices work in this game.
We can take as an example, a vehicle.
local vehicle = createVehicle(411, 1892, -2418, 13.5)
setElementFrozen(vehicle, true)
for k, v in pairs(getElementMatrix(vehicle)) do
outputChatBox("index "..k.." = "..v[1]..", "..v[2]..", "..v[3]..", "..v[4])
end
--[[
Return:
index 1 = 1, -1.7484555314695e-07, 1.7484555314695e-07, 1
index 2 = 1.7484558156866e-07, 1, -1.7484555314695e-07, 1
index 3 = -1.7484552472524e-07, 1.7484558156866e-07, 1, 1
index 4 = 1892, -2418, 13.5, 1
]]
index 4 by deduction gives me the proper position of the vehicle, and what are the rest of the values?
For more information, what I'm trying to do, is to always get the underbody of a vehicle. They told me that I could get it with this function, but without saying anything else. I'm doing math with getElementBoundingBox and getGroundPosition, but I can't get much of it right now, since my coords are getting out of phase when the vehicle is rotating. Perhaps with an explanation of what those values are, I can get closer to the result I'm looking for.
Sorry for the bad grammar, I'm using google translate.