Exception in dNewton::OnCompoundSubCollisionAABBOverlap

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Thu Oct 25, 2018 12:06 pm

I have been testing and updating some code.

I am getting exception in dNewton::OnCompoundSubCollisionAABBOverlap.

I am dropping a box onto a flat surface. It bounces once then the second time it hits the surface I get the exception.

To give some background I am building the surface from vertices so it could be possible I have added the vertices incorrectly. I did not add normals or anything else in the build process.

Could it be my mesh creation?

Image
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Julio Jerez » Thu Oct 25, 2018 2:13 pm

check is collision0 and subCollision0 have the same value, if so them it mean this si a root collision shape and must have user data
Code: Select all
NewtonCollision* const collision0 = NewtonBodyGetCollision(body0);
NewtonCollision* const subCollision0 = collisionNode0 ? (NewtonCollision*)   dNewtonCollision* const dsubCollision0 = (dNewtonCollision*)NewtonCollisionGetUserData(subCollision0);


also can you list the stack trace to see what function call it?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Thu Oct 25, 2018 3:02 pm

Here is the call stack. I just updated Newton and am now hassling with .pdbs.

Image
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Fri Oct 26, 2018 5:49 am

dSubCollision0 is NULL which seems like a problem
subCollision0 has a value

The calling function is CollissionScene::CollidePair

I am trying to do a static scene and dynamic body.

It could be my attempt at creating a mesh for the floor but I am not sure. You can probably tell what the problem might be from the above.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Julio Jerez » Fri Oct 26, 2018 9:22 am

the only difference between a scene and a compound is tha the scene accept Collison meshes (collsion tree and terrain) as child shapes.

if you made a collision tree and added to a scene collision, I can't see how you get a null pointer if that is the problem .
I can't see how that happens form teh information you are giving me.
can you make a repro test?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Fri Oct 26, 2018 9:40 am

Apparently I am good at creating a problem. I've been looking and looking at my mesh parsing but can't yet see the problem.

If you look at my screen caps you can see dsubCollision0 is NULL.

I have to assume it is something wrong with how I am creating the Newton mesh. It is weird because it bounces once and then the second time it comes down it crashes.

It might be tricky to make a repro test since I am using Ogre and trying to use Newton with the minimum of wrapping.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Julio Jerez » Fri Oct 26, 2018 9:41 am

can you just make an executable that link to the newton dll?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Fri Oct 26, 2018 10:48 am

I also noticed stepping through that crash that collisionNode1 is NULL from:

Code: Select all
int dNewton::OnCompoundSubCollisionAABBOverlap(const NewtonJoint* const contact, dFloat timestep, const NewtonBody* const body0, const void* const collisionNode0, const NewtonBody* const body1, const void* const collisionNode1, int threadIndex)
{


It looks like it might be valid that collisionNode1 could be zero so maybe that is not a problem.
Last edited by Slick on Fri Oct 26, 2018 10:51 am, edited 1 time in total.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Fri Oct 26, 2018 10:50 am

I do have graphics and physics in separate threads so hopefully that isn't something to think about. It shouldn't be.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Julio Jerez » Fri Oct 26, 2018 1:27 pm

collider node can be null yes,
when a collider is null, the collision is the collision in the body, else is a some child collision.
from some hierarchical collision shape.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Fri Oct 26, 2018 2:15 pm

Edit: not working

I got it working. Even though I have a small wrapper I reduced it down even further than before following your UsingNewtonMesh example (I was already trying that). I'm not sure what the problem was. Maybe not setting the collision correctly to the body I am not sure.
Last edited by Slick on Sun Nov 04, 2018 10:37 am, edited 1 time in total.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Sun Nov 04, 2018 9:19 am

I thought I had resolved this but still getting the assert
Code: Select all
dAssert(dsubCollision0);

in:
Code: Select all
int dNewton::OnCompoundSubCollisionAABBOverlap(const NewtonJoint* const contact, dFloat timestep, const NewtonBody* const body0, const void* const collisionNode0, const NewtonBody* const body1, const void* const collisionNode1, int threadIndex)


If I was able to create an example, not in sandbox because using Ogre, and I linked to debug dll for Newton would that enable you to debug?

Basically I create a dNewtonCollisionScene and a separate dynamicbody a ball. When the ball hits the scene I get that assert. I tried setting the body ptr to the collision for the scene (I think that is deprecated) but still get the assert.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Tue Nov 06, 2018 5:46 am

I'm going to have to give up on Newton. I've spent days trying to get beyond a simple crash between two objects. I'm sure it is something I am doing but there are so many possibilities.

The latest attempt I get a crash here:

Code: Select all
void OgreNewtonWorld::OnContactProcess (dNewtonContactMaterial* const contactMaterial, dFloat timestep, int threadIndex) const
{
   for (void* contact = contactMaterial->GetFirstContact(); contact; contact = contactMaterial->GetNextContact(contact)) {
      dNewtonCollision* const shape0 = contactMaterial->GetShape0(contact);
      dNewtonCollision* const shape1 = contactMaterial->GetShape1(contact);
      const dMaterialPairManager::dMaterialPair* const materialPair = m_materialMap.GetPair (shape0->GetMaterialId(), shape1->GetMaterialId(), threadIndex);


Shape 1 is a nullptr when the cube hits the terrain.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Julio Jerez » Tue Nov 06, 2018 7:48 am

the problem is that you keep posting the prototype of a functions where a cash happens, and that is not enough for me to find out why this happens.
I ask if you can make a repro test, like an executable that links to the dll but you how you say is not possible, so is not much I can do with what you give me.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Exception in dNewton::OnCompoundSubCollisionAABBOverlap

Postby Slick » Tue Nov 06, 2018 8:14 am

I will try and build an app linking to the debug dll.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 14 guests