Game Development Community

RigidCollisionManager wrong scaling

by Ulisse · in Torque X 2D · 11/18/2008 (8:02 am) · 3 replies

Scaling a T3DSceneComponent in a scene descriptor xml file is ignored for those TorqueObjects having the RigidComponent's Immovable property set to false.
Changing line 169 of the file RigidCollisionManager.cs
from this:
_transforms[i].WorldMatrix = _rigidBodies[i].Transform;

to :

Vector3 scale = _transforms[i].Scale;
Quaternion rot = Quaternion.Identity;
Vector3 pos = Vector3.Zero;
_rigidBodies[i].Transform.Decompose(out scale, out rot, out pos);
_transforms[i].Position = pos ;
_transforms[i].Rotation = rot;

enables the graphic scaling correctly, but it is likely that the mass of the rigidbody is scaled as well.
I am not sure about this but the scaled object (using the reported code modification) moves quite slower than the original one.
How can I scale the SceneComponent (making it bigger but at the same position of the original one) of an object without scaling the local rigid body?

Many thanks.

#1
11/19/2008 (8:01 am)
Hey, cool! I mentioned problems with scaling components which had a rigid body assigned to them about a month ago, and sort of gave up on the issue due to a complete lack of response from GG, but this actually gives me a decent starting point.

Sorry I don't know how to scale the SceneComponent independant of the rigidbody, but I wanted to thank you for the code you provided above :)
#2
11/25/2008 (11:02 am)
I log such things in my reports for the devs (as this one will be) but I don't usually comment on things unless I can help.
#3
11/25/2008 (2:14 pm)
Quote:I don't usually comment on things unless I can help.

I usually don't comment on other's posts either, unless I can help, so I understand.

I just wish there was an easy way for us to bring problems to their attention and get a confirmation that they at least have seen it. There are probably three or four other critical issues I'm dealing with now, but I've kind of given up on trying to report them by now :)