Topic: Any way to turn off physics torq or movement on an axis?

I guess the title says it all. I'd like some objects locked to the Z axis, but I'm pretty sure it's not in the properties tag.

Last edited by g1i1ch (2013-08-01 06:14:22)

Re: Any way to turn off physics torq or movement on an axis?

You can only lock torque on all axis with "angularFactor"
if you want to lock only one axis you need a constraint with a parent and an angular limit like :

AngularLimits
lox 0
loy 0
loz -180
upx 0
upy 0
upz 180

but you need to be clever with how you setup the parent if you don't want the parent to influence the collision shape,
also axis are local so be sure your parent orientation is like you want.

Re: Any way to turn off physics torq or movement on an axis?

That's unfortunate. The game I'm making is a 3d game played like a 2d game. That alone knocks out at least 3 of my game ideas. Is there any way to make a 2d style 3d game without having to edit source? I've done c++ before but I'd rather not.
Hopefully locking certain axis is on the todo list.

Re: Any way to turn off physics torq or movement on an axis?

If you set the linearFactor 'z' to zero the physics will be 2d in translation.
For the rotation as I said it should work with a constraint, you can also reset one rotation axis to zero every frame in lua.

But yes I'll see if there is a way to enable per-axis angularFactor with bullet, if yes it won't be complicated to add.