Game Development Community

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

#1
09/11/2005 (11:13 am)
There's a getPosition() method? News to me! As far as I've known there's getTransform() and setTransform() which of course retains programming symmetry.
#2
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
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
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