setting up my array of "objects"

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Podunk
Posts: 8
Joined: Sat Oct 08, 2005 12:42 am

setting up my array of "objects"

Post 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?
I R noob.
Please don't harp on me for asking noobie questions in the noob forum :P
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post 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.
Podunk
Posts: 8
Joined: Sat Oct 08, 2005 12:42 am

Post 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);
?
I R noob.
Please don't harp on me for asking noobie questions in the noob forum :P
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post 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
Post Reply