Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Z-Facing
Re: Z-Facing [message #256713 is a reply to message #256643] Tue, 01 May 2007 17:56 Go to previous messageGo to previous message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma:
General (2 Stars)

You can get a Matrix3D which describes the position and facing from a object using PhysicalGameObj::Get_Transform (Note that this definition is only availible in a quite new version of scripts.dll). The return matrix should be read as

Matrix[0].x/y/z = X axis vector
Matrix[1].x/y/z = Y axis vector
Matrix[2].x/y/z = Z axis vector
Matrix[0].w = X pos
Matrix[1].w = Y pos
Matrix[2].w = Z pos

For more info on that I would suggest you to read about translation matrises or transformation matrix or something like that.

I'm not sure what you want to do with it, but to get the Matrix3D from the object you would use something like this:

Matrix3D* Matrix = ((PhysicalGameObj*)Object)->Get_Transform();
// Do something with Matrix[2].x, Matrix[2].y and Matrix[2].z

It's hard to explain exactly and I doubt you will be able to do anything with this info, but maybe it helped you or someone else in some way. Smile

(for a soldier the Z-vector always points straight upwards, vector (0,0,1), so if you want to use this on a soldier, don't even try Wink)


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Level Edit bug
Next Topic: Scripts to grant powerups or weapons
Goto Forum:
  


Current Time: Fri Sep 20 08:22:55 MST 2024

Total time taken to generate the page: 0.00852 seconds