Converting a node back into a mesh?
Converting a node back into a mesh?
If i have a scene node, how do i reference its original mesh data? (Without heeping the original mesh handle from when it was loaded/created)
C++/Irrlicht Noob pl3se B p4t1ent.
Visit www.d-grafix.com
Visit www.d-grafix.com
It doesnt work, it says iscenenode has no member named getMesh()
C++/Irrlicht Noob pl3se B p4t1ent.
Visit www.d-grafix.com
Visit www.d-grafix.com
-
- Posts: 362
- Joined: Sun Dec 16, 2007 9:25 pm
I think it's
node->getmesh(0)
or the number of your mesh
node->getmesh(0)
or the number of your mesh
Post this userbar I made on other websites to show your support for Irrlicht!
http://img147.imageshack.us/img147/1261 ... wernq4.png
http://img147.imageshack.us/img147/1261 ... wernq4.png
-
- Competition winner
- Posts: 189
- Joined: Tue Oct 16, 2007 3:53 am
- Location: Indonesia
- Contact:
and some handler
Code: Select all
if(node->getType( )==ESNT_MESH ){
//get mesh here
//remember iAnimatedMeshSceneNode and IMeshSceneNode are different
}
-
- Competition winner
- Posts: 189
- Joined: Tue Oct 16, 2007 3:53 am
- Location: Indonesia
- Contact:
i assume u need the static mesh, if u need the animated mesh use only the second case.
just obtain the pointer, copy it to your mesh node, obtain the pointer to the mesh
if this is not what u need, may be u need to get meshes via mesh cache?
Code: Select all
IMesh* mesh;
switch(node->getType( ){
case (ESNT_MESH ):
IMeshSceneNode* meshNode=0;
meshNode = node;
mesh = meshNode->getMesh()
break;
case (ESNT_ANIMATED_MESH ):
IAnimatedMeshSceneNode* aniMeshNode=0;
aniMeshNode = node;
mesh = aniMeshNode->getMesh()->getMesh(0);//which one u will take
break;
}
if this is not what u need, may be u need to get meshes via mesh cache?
No =P, it converts the returned value of getMesh() and not the node of which you call with to getMesh().huydotnet wrote:yes, it mean converting ISceneNode to IAnimatedSceneNode first, then we can get mesh
In other words you don't cast the node object.. or correct me if I'm wrong but I'm pretty sure I'm right
ah, yes, i understand
now, the code is:
is this right?
now, the code is:
Code: Select all
IAnimatedMeshSceneNode* convertedNode;
convertedNode = (IAnimatedMeshSceneNode*)node;
IAnimatedMesh* mesh;
mesh = convertedNode->getMesh();
or simply this:
Code: Select all
IAnimatedMesh* mesh = ((IAnimatedMeshSceneNode*)node)->getMesh();
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java