Page 1 of 1

Is there a built in way to limit entity velocities?

Posted: Fri Sep 30, 2011 12:17 pm
by Spankenstein
Is there a property that I can set to limit the velocities in BEPU?

At the moment I'm having to limit the velocity of each entity manually:

Code: Select all

        public static void SetLength(ref Vector3 v, float length)
        {
            v.Normalize();
            v *= length;
        }

Re: Is there a built in way to limit entity velocities?

Posted: Fri Sep 30, 2011 5:21 pm
by Fe_Yoshi
One cannot simply limit bEPU!!

Re: Is there a built in way to limit entity velocities?

Posted: Fri Sep 30, 2011 7:22 pm
by Norbo
Is there a property that I can set to limit the velocities in BEPU?

At the moment I'm having to limit the velocity of each entity manually:
That's pretty much all an internal system would do (though if you want a limit, it would only correct it if over the maximum velocity, and it needs to protect against zero velocity NaN's). If you want more robustness in the face of interfering forces, you could use the (slower) Maximum(Linear/Angular)VelocityConstraint.

Re: Is there a built in way to limit entity velocities?

Posted: Fri Sep 30, 2011 8:26 pm
by Spankenstein
though if you want a limit, it would only correct it if over the maximum velocity, and it needs to protect against zero velocity NaN's
I could always use LengthSquared and put the sign back in afterwards; saves a square root calculation.

Would also make it easier to protect against zero velocity with a small epsilon value check too.

Thanks :)