Game Development Community

How do I dampen?

by Devboy · in Torque X 2D · 01/20/2007 (4:07 pm) · 2 replies

How do I dampen or add drag to an object?

I couldn't find anything relevant on the object nor the physics component.

What I did find is the method used in Torque Combat:

_player.Physics.VelocityX *= _damping;


Every tick.

I was wandering if there's a 'built in' way to do this.

Cheers

#1
01/20/2007 (4:31 pm)
You can do it manually like TorqueCombat or use a T2DForceComponent with a DragForce on it. No good tutorials I'm afraid. Are you looking to do this through code or xml?

#2
01/20/2007 (4:39 pm)
Well either one is fine.

I'm already using T2DForceComponent.Force for gravity. I took a look at DragForce, pretty straight forward, I'll use it, thanks!

Another question though, as far as physics are concerned, how would I simulate joints?
I figure I can use links with MountForce to simulate a spring, but how would I do something like a rotating joint?