Game Development Community

Get node transform

by Clint S. Brewer · in Torque Game Engine · 12/22/2004 (12:00 am) · 44 replies

Anyone know how to get the position of a specific node from script?

I want to access a named node in my model and create an explosion at that position.

lets just say mount0 for now, but eventually any named node.

thanks
Page«First 1 2 3 Next»
#41
12/08/2009 (7:53 pm)
Is there a way for this function to work without sending the MatrixF* mat parameter? I have a function that calls getNodeTransform but only sends the nodeName and every time I try to send the mat parameter it gives me errors. So is there a way of implementing this with only the nodeName parameter?
#42
12/08/2009 (8:08 pm)
The MatrixF* parameter is designed to be your output. So you pass it a matrix which you want to be set to the node transform. I guess you could change it to return a MatrixF instead of having to have a handle as input.

(I've never understood all those functions that take a MatrixF* as a parameter... why not just return a MatrixF?)
#43
12/08/2009 (8:36 pm)
> (I've never understood all those functions that take a MatrixF* as a parameter... why not just return a MatrixF?)

because a MatrixF is 16 floats (64 bytes) that need to be copied onto the stack and off of it, while a MatrixF is 1 pointer (4 bytes).
#44
12/08/2009 (10:34 pm)
Exactly. Performance. Matrix multiplication is an oft-used operation and it's quicker to pass to the multiplication function a pointer to where you want the results stored than it is for the multiplication function to allocate temporary storage space to return the results in, which then have to be copied to the location you want the results stored. This way the multiplication function does its work directly in the space you tell it to.
Page«First 1 2 3 Next»