[SOLVED] dgAssert disable macro

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: dgAssert disable macro

Postby Julio Jerez » Wed Sep 04, 2013 2:15 pm

Oh I see, yes there is a function in the utiklities that use Calculate AABB usin the support vertex function.

void CalculateAABB (const NewtonCollision* const collision, const dMatrix& matrix, dVector& minP, dVector& maxP)

Using support generates more acurate box that using Newton CalculateAABB because the secund funtion has to consider Padding for the Broaad Phase
plus the secund also uses LOD data and not the mesh data.
I am guessing see you are using it for calculation AABB on static meshes.
I am hopping you are using a scene collsion to place all those static meshes.
scene collision is the answer of Newton 3.00 to large scale static worlds that also need to be fragmented into smaller objects. stuff liek buildisn, pros, terrains, etc. all cna be place on a scene collision and they coun as a single body. the numbe of stuff that you can put there is unlimited.
and provide teh added bonus of automatic instacing even with scaling.

Ok I'l check that out tonight
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dgAssert disable macro

Postby Julio Jerez » Wed Sep 04, 2013 3:15 pm

ok I added the dgSupportVertex to collsion trees.

I alse mak ethe meny option use the aabb base of support vertex
Code: Select all
void RenderAABB (NewtonWorld* const world)
{
   glDisable (GL_LIGHTING);
   glDisable(GL_TEXTURE_2D);

   glColor3f(0.0f, 0.0f, 1.0f);

   glBegin(GL_LINES);
   for (NewtonBody* body = NewtonWorldGetFirstBody(world); body; body = NewtonWorldGetNextBody(world, body)) {
      dVector p0;
      dVector p1;
      dMatrix matrix;
      NewtonCollision* const collision = NewtonBodyGetCollision(body);
      NewtonBodyGetMatrix (body, &matrix[0][0]);
//      NewtonCollisionCalculateAABB (collision, &matrix[0][0], &p0[0], &p1[0]);
      CalculateAABB (collision, matrix, p0, p1);
...

   }
   glEnd();
}


Hiowvere this is just for a test, the sandbox demo porposue of to show teh AABB as they are used by teh engine, and teh Suport vertex AABB is a much tighter box.

Sync to SNV and try again. also It will be good if you run with the assert on, it will show teh places were thse thong are eieth missing or malfuntioning.
I did not added fo terrain, bu I eeive teh code is still there. I will check that later
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dgAssert disable macro

Postby pHySiQuE » Wed Sep 04, 2013 3:22 pm

The next time I hit it is in dgKinematicBody::ApplyImpulsePair.

I understand this command makes no sense to call, but I can't have these landmines scattered through the code waiting for my users to find them. It would be better for it to do nothing than to crash.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: dgAssert disable macro

Postby pHySiQuE » Wed Sep 04, 2013 3:30 pm

With the latest revision I get this error.
Image2.jpg
Image2.jpg (249.05 KiB) Viewed 1409 times
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: dgAssert disable macro

Postby Julio Jerez » Thu Sep 05, 2013 6:34 am

pHySiQuE wrote:The next time I hit it is in dgKinematicBody::ApplyImpulsePair.
I understand this command makes no sense to call, but I can't have these landmines scattered through the code waiting for my users to find them. It would be better for it to do nothing than to crash.


actually kinematic bodies do have mass, and velocity they can have impulses applied to them, in fact it is the right thing to do.
sync to svn, I move the implementation to the base class, and now dynamics and kinematic bodies can receive impulse.

do not forget to enable the assert, see if you find more incomplete parts.


ON the crash I do no see how the function crash there, that is an old function and it may well have a bug, but I do no see in my test. do this.

Serialize the scene the generate the crash before you call that AABB calculation, then try to load it the NewtonSanbox demos.
after you load it, go to the menu options and click show AABB.
that will call the function to show the AABB and may expose the Box.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron