Page 1 of 1

setting up my array of "objects"

Posted: Wed Oct 26, 2005 5:01 pm
by Podunk
I've been experimenting with Irrlicht for a while now, and am finally putting a prototype of a "3d world" much like a MMORPG 3d world.

At any given time there will be a number of "objects" as I call them in the world.

each object has a 3d model with a built in skin texture.

each object is able to be manipulated in a way so that it can be moved, rotated, etc, in other words animated.




Each object has a IMesh or IAnimatedMesh, now this is the part Im not sure about, and I've searched my heart out on these forums and could not find the answers I'm looking for.

1. are "IAnimatedMesh" meshes only of the type of file that contains animation data?

2. Can i animate regular "IMesh"es? I'm assuming "IMesh"es are usually derived from a mesh file that doesn't contain animation data.

3. Why can't I set up a triangle selector for regular "IMesh"es?

Posted: Wed Oct 26, 2005 6:32 pm
by pfo
1) I'm pretty sure IAnimatedMesh is just IMesh with animated data, if you have no animation, use IMesh (it's a little faster and smaller in memory) otherwise use IAnimatedMesh

2) What do you mean by animate? You can rotate, translate and scale them to achieve animation, but I don't think there's a way to move vertices or bones to achieve animation at run time. You could modify the engine to make this possible however. Someone (Acki I believe) coded a modification that lets you manipulate the bones of .x files at runtime.

3) You should be able to setup a triangle selector on an IMesh, in fact createTriangleSelector takes an IMesh as its parameter, so I don't see what the problem is.

Posted: Wed Oct 26, 2005 8:34 pm
by Podunk
thanks for the reply :)
pfo wrote:3) You should be able to setup a triangle selector on an IMesh, in fact createTriangleSelector takes an IMesh as its parameter, so I don't see what the problem is.
I meant to say why cant i set up a triangleSelector on an IAnimatedMesh.

Code: Select all

triangleSelector = smgr->createTriangleSelector(animatedMesh,worldObjectNode);

Code: Select all

c:\Documents and Settings\Owner\Desktop\game development\LampStand\WorldObject.cpp(50): error C2664: 'irr::scene::ISceneManager::createTriangleSelector' : cannot convert parameter 1 from 'irr::scene::IAnimatedMesh *' to 'irr::scene::IMesh *'
how should I set a triangle selector on an animated mesh

edit:

should i be doing:

Code: Select all

triangleSelector = smgr->createTriangleSelectorFromBoundingBox(worldObjectNode);
?

Posted: Wed Oct 26, 2005 9:29 pm
by omaremad
this is how i do it

i create an object class

in it i create a triangle selector(it can be a octree for accuracy or from BB for speed) from the mesh then i add it to the meta triangle selctor common to all nodes


CObject*objects[100];//adds 100 objects
objects[50]->node.setPosition(core::vector3df);//moves object 50