Is there a built in way to limit entity velocities?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

Is there a built in way to limit entity velocities?

Post 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;
        }
Fe_Yoshi
Posts: 397
Joined: Tue Jul 04, 2006 5:05 pm
Location: New Tower!

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

Post by Fe_Yoshi »

One cannot simply limit bEPU!!
It's simple, just take the hydraulic phase ship emulator and attach it to the photon particle emitter, BAM, new tower!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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.
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

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

Post 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 :)
Post Reply