Game Development Community

Prevent rotations on collisions

by Rob Segal · in Torque Game Builder · 07/01/2006 (6:24 pm) · 3 replies

Is there a simple flag, API call or setting to prevent objects from rotating on a collision so they would stay restricted to a single axis?

#1
07/01/2006 (6:59 pm)
In the onCollision callback you could set the object's rotation to 0...
#2
07/01/2006 (7:20 pm)
Hey good call there Jason. I will give that a try. Thanks.
#3
07/02/2006 (7:33 pm)
Found a much nicer way to confine the axis on collisions in documentation on TDN...

$myObj.setMaxAngularVelocity(0);

Works great. I would imagine you could confine to various axis' by rotated the object first then calling setMaxAngularVelocity right after.