Hi,
Anyone knows how to use MaximumLinearSpeedConstraint to constraint linear speed limit to the entities in a simulation island? I'm using bepu in my own billiard game and occasionally a ball can go insanely fast.
This MaximumLinearSpeedConstraint is the only clue I've found so far but I found no example associated with it.
Appreciate it if anyone can help.
Thanks.
Gao Yang
How to use MaximumLinearSpeedConstraint
Re: How to use MaximumLinearSpeedConstraint
Here's an example:
However, if you are seeing invalid behavior, I would recommend tracking down the source of the invalid behavior first before patching it with maximum speed constraints.
Code: Select all
//Create the constraint and give it the affected entity and maximum speed.
var maximumSpeedConstraint = new MaximumLinearSpeedConstraint(entity, 10);
//Weaken the constraint a bit. This is completely optional; it just shows one of the ways to further configure the constraint.
maximumSpeedConstraint.Softness *= 10;
//Add the constraint.
Space.Add(maximumSpeedConstraint);