06.01.2014, 21:14
I'm using Gamer_Z's code but it only has this:
stock PositionFromVehicleOffset(vehicle,Float:offX,Float :offY,Float:offZ,&Float:x,&Float:y,&Float:z)
I need the oposit to this function, I need to get the Vehicle Offset FROM Position, not the other way around.
Can anyone help me please?
The code is:
The include is here: http://gpb.******code.com/svn/trunk/...icleMatrix.inc
Regards
stock PositionFromVehicleOffset(vehicle,Float:offX,Float :offY,Float:offZ,&Float:x,&Float:y,&Float:z)
I need the oposit to this function, I need to get the Vehicle Offset FROM Position, not the other way around.
Can anyone help me please?
The code is:
Код:
stock PositionFromVehicleOffset(vehicle,Float:offX,Float:offY,Float:offZ,&Float:x,&Float:y,&Float:z) { //initial processing step - gather information new Mat4x3[MatrixParts][MatrixIndicator]; GetVehicleMatrix(vehicle,Mat4x3); //offset calculation math x = offX * Mat4x3[mp_PITCH][mi_X] + offY * Mat4x3[mp_ROLL][mi_X] + offZ * Mat4x3[mp_YAW][mi_X] + Mat4x3[mp_POS][mi_X]; y = offX * Mat4x3[mp_PITCH][mi_Y] + offY * Mat4x3[mp_ROLL][mi_Y] + offZ * Mat4x3[mp_YAW][mi_Y] + Mat4x3[mp_POS][mi_Y]; z = offX * Mat4x3[mp_PITCH][mi_Z] + offY * Mat4x3[mp_ROLL][mi_Z] + offZ * Mat4x3[mp_YAW][mi_Z] + Mat4x3[mp_POS][mi_Z]; return 1; }
Regards