ok I was looking at the first bug and I find some extrenge
in this sequence of calls, I see you are making a rigid body with a compound collision, is that right?
> newton.dll!dgCollisionCompound::dgCollisionCompound(dgWorld * const world) Line 474 C++
newton.dll!dgWorld::CreateCompound() Line 241 C++
newton.dll!NewtonCreateCompoundCollision(const NewtonWorld * const newtonWorld, int shapeID) Line 2441 C++
Urho3D.dll!Urho3D::NewtonRigidBody::reBuildBody() Line 197 C++
Urho3D.dll!Urho3D::NewtonRigidBody::reBuildBodyParent() Line 164 C++
Urho3D.dll!Urho3D::UrhoNewtonPhysicsWorld::HandleUpdate(Urho3D::StringHash eventType, Urho3D::HashMap<Urho3D::StringHash,Urho3D::Variant> & eventData) Line 208 C++
Urho3D.dll!Urho3D::EventHandlerImpl<Urho3D::UrhoNewtonPhysicsWorld>::Invoke(Urho3D::HashMap<Urho3D::StringHash,Urho3D::Variant> & eventData) Line 419 C++
Urho3D.dll!Urho3D::Object::OnEvent(Urho3D::Object * sender, Urho3D::StringHash eventType, Urho3D::HashMap<Urho3D::StringHash,Urho3D::Variant> & eventData) Line 126 C++
Urho3D.dll!Urho3D::Object::SendEvent(Urho3D::StringHash eventType, Urho3D::HashMap<Urho3D::StringHash,Urho3D::Variant> & eventData) Line 370 C++
Urho3D.dll!Urho3D::Engine::SendUpdateEvents() Line 738 C++
Urho3D.dll!Urho3D::Engine::Update() Line 725 C++
Urho3D.dll!Urho3D::Engine::FreeUpdate() Line 683 C++
Urho3D.dll!Urho3D::Application::Run() Line 94 C++
11_Physics.exe!RunApplication() Line 55 C++
if so, what I find weird is that you create the rigid body but you never add any child shape,
therefore when you set the mass of the body, the game crash because it never that a compound will have a zero inertia, whi si what the shape would be if does no have children
to take care fo that I add a check that is the collision shape does not has inertia value
the is set the mass to infinity, I added this check
- Code: Select all
void dgBody::SetMassMatrix(dgFloat32 mass, const dgMatrix& inertia)
{
dgFloat32 Ixx = inertia[0][0];
dgFloat32 Iyy = inertia[1][1];
dgFloat32 Izz = inertia[2][2];
mass = dgAbs (mass);
if (m_collision->IsType(dgCollision::dgCollisionMesh_RTTI) || m_collision->IsType(dgCollision::dgCollisionScene_RTTI)) {
mass = DG_INFINITE_MASS * 2.0f;
}
if (m_collision->IsType(dgCollision::dgCollisionCompound_RTTI)) {
const dgCollision* const childShape = m_collision->GetChildShape();
if ((childShape->m_inertia.m_x < dgFloat32 (1.0e-5f)) || (childShape->m_inertia.m_y < dgFloat32 (1.0e-5f)) || (childShape->m_inertia.m_z < dgFloat32 (1.0e-5f))){
mass = DG_INFINITE_MASS * 2.0f;
}
}
I change the assert to a Trace, and the game runs, but I am not sure hwo to see what is in the scene.
I saw the mushroom was suppose to be one of the two compound that I see.
Is there suppose to be a compound with no children shapes?