mcaden
22-08-2008 04:55:34
11:31:54: OGRE EXCEPTION(5:ItemIdentityException): SceneNode 'Crate' not found. in SceneManager::getSceneNode at c:\ogre\ogremain\src\ogrescenemanager.cpp (line 784)
I'm working on a dotSceneLoader for my game project and I'm having it automatically create NxOgre actors based on userData exported from blender (I plan on posted code when it's complete).
My problem is that I can access the scene nodes, I can see the sceneNodes if I run debug and look at the variables, but NxOgre can't find the sceneNode.
Here's my function for generic objects that need physics enabled.
The only thing I can think of is that I've subclassed SceneNode as follows:
But unless I'm forgetting something about pointers my DotSceneNode should still be treated like a SceneNode by any pointer there as an 'is a' relationship.
Any ideas?
Sidenote: Any suggestions on improvements?
I'm working on a dotSceneLoader for my game project and I'm having it automatically create NxOgre actors based on userData exported from blender (I plan on posted code when it's complete).
My problem is that I can access the scene nodes, I can see the sceneNodes if I run debug and look at the variables, but NxOgre can't find the sceneNode.
Here's my function for generic objects that need physics enabled.
case( DS_NXOBTYPE_GENERIC_KINEMATIC ):
case( DS_NXOBTYPE_GENERIC_STATIC ):
LogManager::getSingleton().logMessage( "Found Generic, Kinematic Object..." );
NodeRenderableParams vp;
vp.setToDefault();
vp.mGraphicsModel = node->getMeshName();
vp.mGraphicsModelScale = NxVec3(1, 1, 1);
vp.mIdentifier = node->getName();
vp.mIdentifierUsage = vp.IU_Use;
vp.mMode = RenderableSource::RM_Interpolate;
NxOgre::Pose actorPose( 0,0,0 );
Shape* colMesh = NULL;
if( node->getColType() == node->TRIANGLE || node->getColType() == node->CONVEX )
{
Ogre::String collisionMesh;
collisionMesh = node->getMeshName() + ".nxs";
NxOgre::Resources::ResourceSystem::getSingleton()->addMesh("file://" + collisionMesh);
if( node->getColType() == node->TRIANGLE )
colMesh = new TriangleMesh(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh( collisionMesh ));
else
colMesh = new Convex( NxOgre::Resources::ResourceSystem::getSingleton()->getMesh( collisionMesh ) );
}
else if( node->getColType() == node->CUBE )
{
Ogre::AxisAlignedBox charBounds = node->getAttachedObject( node->entName )->getBoundingBox();
colMesh = new Cube( charBounds.getSize() );
}
else if( node->getColType() == node->SPHERE )
{
colMesh = new NxOgre::Sphere( node->getColSize() );
}
if( colMesh != NULL )
{
try
{
if( node->getObjectType() == DS_NXOBTYPE_GENERIC_KINEMATIC )
mScene->createBody(vp.mIdentifier, colMesh, actorPose, vp, "mass: 10");
else
mScene->createBody(vp.mIdentifier, colMesh, actorPose, vp, "static: yes");
}
catch(...)
{
LogManager::getSingleton().logMessage( "-= Generic_Kinematic Object Error - Not applying physics to this object =-" );
}
}
The only thing I can think of is that I've subclassed SceneNode as follows:
class DotSceneNode : public SceneNode
{
public:
enum collisionTypes{ CUBE, SPHERE, TRIANGLE, CONVEX};
DotSceneNode( SceneManager* sceneMgr, String name );
~DotSceneNode();
//...Various other functions and variables
}
DotSceneNode::DotSceneNode( SceneManager* sceneMgr, String name ) : Ogre::SceneNode(sceneMgr, name)
{
}
But unless I'm forgetting something about pointers my DotSceneNode should still be treated like a SceneNode by any pointer there as an 'is a' relationship.
Any ideas?
Sidenote: Any suggestions on improvements?