Super Car and my collision issue

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Super Car and my collision issue

Postby Neill » Wed Mar 25, 2015 2:16 am

Hello to everyone,

I'm working on a physics plugin for MotionBuilder and implemented SuperCar demo inside. On simple ground plane it works fine, but on custom geometry (I'm using static collision tree) the wheel couldn't stay on the mesh properly. Here is a video about my issue - http://youtu.be/scTNqaiFUYM
Could anyone help me with some tip how that can be solved. Maybe static collision tree is not suited well for wheels collision model ?

Thanks.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Julio Jerez » Wed Mar 25, 2015 11:26 am

That seem to be a recurrent problem.

In Newton collision mesh are single sided. My Guess is that you mesh under either has double side faces or some face are upside down.
Try implement the debug functions to display the collision mesh.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby Neill » Wed Mar 25, 2015 3:19 pm

Thank you Julio, I will check geometry. Interesting moment is that chassis body collides fine with the level collision, only wheels pass through.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Neill » Wed Mar 25, 2015 3:50 pm

I've cleanup the level geometry in maya and imported a tesselated mesh. This time the behaviour is the same - http://youtu.be/uFPlrqNAEAA
Chassis collides fine, wheels pass through and I've disabled optimize option in collision tree, so now I have raw triangles in debug view. Strange that it's happent only with wheels and car AABB in debug view shows changes everytime, like something inside is flying around.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Julio Jerez » Wed Mar 25, 2015 5:41 pm

well yes the chassis will collide If there are some faces facing up.
The video seems to show the wheel going trough cracks, in the mesh.

I can no see the second video, but try placing a small object the size of the wheels in the mesh, see if collides well.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby Neill » Wed Mar 25, 2015 8:27 pm

Yes, I've made test with small convex cubes and they are falling through the level collision. But I have no idea how to solve that problem. I've reverted the vertex order in polygon - didn't help, then I was trying to use NewtonMesh to run several function like Polygonize, FixTJoints, ComputeNormals and still nothing. I was trying to apply different scale to the world elements, it helps just a little, but still unstable. I give up, I was trying to run the simulation one year ago and now with a new version of engine, but I still couldn't understand how to make it stable and predictible. Last time I was able to run good simulation was 5 years ago - https://www.youtube.com/watch?v=6RS9uvxOoIE
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Julio Jerez » Thu Mar 26, 2015 12:44 am

Ok now we know that the problem is no the Car is the mesh.
Like I sad the problem seem to be that you mesh has double Faces.
here are few test.

1- do you have a function that can display the collision mesh? the will expose if there are bad faces.
2- you can serialize the scene with a Small Mesh and a small collision that can fall through the Crack.
the function for saving a scene is
void NewtonSerializeToFile (const NewtonWorld* const newtonWorld, const char* const filename);

they you can load it in the Test Demo, and see how is work, and send it to me I can quickly see what is wrong.
I am more than 95% sure that the mesh is dirty and can not be converted to a Maniforld.

One of the reason that mesh come with face wining is that many Packages like Max and Maya store face using triangle strips. and Triangle strips alternate face winding. and you end up with one face point up and the next adjacent pointing down.
The happen because my guess you made the piece of road from a Curve surfaces. and those algorithm generate the Mesh as Tri Strips.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby AntonSynytsia » Thu Mar 26, 2015 2:16 am

Another reason to bad generation is that some polygons in mesh could be too small. As Neill mentioned, the scaling helped just a little, but still unstable, which might imply that there were some polygons that were too small. The reason I'm mentioning this is that I had a few situations where some faces in my model were very small and were prevented by newton mesh from being part of tree collision.
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm

Re: Super Car and my collision issue

Postby Julio Jerez » Thu Mar 26, 2015 9:48 am

when I look at the video it look as if all polygon are regular sizes and well spaces out.
My guess is that the algorithm he is using to get the triangle is producing face with alternate face winding.
This is typical of Strips generate from patch algorithm.
It is easy to test this by just drawing the collisions mesh with solid faces.

In any case, He said that he gave up, so I do not think there in more I can do.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby Neill » Thu Mar 26, 2015 11:31 am

Thanks Julio for your message. I was rebuilding a geometry from subdivided plane. This time car with wheels places on a surface and start moving, but after several polygons I have a bug message about matrix orthogonal test. This appears on calculating collision with tire when tire is on the edge between two polygons. Does it mean the same, that next polygon is in reverse order ?

Link to image on google disk:
https://drive.google.com/file/d/0B83XZ3TC_S6PLU9IcVg3eTFxT28/view?usp=sharing

P.S. I will try to serialize this polygonal road to try in the demo to somehow show you.

And one more question. Is it ok that my AABB of a car is not correctly bound the car and can be changed during a simulation ? Like in the image, the car AABB goes somewhere far away at the top.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Julio Jerez » Thu Mar 26, 2015 12:59 pm

No that's there that is the warning that is show the error.
I notice the aabb being very big too, I though it was a Graphic AABB.
the AABB should match he Rigid Body exactly, that is also another indication that some is wrong, this could be a bug on you side or on the engine side, are you using a large scale?

yes serialize the Mesh with Vehicle, it will come as a dynamic compound body,
then load it in the demo. if it load send it to me I can determine what is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby Julio Jerez » Fri Mar 27, 2015 2:11 pm

did you serialized the scene?
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Super Car and my collision issue

Postby Neill » Fri Mar 27, 2015 9:58 pm

Julio, sorry, today was a hard busy day. I will continue my work tomorrow and at first on scene serialization.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Neill » Sat Mar 28, 2015 12:31 pm

Hi Julio,

There is a function NewtonSerializeToFile, I run it when car was on a ground. Here is a link to a file - https://drive.google.com/file/d/0B83XZ3 ... sp=sharing

Does the file contain needed information to check or what could be a convenient form of serialization for checking ?

P.S. my graphics world scale is 0.1, but to be more precise in scaling I will find dimentions of a car in your sandbox to fit my graphics part.
Last edited by Neill on Sat Mar 28, 2015 12:47 pm, edited 1 time in total.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Re: Super Car and my collision issue

Postby Neill » Sat Mar 28, 2015 12:47 pm

ok, I've found how to test serialization data. In sandbox there is an option in main menu. After loading car is falling down without collision with a road.
From that serialization data I can see that aabb is bounded around the car as it should be. So I think in my case some car simulation information increase aaabb somehow.
I've checked that in sandbox the wheel width and radius is about 0.31 and it very close to what I have after applying scaling to my scene.
Neill
 
Posts: 16
Joined: Wed Mar 25, 2015 2:11 am

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests