convex to shapes??

carlosmorcerf

06-10-2009 18:15:01

I am creating a class to work with the models and decided to create a bridge between the creation of OGRE3DBody but I'm with this error.


seModel* model = new seModel("teste",mSceneMgr,entity,mRenderSystem,convex,description);

error:

cannot convert parameter 5 from 'NxOgre::Convex *' to 'NxOgre::Shapes'



the class constructor is:


seModel::seModel(
Ogre::String name,
SceneManager* sceneMgr,
Entity* ent,
OGRE3DRenderSystem* mRenderSystem,
NxOgre::Shapes shapes,
const NxOgre::RigidBodyDescription& description)



excuse the Google translator. lol

spacegaier

06-10-2009 18:18:17

Where is the error/problem? I can't see any. We need more information and the code snippet that is actually causing the error (and not just the constructor).

carlosmorcerf

06-10-2009 18:26:31

seModel.h


#ifndef seModel_H
#define seModel_H

#include <Ogre.h>
#include <NxOgre.h>
#include <NxOgreOGRE3D.h>

using namespace Ogre;

class seModel {

public:
SceneNode* mNode;
Entity* mEntity;
SceneManager* mSceneMgr;
OGRE3DBody* mNxBody;

seModel(Ogre::String,
SceneManager*,
Entity*,
OGRE3DRenderSystem*,
NxOgre::Shapes,
const NxOgre::RigidBodyDescription& description);
seModel(Ogre::String,
SceneManager*,
Entity*,
OGRE3DRenderSystem*,
NxOgre::Shape*,
const NxOgre::RigidBodyDescription& description);
virtual ~seModel();
bool advance(float, const NxOgre::Enums::Priority&);
Ogre::String Name;

protected:
void basicInit(Ogre::String,SceneManager*,Entity*);

private:

};

#endif




seMode.cpp


#include "seModel.h"

seModel::seModel(
Ogre::String name,
SceneManager* sceneMgr,
Entity* ent,
OGRE3DRenderSystem* mRenderSystem,
NxOgre::Shapes shapes,
const NxOgre::RigidBodyDescription& description)
{
basicInit(name,sceneMgr,ent);
mNxBody = mRenderSystem->createBody(shapes,mNode->getPosition(),mNode,description);
}
seModel::seModel(
Ogre::String name,
SceneManager* sceneMgr,
Entity* ent,
OGRE3DRenderSystem* mRenderSystem,
NxOgre::Shape* shape,
const NxOgre::RigidBodyDescription& description)

{
basicInit(name,sceneMgr,ent);
mNxBody = mRenderSystem->createBody(shape,mNode->getPosition(),mNode,description);

}

void seModel::basicInit(Ogre::String name,SceneManager* sceneMgr,Entity* ent) {
this->Name = name;
mEntity = ent;
mSceneMgr = sceneMgr;
mNode = mEntity->getParentSceneNode();
}

seModel::~seModel() {

}





and this code to create a seModel:



NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("media:Barrel.nxs");
NxOgre::Convex* convex = new NxOgre::Convex(convexMesh);

NxOgre::RigidBodyDescription* description = new NxOgre::RigidBodyDescription();

seModel* model = new seModel("teste",mSceneMgr,entity,mRenderSystem,convex,description);

spacegaier

06-10-2009 18:30:46

And yet: Where is the problem? Is there a runtime error and if yes, in which line?

You can't expect us to do all the work. We will happilly help you if you provide us with all the necessary information...

carlosmorcerf

06-10-2009 18:33:52

this a error:

'seModel::seModel(Ogre::String,Ogre::SceneManager *,Ogre::Entity *,OGRE3DRenderSystem *,NxOgre::Shapes,const NxOgre::RigidBodyDescription &)' : cannot convert parameter 5 from 'NxOgre::Convex *' to 'NxOgre::Shapes'

in this line:

// cria o seModel
seModel* model = new seModel("teste",mSceneMgr,entity,mRenderSystem,convex,description);


Edit...
My goal is to create a scene manager nxogre integrating with ogremax using the userdata of each entity. and I'm trying to put each entity in a class called seModel and so will the manufacturer if it creates the OGRE3DBody for seModel if necessary. 'm new with C + + but slowly I learn. may be some silly mistake so I came here. (google tradutor)

betajaen

06-10-2009 18:46:13

"Shapes" is a typedef of Array<Shape*>, you can't cast it into that.

You need to have two functions. One that does "Shape*" and one that does "Shapes", like how Scene and OGRE3DRenderSystem does.

carlosmorcerf

06-10-2009 19:10:06

I have 2 constructors as shown in the code just above. I'm not thinking to put the definition of shapes.

I think I'll change the constructor already sending ogre3dbody ready so I create the seModel upon data obre3dbody. thus can create constructors for cloth .. etc. .. no doubt be back here. thanks.