Is this an Bug about Critter::Box

Skywalker

14-12-2010 16:09:02

bool Body::advance(float step, const NxOgre::Enums::Priority&, const NxOgre::Enums::SceneFunction&)
{
mNode->setPosition( getGlobalPosition().as<Ogre::Vector3>() );
mNode->setOrientation( getGlobalOrientationQuat().as<Ogre::Quaternion>() );
return true;
}

Should it check mNode == 0, if I create a Body using Critter::RenderSystem.createBody() method without providing Mesh name(although we won't do this usually), it will not create SceneNode, and when Scene::render() calls Body::advance(), it will crash.

betajaen

14-12-2010 16:29:42

Yes, your right. But checking for a node each frame is a little too defensive IMHO.

I have a better system in place in BuggySwires right now (Critter::Node), which makes sure that there is a SceneNode present, even if there is nothing attached to it.