Lexx
27-03-2007 14:53:08
Hi all.
Is there some way - how to create a nxOgre-body with existing SceneNode and Entity?
i found parameter _params.mNode in constructor of nxOgre_body, but i can't find anything about preloaded Entity...
currently, i'm change some part of nxOgre_body.cpp:
ln 149
but, it's bad way, i think... So, any solution for me?
Is there some way - how to create a nxOgre-body with existing SceneNode and Entity?
i found parameter _params.mNode in constructor of nxOgre_body, but i can't find anything about preloaded Entity...
currently, i'm change some part of nxOgre_body.cpp:
ln 149
NXD("a");
if (_meshName != "") {
[b]if( owner->mSceneMgr->hasEntity(mName) )
mEntity = owner->mSceneMgr->getEntity(mName);
else[/b]
mEntity = owner->mSceneMgr->createEntity(mName + ".entity", _meshName);
if (_params.mShadows)
mEntity->setCastShadows(true);
if (_params.mOrientation != Ogre::Quaternion(1,0,0,0) || _params.mOffset != Ogre::Vector3(0,0,0)) {
Ogre::SceneNode *subNode = mNode->createChildSceneNode(_params.mOffset,_params.mOrientation);
subNode->attachObject(mEntity);
}
else
mNode->attachObject(mEntity);
}
else {
mEntity = 0;
}
NXD("b");
but, it's bad way, i think... So, any solution for me?