mName = description.mName crash

Fobaz

23-07-2010 16:13:17

Hello,
I have this code for creating a cube:
Critter::BodyDescription bodyDescription;
bodyDescription.mMass = 40.0f;

Body* mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,50,0), "cube.1m.mesh", bodyDescription);


and it crashes at
CritterBody.cpp
Body::Body(const NxOgre::ShapeDescription& shape, const NxOgre::Matrix44& pose, const BodyDescription& description, RenderSystem* rendersystem)
: Actor(rendersystem->getScene()), // Take notice of the constructor we are using, it's designed for
// classes that inherit from Actor.
mSceneNodeDestructorBehaviour(description.mSceneNodeDestructorBehaviour),
mRenderPriority(description.mRenderPriority),
mRenderSystem(rendersystem)
{

// Set the name and hash.
mName = description.mName; //<<<<<----- part where it crashes
mNameHash = NxOgre::Strings::hash(mName);

// Create a dynamic RigidBody with the pose, description and shape.
// We can pass on the BodyDescription as a RigidBodyDescription because it inherits from it,
createDynamic(pose, description, shape);

// Obviously NxOgre won't know about the Ogre bits, so this is what the next lines are for:
mSceneManager = rendersystem->getSceneManager();
mNode = description.mNode;

// And let the Scene know we want this renderered. So it will call the advance function when it's
// time to render.
mScene->addRenderListener(this, mRenderPriority);

}


I tried adding
bodyDescription.mName = "box";
but it just crashed at the code i added.

Any help appreciated.