Page 1 of 1

addArrowMesh

Posted: Mon Aug 06, 2007 1:11 am
by Dr.Bunshin
Hello everyone!

I have not been around here in a while. Its nice to see some familiar aliases :)

How do you use addArrowMesh? Can someone provide an example?

Posted: Mon Aug 06, 2007 2:18 am
by vitek
Assuming you are using the release version of Irrlicht [v.1.3.1], then you would write

Code: Select all

// this creates a named mesh and adds it to the mesh cache
// if you call addArrowMesh() with the same name, it will give
// you the original arrow instead of creating a new one.
scene::IAnimatedMesh* mesh = smgr->addArrowMesh("red-arrow,
  video::SColor(255,255,0,0),
  video::SColor(255,255,0,0));

// here you create a scene node for the given mesh. this is
// the hook into the scene graph. without this you would need
// to manually draw the arrow mesh.
scene::ISceneNode* node = smgr->addMeshSceneNode(mesh->getMesh(0));
// rotate, scale, translate node to move the arrow around...

Posted: Mon Aug 06, 2007 4:16 am
by Dr.Bunshin
Tanks! It all come together :)

Posted: Mon Aug 06, 2007 8:38 am
by hybrid
No, the change of parameters happend after the 1.3.1 release. The original order was:

Code: Select all

addArrowMesh(const c8* name, u32 tesselationCylinder, u32 tesselationCone, f32 height, f32 cylinderHeight, f32 width0,f32 width1, video::SColor vtxColor0, video::SColor vtxColor1);
Everything without default parameters.