Showing posts with label damp. Show all posts
Showing posts with label damp. Show all posts

Tuesday, 30 April 2019

recalculating velocity

Nicked from Walter..

Velocity is a vector..
Velocity=speed x direction.
I was using this because some of my POPs had too much speed and were going through my collision objects.

If you store the normalised version of your velocity, this is the direction. Then you can multiply it by a new speed.. Perhaps you want to make it 85% of it's velocity until it reaches your max target?

So...in VEX:


vector direction=normalize(@v);

float speed=length(@v);

if(speed>chf("maxSpeed")){

speed*=chf("dampMultiplier");
}