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).