[Fixed] CC static mesh and sphere

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

[Fixed] CC static mesh and sphere

Postby AntonSynytsia » Sat Feb 27, 2016 6:23 am

There is a bug when colliding static mesh with continuous-collision-enabled sphere at high speed. I don't know what's the bug, but here is how to reproduce it:

Open UsingNewtonMeshTool.cpp, and replace the UsingNewtonMeshTool function with this code:
Code: Select all
void UsingNewtonMeshTool(DemoEntityManager* const scene)
{
   scene->CreateSkyBox();
   CreateLevelMesh(scene, "flatPlane.ngd", true);
   int defaultMaterialID = NewtonMaterialGetDefaultGroupID (scene->GetNewton());
   NewtonSetContactMergeTolerance (scene->GetNewton(), 1.0e-3f);
   dQuaternion rot;
   dVector origin(-20.0f, 5.0f, 0.0f, 0.0f);
   scene->SetCameraMatrix(rot, origin);
   dMatrix offset_matrix(dGetIdentityMatrix());
   dMatrix matrix(dGetIdentityMatrix());
   matrix.m_posit = dVector(0.0f, 10.0f, 0.0f);
   matrix.m_posit.m_w = 1.0f;
   NewtonCollision* collision = NewtonCreateSphere(scene->GetNewton(), 0.5f, 0, &offset_matrix[0][0]);
   DemoMesh* const geometry = new DemoMesh("primitive", collision, "smilli.tga", "smilli.tga", "smilli.tga");
   NewtonBody* body = CreateSimpleSolid(scene, geometry, 20.0f, matrix, collision, defaultMaterialID);
   geometry->Release();
   NewtonDestroyCollision(collision);
   NewtonBodySetContinuousCollisionMode(body, 1);
}

Then, open PhysicsUtils.h and change DEMO_GRAVITY to -100.0f, just to trigger the continuous collision check.
Recompile DemosSandbox and run "Using the Newton Mesh Tool" demo.
The crash occurs when the sphere collides with the mesh.
The debugger points to dgCollisionConvexPolygnon.cpp, line 663.
This crash occurs with the Newton 3.14, revision 2524 (1874991 at GitHub).
Last edited by AntonSynytsia on Sat Feb 27, 2016 8:35 am, edited 1 time in total.
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm

Re: [Bug] CC static mesh and sphere

Postby Julio Jerez » Sat Feb 27, 2016 7:55 am

Thank you, I made that bug when I found when was wrong wit the new car,
I has that part of the code commented out without assert, and some time the car tire were hitting that line and reporting no contacts. I re enabled it by forget that is can be call for collsion test only.

Thank you, it is fixed now.
Julio Jerez
Moderator
Moderator
 
Posts: 11086
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [Fixed] CC static mesh and sphere

Postby AntonSynytsia » Sat Feb 27, 2016 8:36 am

Thanks for the fix
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests

cron