Objects sometimes fall through spherical tree collision

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Objects sometimes fall through spherical tree collision

Postby Andazeus » Tue May 08, 2012 9:12 am

Hello everybody!

I have a problem with a tree collision. It is a sphere that contains several cubes. The cubes are supposed to move randomly within the cube (by applying random forces each frame) and by a button press, gravity kicks in and the cubes are supposed to fall down and come to rest.
In theory, all is working good so far, however, I noticed the cubes sometimes gain incredible momentum when scratching the sphere and sometimes even fall through it, usually with a huge velocity. I also noticed, that this happens the more often, the more detailed (more vertices) the sphere is. It happens pretty rarely on a 16x16 sphere, but relialby on a 64x64 one. The bug also sometimes crashes the program with the following error:

../../source/physics/dgMinkowskiConv.cpp:1030: dgInt32 dgContactSolver::CalculateConvexShapeIntersectionSimd(const dgMatrix&, const dgVector&, dgUnsigned32, dgFloat32, dgInt32, dgVector*, dgInt32, dgVector*, dgContactPoint*, dgInt32) const: Assertion `p.m_z >= p0.m_z' failed.

I am using Ogre 1.7.4 with OgreNewt 2 and Newton 2.35 (more recent versions are not supported by OgreNewt).

Since a visual example always makes things easier, I recorded a short video of the problem: http://youtu.be/BYF8VinujL0
Make sure to activate annotations.

So.. what could I be doing wrong? Or is this a problem with the Newton engine?

If there is anything else I can provide to solve this problem, I will happily do so.

Thanks!
Andazeus
 
Posts: 11
Joined: Tue Mar 20, 2012 11:19 am

Re: Objects sometimes fall through spherical tree collision

Postby Julio Jerez » Tue May 08, 2012 9:30 am

you are not doing anything wrong. the problem is that the speed of teh box may be too fast for the triangle side.

you can do three things:
-run at higher simulationm rate
-Enable continue collision
-Move to Newton 300 were the collision system has being revamped, and all shape now have special collsion hadler functions tah explait soem feature o fteh shape.
for example in that case, teh collsion polygon-convex she\are will be detenetd and ther it will be handel by the Polygon collider.
A polygon collider knows about all of the edge cases than can happen when dealing with a conve shape, and knows how to handle then better than a generic minkosky base collision solver.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects sometimes fall through spherical tree collision

Postby Andazeus » Tue May 08, 2012 10:00 am

Thank you for your quick response!
I took a look at your tips:

Julio Jerez wrote:-run at higher simulationm rate


While this seems to solve the problem, it makes the simulation go way too slow for my purpose.

Julio Jerez wrote:-Enable continue collision


I tried enabling continuous collision for both, the cube and sphere bodies, but the problem persists. :(

Julio Jerez wrote:-Move to Newton 300 were the collision system has being revamped, and all shape now have special collsion hadler functions tah explait soem feature o fteh shape.
for example in that case, teh collsion polygon-convex she\are will be detenetd and ther it will be handel by the Polygon collider.
A polygon collider knows about all of the edge cases than can happen when dealing with a conve shape, and knows how to handle then better than a generic minkosky base collision solver.


Hmm... yeah, I have heard great things about Newton 300, however, as I said I am using the Newton Engine via the OgreNewt wrapper, which hasn't been updated in years. OgreNewt is deisgned for 2.33, but after removing a single line also works with 2.35. Has anybody any experience with OgreNewt and Newton 3?

Also: how stable is Newton 300 already? The final software needs to run somewhat stable and I am therefore trying to avoid alpha/beta versions where I can and all the documentation seems to primarily refer to Newton 2.

Thank you for your help and all the great work!
Andazeus
 
Posts: 11
Joined: Tue Mar 20, 2012 11:19 am

Re: Objects sometimes fall through spherical tree collision

Postby Julio Jerez » Tue May 08, 2012 10:14 am

to se continue collision is not enought to just enable CC in the body, you also need to make a material with CC on.

of the core 300, there are many many improvement than can solve you problem.
you can just download teh packahe for SNV and try it out before you make a decition.

one thing of core 300 is that it litearlly run about twice as fast that any other version. and that is not eveng using optimize simd d code.
making everything equal core 300 is about four time faster than core 200. and much more stable.

porting Ogre new to core 300 should be one day task for anyone familiar with Ogre, and Ogrenewt.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects sometimes fall through spherical tree collision

Postby Andazeus » Tue May 08, 2012 11:18 am

Alright. I'm not 100% sure if I properly understand the material pairs.

I created new materialIDs and with those created a material pair with continuous collision. I then applied the materials to my newton bodies. However, I cannot notic any difference in collision behavior. Shouldn't Newton automatically change the collision based on the settings for the given material pair that was defined?
Andazeus
 
Posts: 11
Joined: Tue Mar 20, 2012 11:19 am

Re: Objects sometimes fall through spherical tree collision

Postby Julio Jerez » Tue May 08, 2012 12:13 pm

as a test use the defualt material for all objects, and set the continue collision option. see if it work first
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron