VileMK3
11-11-2009 18:35:20
Hey everyone,
I have encountered a small problem. In the game me and my team are developping for school we have two kinds of items that need to be manipulated in game, those added and dropped from yoru inventory and those directly used (levers or small objects that are knocked away).
Our game is physics heavy so I decided to try the following approach to see if an item is an item to be "manipulated" or to be "picked up":
This is basically a test code, so I just make an OGRE3DBody object as normal, naturally I get an access violation when trying to set the itemtype after casting it. (Item inherits from OGRE3DBody)
This is probably not the best way to try and do this so my question is:
How do I fix the problem with my code and is there some way to include masks into Ogre3DBody (or does it already have them) or is there some other way to get some information from an OGRE3DBody?
(Like userData in DirectX)
Thanks in advance ^^
I have encountered a small problem. In the game me and my team are developping for school we have two kinds of items that need to be manipulated in game, those added and dropped from yoru inventory and those directly used (levers or small objects that are knocked away).
Our game is physics heavy so I decided to try the following approach to see if an item is an item to be "manipulated" or to be "picked up":
NxOgre::ResourceSystem::getSingleton()->openArchive("Nxs", "file:C:/Data/DAE/Misc/Ogre_Projects/Fascinated/Fascinated/res/Nxs");
NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("Nxs:EluminusCol.nxs");
NxOgre::Convex* convex = new NxOgre::Convex(convexMesh);
OGRE3DBody* convexBody = m_RenderSystem->createBody(convex, NxOgre::Vec3(200, 450, 100), "Eluminus.mesh");
convexBody->setGlobalOrientation(NxOgre::Matrix33(NxOgre::Real4(0, 45, 0, 45)));
ManipItem* item = static_cast<ManipItem*>(convexBody);
item->SetItemType("ManipItem");
item = static_cast<ManipItem*>(convexBody);
Ogre::String type = item->GetItemType();
This is basically a test code, so I just make an OGRE3DBody object as normal, naturally I get an access violation when trying to set the itemtype after casting it. (Item inherits from OGRE3DBody)
This is probably not the best way to try and do this so my question is:
How do I fix the problem with my code and is there some way to include masks into Ogre3DBody (or does it already have them) or is there some other way to get some information from an OGRE3DBody?
(Like userData in DirectX)
Thanks in advance ^^