Why no setPosition() function?
by Michael Rogers · in Torque Game Engine · 09/11/2005 (11:01 am) · 4 replies
I notice that there is a getPosition() method, but no setPosition() method -- just setTransform().
Is there a reason for this lack of symmetry?
I realize that I can define the function myself, but it seems to be so useful that it ought to be built in.
Thanks for any insights,
Michael Rogers
Is there a reason for this lack of symmetry?
I realize that I can define the function myself, but it seems to be so useful that it ought to be built in.
Thanks for any insights,
Michael Rogers
About the author
#2
Michael
09/11/2005 (11:53 am)
Yes indeed, there is a getPosition() -- I'd paste my proof from the console, but that doesn't work on the Macintosh version :-(Michael
#3
Example:
09/14/2005 (10:19 am)
SetTransform() can double as setPosition(), if you specify only the X, Y and Z components (without the rotation components).Example:
foo.setTransform(bar.getPosition());
#4
Michael
09/14/2005 (10:24 am)
Thanks, Manoel, that's great! [For the GG engineers reading this, I'd still like setPosition() for the sake of symmetry, but setTransform() will work.]Michael
Torque Owner Jeremy Alessi