Axis Rotations cause a translation also.
by Wendell Brown · in Torque Game Engine · 07/29/2003 (10:32 am) · 2 replies
I have been trying to get my head wrapped around the rotational math in order to provide directions for my aiFlyingVehicles. It seems (and I hope I am not the only one that sees this) that if you attempt to cause a rotation about the x or y axis using the WorldInspector on an object sitting(stopped) in space (i.e. anything not colliding with the ground and not falling due to gravity) that when you give it a rotation about the x or y axis then you also get a translation. Example. Have an object sitting in space and issue a rotation change of 30 degrees about the x axis. insert into the rotation field in the WorldInspector mode "1 0 0 30". You will notice you get a translation of the object in addition to the rotation. A y rotation would be "0 1 0 30" and also a translation involved. z rotations appear correct.
Can someone verify my observations and let me know. I hate chasing down non-issues.
Of course if anyone has a fix for this I would greatly appreciate it otherwise I am off investigating a fix.
Can someone verify my observations and let me know. I hate chasing down non-issues.
Of course if anyone has a fix for this I would greatly appreciate it otherwise I am off investigating a fix.
#2
Oh yeah, when GameBase::boundingBox is on, the center of mass is drawn as a white cube (if I remember correctly). I use that so often I bound a toggle script to a key, like so:
07/29/2003 (1:53 pm)
The bounding box pivot (not it's geometric center) is the origin for object space. Move the pivot ('Affect Pivot Only') to change it. However, you are manually performing a translation on the object in the editor, which will usually match pretty well with the rigid body physics because it uses the same point as center of mass by default. You can translate the center of mass in the vehicle's datablock (massCenter), so check that if the in-game and in-editor pivots appear to disagree.Oh yeah, when GameBase::boundingBox is on, the center of mass is drawn as a white cube (if I remember correctly). I use that so often I bound a toggle script to a key, like so:
moveMap.bindCmd(keyboard, "ctrl z", "$GameBase::boundingBox = 1 - $GameBase::boundingBox;", "");
Torque Owner Wendell Brown