☑ How do I handle fast moving rigid bodies?

Hi,
I am working on a baseball demo on the HTC vive with a bat mapped to a controller. It works fine when the bat moves slowly but when it moves fast the physics engine doesn’t keep up and the balls just move through the bat.

I could probably program my own routine around the problem but I was wondering if there are any tweaks that could make the physics engine react quicker.

The project is at

https://playcanvas.com/project/419860/overview/baseball

Update: Looks like I have sorted this issue, found an old post and added

 // experimental
    entity.rigidbody.body.setCcdMotionThreshold(0.0001);
    entity.rigidbody.body.setCcdSweptSphereRadius(0.50);
    //

to the ball physics and it seems much better

1 Like

Sir I can’t launch your game, whenever I launch it, it says “Failed to recalculate device parameters” and the screen goes black.

Very likely you don’t have HTC Vive available.

Please don’t resurrect old topics unless there is really a reason.

1 Like