How to retrieve SceneNode and Entity in this snippet?

Problems building or running the engine, queries about how to use features etc.
Post Reply
lucky7456969
Gremlin
Posts: 156
Joined: Tue Sep 18, 2012 3:43 am

How to retrieve SceneNode and Entity in this snippet?

Post by lucky7456969 »

The commented code is replaced by the dot scene loader, but thereafter there is some uses of
mapNode and mapE variables, how do I retrieve Entity* and SceneNode* from the dot scene loader?
Thanks
Jack

Code: Select all

void OgreApp::createScene(void)
{	 
    /*Ogre::Entity* mapE = mSceneMgr->createEntity("Map", "Warehouse.mesh");
    Ogre::SceneNode* mapNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("MapNode");
    mapNode->attachObject(mapE);*/

    DotSceneLoader* dotSceneLoader = new DotSceneLoader(); 
    dotSceneLoader->parseDotScene("Warehouse.scene", "Essential", mSceneMgr);     
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: How to retrieve SceneNode and Entity in this snippet?

Post by c6burns »

I assume .scene names at least the entities. The scene manager has a getEntity and getSceneNode method to retrieve by name. If only entities are named, you can fetch them and use Entity::getParentSceneNode
lucky7456969
Gremlin
Posts: 156
Joined: Tue Sep 18, 2012 3:43 am

Re: How to retrieve SceneNode and Entity in this snippet?

Post by lucky7456969 »

Actually, just wondering, when is the best time to name the entity? during the creation of the 3d asset? like giving a name to
the object of a 3ds max scene?
Thanks
Jack
Post Reply