Height Field Collision Issue

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Height Field Collision Issue

Postby Esharc » Tue Jan 18, 2022 12:42 am

Julio Jerez wrote:later I will quantize the cylinder and the cone so that but does no happens, but please see
if this fixed the immediate problem.
I solved by


Yes this solved the problem. Thank you
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Esharc » Tue Jan 18, 2022 4:17 am

I have finally got Newton 4 integrated with our application, and finished running all our physics related tests.

But unfortunately the main problem for this upgrade is still present.

As a reminder, the link to the video:
https://youtu.be/AtrR2fbFSwQ

The behaviour in Newton 4 is exactly the same as shown in the video
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Julio Jerez » Tue Jan 18, 2022 8:14 am

Is the mesh you are using a Collison tree?

What shape are you colliding with the floor?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Esharc » Tue Jan 18, 2022 9:32 am

The floor shape is a height field collision and the shape that is colliding with the height field is a compound shape.
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Julio Jerez » Tue Jan 18, 2022 11:47 am

To clarify,
A height field as the primitive, not a user defined.

Regard the compound,
Is your entire vehicle is a compound shape?
If so, what sub shapes are you using for tires?

Also, one of the cool feature of 4.00 is that is has xml serialization.

Please see if you can save you scene, or a small repro.
And see if you can load it in the sandbox.

The you can send it to me so that I can check it out.

Note.
Is possible serialization has to be check, it tends to get out if sync with the development, as we make progress.
But if is fails, is very eassy to bring it up today.

The good thing is that because it is xml, is does not break as eassy as the one in 3.xx which was binary.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Esharc » Wed Jan 19, 2022 12:12 am

Yes the height field is the primitive and not user defined, I set the height data of the height field as the vehicle moves along the terrain from the terrains height data. The terrain itself does not have any mesh associated with it when it comes to the roads.

The vehicle is entirely a compound shape. This is only an AI vehicle and is not user controlled, so we want to keep the vehicle as simple as possible. There are no tires that the vehicle is moving on, and we make the vehicle move by setting impulses for the body.

I will attempt to save the scene today and try and replicate the issue that I am seeing in the sandbox.

I just want to note another issue that I noticed yesterday, when I use ndWorld's convex cast, I do not get the notify callback from the body that the convex cast returns. I am assuming it is because the CastShape function of ndConvexCastNotify creates bodies from the shapes that are being cast and returns those? Will it be possible to return the notify callback of the colliding body when returning from the convex cast?
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Esharc » Wed Jan 19, 2022 4:00 am

I have the serlialized data for the issue that I am getting and I can load it in the demo sandbox application. How can I share the data with you? I have added it to my google drive. Can you perhaps PM me your email address so that I can share it with you, or how would you prefer to get it?
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Julio Jerez » Wed Jan 19, 2022 2:39 pm

Esharc wrote:I just want to note another issue that I noticed yesterday, when I use ndWorld's convex cast, I do not get the notify callback from the body that the convex cast returns. I am assuming it is because the CastShape function of ndConvexCastNotify creates bodies from the shapes that are being cast and returns those? Will it be possible to return the notify callback of the colliding body when returning from the convex cast?


oh yes mi mistake.
the function that cast an find shape in range. is nee to save the found contact and try the new shape, them, if new contacts are found, those can
-replace the old if closer.
-merge is with tolerance,
-ignore if farther away.

tis code
if (callback.OnRayPrecastAction (body, &convexShape))
{
ndConvexCastNotify castShape;
ndBodyKinematic* const kinBody = body->GetAsBodyKinematic();
if (castShape.CastShape(convexShape, globalOrigin, globalDest, kinBody->GetCollisionShape(), kinBody->GetMatrix()))

the problem is that I made the call on the temp notification when should be on the pass notification

I will send you the PM later. we will probably do this over the weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Esharc » Thu Jan 20, 2022 1:16 am

Julio Jerez wrote:I will send you the PM later. we will probably do this over the weekend.

Ok sounds good.

Regarding the convex cast that you just fixed. Sorry I did not specify the problem that I was having clearly enough, although this fix that you made was also necessary. What I meant was the body that is returned from the ConvexCast, if I try to use ndBody::GetNotifyCallback()->GetUserData() from the returned bodies, the returned user data is null because the returned body is not the body that I created with my custom ndBodyNotify, but rather the one that was created from the shape in the CastShape function of ndConvexCastNotify
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Julio Jerez » Thu Jan 20, 2022 2:18 am

oh I see, bool ndConvexCastNotify::CastShape(...)

is no correct, I make tow temp bodies, to do the casting, but since this is a scene function, it should just make one body for the casting shape, and use the other the body found while scanning the scene.

there where more than one bug there. I fix it in the morning,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Julio Jerez » Thu Jan 20, 2022 7:19 am

Try now.
That was actually a real bad bug, the function was detecting contact, and was passing the pointer to the body and shape made in the stack for the call. Using the would Seoul in a crash.

Now there are two function.
Each replace the object with a nullptr. When apply.

So if you iterate over the body, it they will be valid if ther are not null.

This way. When calling with one body as argument, you get the body is in the scene. In the notify.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Esharc » Thu Jan 20, 2022 8:28 am

Thank you, that solved the problem I was having
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Esharc » Tue Jan 25, 2022 8:58 am

Hi Julio,

I am going to keep the bugs and issues with the Newton 4 upgrade in this thread. If you would rather me send the messages as PM messages let me know.

I am busy investigating the solution you suggested using the procedural static mesh, but I am getting an assert when one of the shapes is a compound shape. The assert is in ndContactSolver::CalculateContactsDiscrete() line 2468.

Also I am getting an assert in ndPolygonSoupBuilder::PackArray(). This is unrelated to the procedural static mesh, but happens when we load a big terrain and we use the builder to create a ndShapeStatic_bvh shape. This worked fine in Newton 3
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Height Field Collision Issue

Postby Julio Jerez » Tue Jan 25, 2022 11:58 am

Discussing here is fine.

On the test, has you tried to just make a large enought terrain heightfield, say a tile 128 x 128, and drive your ai car over that tile?

This is not the solution, but will be the prove that it will solve the problem.

Them if that works. You move to the next step wich will be make the procedural mesh that just pases the sub tile that cover the aabb.

If you look at both, terrain Heighfield and polygonal-bvh

That's what they do, capitalizing in the property of the data.

I will see what those asserts are about.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Height Field Collision Issue

Postby Julio Jerez » Tue Jan 25, 2022 12:44 pm

ok let us see one assert at a time.
this is important.
Esharc wrote:I am busy investigating the solution you suggested using the procedural static mesh, but I am getting an assert when one of the shapes is a compound shape. The assert is in ndContactSolver::CalculateContactsDiscrete() line 2468.


if you sync, I added the trace so that it is easy to know what pair cause to go to that line
Code: Select all
      dTrace(("Fix compound contact for pair: %s %s\n", m_instance0.GetShape()->SubClassName(), m_instance1.GetShape()->SubClassName()));
      dAssert(0);


It will trace siomething like:
"Fix compound contact for pair: ndShapeCompound ndShapeStatic_bvh"



I also added all the combination to the compound demo that you made, and none of them generate that assert, I am sure is there, but it can seem to make it happens.

after you sync, when you get the assert again, please tell me what that trace says so that I can recreate it and fix it.
them we deal with the secund problem.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 5 guests