valvalval
30-03-2008 10:34:36
I do not use createBody()
because, I have to name created scenenode with its own name.
so, I used this code below.
// first, create entity.
m_pEntity = GetGameWorld()->GetSceneMgr()->createEntity(String(temp_name) + "Robot", "robot.mesh");
// create scenenode
m_pSceneNode = GetGameWorld()->GetSceneMgr()->getRootSceneNode()->createChildSceneNode(String(temp_name) + "EnemyRobot" , this->Pos(), this->Orientation());
// make a body using new Body()
m_pBody = new Body(String(temp_name) + "EnemyRobot", this->GetGameWorld()->GetScene());
// cretaed Entity and SceneNode to be attached.
m_pBody->setEntity(m_pEntity);
m_pBody->setNode(m_pSceneNode);
// Last, I need to a shape? this is problem..
// there is a method for create shape?
m_pBody->addShape(new CubeShape(1));
Important thing is that, I don't have to use createBody().
because, SceneNode Name is used in stl::map.
if there is a collision between Entities, I'm going to get a name of them.
what am I supposed to do? create body manually.
because, I have to name created scenenode with its own name.
so, I used this code below.
// first, create entity.
m_pEntity = GetGameWorld()->GetSceneMgr()->createEntity(String(temp_name) + "Robot", "robot.mesh");
// create scenenode
m_pSceneNode = GetGameWorld()->GetSceneMgr()->getRootSceneNode()->createChildSceneNode(String(temp_name) + "EnemyRobot" , this->Pos(), this->Orientation());
// make a body using new Body()
m_pBody = new Body(String(temp_name) + "EnemyRobot", this->GetGameWorld()->GetScene());
// cretaed Entity and SceneNode to be attached.
m_pBody->setEntity(m_pEntity);
m_pBody->setNode(m_pSceneNode);
// Last, I need to a shape? this is problem..
// there is a method for create shape?
m_pBody->addShape(new CubeShape(1));
Important thing is that, I don't have to use createBody().
because, SceneNode Name is used in stl::map.
if there is a collision between Entities, I'm going to get a name of them.
what am I supposed to do? create body manually.