Game Development Community

Clamping Velocity

by Eric Armstrong · in Torque Game Builder · 03/07/2006 (12:01 pm) · 6 replies

I know there was talk a while back of possibly adding a setting to clamp velocities. Is that still going to happen? I didn't see anything in the docs that looked like it had been added. I was about to roll my own, but wanted to check before so I didn't end up putting something in that was already there or going to be there.

Thanks...

#1
03/07/2006 (12:53 pm)
It was actually simple enough to just drop in there I went ahead and did it. If anyone would be interested in the changes, just let me know and I'll post them here...
#2
03/07/2006 (2:48 pm)
Could you explain what's the result?
not sure I understand (my fault) what your change will do.
thanks
#3
03/07/2006 (3:29 pm)
I have a projectile that bounces around the screen. When it hits certain objects, it's velocity is increased. This change allows me to set a maximum velocity, so regardless of what the physics calculations determine, the projectile will "top out" at the speed I wish it to. I'll also be updating it to allow me to set a minimum velocity for the object also. Essentially, it just allows you to put some controls on any t2d object concerning, at this point, the linear velocity of the object.

Without this change, the projectile would get so fast as to be pretty much beyond the response time of your average human being.

Hopefully that helps a bit...
#4
03/07/2006 (3:54 pm)
Ok.. that is what I thought it would do, thanks... and it is cool!

I remember trying to control the speed of an object through the get and set linear velocity and having some hard time... I thought it was just me because that was right the day after I bought T2D, probably it was me anyway:)

your change would be good!
#5
03/07/2006 (6:05 pm)
Is this different from what the setMaxLinear[or angular ]Velocity() function does? I'm actually really asking, not trying to be a jerk :)
#6
03/09/2006 (6:05 pm)
There's also a setMinLinear/AngularVelocity(). :)