void RigidBody::create(const Matrix44& pose, SimpleShape* shape, Real mass, Scene* scene) { if (mActor != 0) { NxOgre_ThrowError("RigidBody tried to create an actor that was already created."); return; } if (shape == 0) { NxOgre_ThrowError("RigidBody tried to create an actor that has no shape."); return; } if (scene == 0) { NxOgre_ThrowError("RigidBody tried to create an actor that has no scene."); return; } NxActorDesc actor_description; NxBodyDesc body_description; actor_description.globalPose.setRowMajor44(pose.ptr()); Functions::SimpleShapeToActorDescription(actor_description, shape); if (mass) { body_description.mass = mass; actor_description.body = &body_description; } mActor = scene->getScene()->createActor(actor_description); if (mActor == 0) { NxOgre_ThrowError("RigidBody actor was not created."); return; } for (unsigned int i=0; i < actor_description.shapes.size(); i++) { NxShapeDesc* desc = actor_description.shapes[i]; delete desc; } mActor->userData = (void*) NxOgre_New(PhysXPointer)(this, getClassType()); }