Hitting assert in dgCollisionConvex.cpp

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Hitting assert in dgCollisionConvex.cpp

Postby Bird » Thu Sep 12, 2013 1:08 pm

Thanks for the info

I've been testing a big stack of models and found just a couple of crashes

http://hurleyworks.com/downloads/SimpleTree.zip
http://hurleyworks.com/downloads/Beetle.zip

To be a well-behaved, my plugin needs to quickly abort any time the user wants to quit so I need some way to interrupt a long convex decomposition calculation. Would be possible to add a bool to the progress callback so clients can signal an abort like you talked about in this thread. http://newtondynamics.com/forum/viewtopic.php?f=9&t=7716

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Thu Sep 12, 2013 2:41 pm

NewtonMesh* NewtonMeshApproximateConvexDecomposition (const NewtonMesh* const mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportPrograssCallback);

I though that function did have a progress report? do you mean to pass the repot progress to soem of the internal functions that are used?
are you using the progesss callback?
can you make a video of the progress slowdown?

I will debug the two scne tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Thu Sep 12, 2013 2:42 pm

Oh I see you want an early termination on the progress calbback, yes I will do that.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Fri Sep 13, 2013 11:48 am

Ok now the progress bar has a return value, returning false will terminate and return NULL.

I also fix the bug prosssssing those tow mesh, the tree is a very untreatable mesh, to get a decent conxification I have to increase the convex count for 32 to 256

// NewtonMesh* const convexApproximation = NewtonMeshApproximateConvexDecomposition (mesh, 0.01f, 0.2f, 32, 100, ReportProgress);
NewtonMesh* const convexApproximation = NewtonMeshApproximateConvexDecomposition (mesh, 0.01f, 0.2f, 256, 100, ReportProgress);

the produces a nice partition.

this volswagen model, is a very high rest mode and the code was overflowing intermediate buffers. I also have to mak ean adaptive reduction, because reducing to 1500 faces, but tha does no do a good job,
my maing adaptive tshi si hwo the rreduce to 1.5% of the original size is, tshi si hwo it look like afte reduction, and that is what is convex to convexes.
polyReduction1.png
polyReduction1.png (149.99 KiB) Viewed 7865 times


the tree does not get reduce almost at all, therefore the tree which has about 25000 face take longer that the beetle which has 250000 because the beetle gets reduce s to about 6000 faces.

anyway I believe that conclude that problem, at lest for now, now I will fix the collision bug with the static armadillo scene.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Bird » Fri Sep 13, 2013 5:07 pm

Ok now the progress bar has a return value, returning false will terminate and return NULL.

Works great and I can confirm that both problem meshes no longer crash.

Thanks very much!

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Sat Sep 14, 2013 11:07 pm

Oh glad it is working.

I think now fixed the bug wi the hi rest mesh collision colliding with large convex.
Please try the armadillo scene again, and let me know how it goes and let me know.

I notice that you set those bodies to have CCD on, which is cool because I get to test that part of the engine.
Anyway.

I will continues with the Scale, to see if I can completethat stuff this weekend
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Bird » Sun Sep 15, 2013 11:20 am

I think now fixed the bug wi the hi rest mesh collision colliding with large convex.
Please try the armadillo scene again, and let me know how it goes and let me know.

The original Armadillo scene and some other previously failing test scenes work fine now. But if I scale the Armadillo up or down then collision detection fails

Here's the serialized scene http://hurleyworks.com/downloads/ScaledArmadilloScene.zip

I notice that you set those bodies to have CCD on, which is cool because I get to test that part of the engine.
Anyway.


I forgot I left CCD on by default after testing it out. Is there any reason for me not to leave it on for all objects? Is there some performance hit when it's on?

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Sun Sep 15, 2013 11:43 am

Like I said, I secreted the calculation of scale vs no scaled calculation of contacts points.

Before there was a General way to handle scale, but when introducing the non uniform, the general form become too expensive in run time calculation.
now I am handling special case by special case, this require more coding, by I believe it is worthy.
to day IO am adding the handling of uniform scale, and if I had time I will try to add the norm uniform scale.

For the continue collision, yes is cost more to handle CCD that discrete collision, but I believe you should leave on. The one thing that make newton 300 very different that Newton 200
is that CCD I more accurate than discrete collision in newton 300.
In all previous version CCD was a anti tunneling prevention measure that did no guarantee conservation of momentum, but now it does. but this does not comes free.

as a general rule you turn CCD on small objects, or object that move too fast. Late I will see if I can make the CCD adaptive. I had tried that in pass and it always fail, because you can never guess with a body
moving a low speed can game a high speed after collision and when CCD off it will tunnel through other bodies.

after I add the scale fix I will test the new armadillo scene, thanks for the test.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Sun Sep 15, 2013 12:33 pm

Oh I am trying to debug the scene, by I have having problems, I belie you place tow armadillo on the exact same location and that make it very difficult to debug.

can you make the same scene with only one armadillo, use the high resolution one and make the scale 2.0
those values makes it eases for me to debug and see what is going on?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Sun Sep 15, 2013 12:49 pm

never mind the scene is right, I am debugging it
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Mon Sep 16, 2013 12:02 pm

Ok try this again. I still have lot of work on this but this is a step on the right direction.

There ono thing I wan to mention. The collision with the high rest armadillo is a special case that is not normal for real time physics simulation.
the model has over 250,000 faces and on top of the is very small
on top of that you are applying a scale the make it even small, and you are colliding with a box that is many time overt bigger that the model itself.

Basically this condition break all of the assumptions I have to make to get high performance, which is that the mesh will be much larger that the collision object kerned Box.

Is not uncomment to have mesh of that size on a game, by in general they will be either a full building of collation of building, or and entire level, here it is use a prop the size of kitchen jar.
what happen if thet the code that find the best gace to calculate contact end up walking the entire search space, to find just a few faces.

last the face are too small thet you are right you nee to set to CCD, because if no then too mane face end up 100% inside the box, and the made if very difficult to determine the contact orientation.
CCD avoid that because it work with faces that touch the surface, theorem the surface normal is known.

That armadillo may be a good test case for when I add the voxel space using signed distance map. because eteh signed distance map provide volume information that is not available in a polygonal mesh.


Please try again and let me know what you get.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Julio Jerez » Mon Sep 16, 2013 1:22 pm

Oh if you are in teh proccess of testing, please sync again tehwr was a bug.

I also thonk I have an idea hwo to make the new code effiecnt for bote caset
-When then collsing Box is large rellative to the size of the collision mesh,
-when the collidng box is mall relative to the the size of the collision mesh.

it is very simple so I will add that fix tonight beaofre anything.

I never though that teh sacle stuff was going to be this hard, It keep understimatuiong is it, by teh is alway some cactch.
The problem is that the scale is in fact a no linare prossess. It need to use intevale arithemetic and when using intevale arithemetuioc seem are no as intuitive as they seems, but I beeove is worth to have that finished
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Hitting assert in dgCollisionConvex.cpp

Postby Bird » Mon Sep 16, 2013 1:52 pm

Oh if you are in teh proccess of testing, please sync again tehwr was a bug

Heh, I got this just as I was filing another bug report. :)
After res-yncing the bug I was about to show you has been fixed. I can even drop the big box on the Armadillo with gravity set to -300 and it works fine.

I never though that teh sacle stuff was going to be this hard, It keep understimatuiong is it, by teh is alway some cactch.

Seems like that's always the way in this business. :)

I appreciate all the effort you're making to get this working!

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 5 guests

cron