Sphere does not collide with StaticMesh if LinearVelocity has been changed?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Eltarh
Posts: 1
Joined: Mon May 15, 2017 9:59 pm

Sphere does not collide with StaticMesh if LinearVelocity has been changed?

Post by Eltarh » Mon May 15, 2017 10:08 pm

I have a Space with gravity, and a sphere above a single large triangle StaticMesh. When I simulate, the sphere falls until it hits the StaticMesh and stops - exactly as expected.

However, if I do something like

mySphere.LinearVelocity += new Vector3(10, 0, 0);

as the ball is falling, it then falls straight through the mesh. Note my gravity is on the Z axis, so this linear velocity change is perpendicular (not that it should matter, however).

What am I missing here? I can't see why change the velocity should affect collisions. Thanks so much in advance for any help.

Norbo
Site Admin
Posts: 4558
Joined: Tue Jul 04, 2006 4:45 am

Re: Sphere does not collide with StaticMesh if LinearVelocity has been changed?

Post by Norbo » Mon May 15, 2017 10:20 pm

Assuming that the velocity isn't sufficient to make it simply miss the mesh, and assuming that it isn't falling at a speed so high that discrete updates just happen to miss the collision when it moves sideways a bit, that isn't expected behavior.

Could you reproduce the issue in the BEPUphysicsDemos, or otherwise show an isolated code snippet that reproduces the issue that I could look at?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests