body falls through

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

body falls through

Postby ABACABB » Mon May 09, 2016 4:09 pm

Image


I create level collision using NewtonCreateTreeCollision
Code: Select all
NewtonCollision* const treeCollision = NewtonCreateTreeCollision (world, 0);
NewtonTreeCollisionBeginBuild (treeCollision);
//...
NewtonTreeCollisionEndBuild(treeCollision, 0);


Ok. I use simple sphere for create player control. All works without any problems.
But, when i create some body, using a NewtonCreateBox or NewtonCreateConvexHullFromMesh(on GIF), body can fall through collision mesh.

1 unit ~ 1 meter.
I use Irrlicht Engine.


I need some ideas… What's the problem.
ABACABB
 

Re: body falls through

Postby JoeJ » Mon May 09, 2016 4:52 pm

If the knife is fast enough so that in one frame it is entirely above and next frame entirely below the floor polygon, no collision is detected by default ("tunneling").
You can prevent this by setting continuous collision detection on for the knife:
NewtonBodySetContinuousCollisionMode (knifeBody, 1)
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: body falls through

Postby Dave Gravel » Wed May 11, 2016 5:17 pm

The NewtonSetMinimumFrameRate can help too.
If you use 60, You have more chance to get this problem with objects moving fast.
Maybe 120 can help you to get a better result.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 801
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron