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.
JustMax
Posts: 7 Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany
Post
by JustMax » Wed Jan 30, 2008 7:23 am
Hi
I have a problem with the Triangle Selectors. Every time I try to create one its simply empty. Have I misunderstood or forget something?
Code: Select all
IAnimatedMesh* mesh = drivers->smgr->getMesh("models/fighter/fighter.3DS");
IAnimatedMeshSceneNode* node = drivers->smgr->addAnimatedMeshSceneNode( mesh , 0, id);
ITriangleSelector* s = drivers->smgr->createTriangleSelector(mesh, node);
node->setTriangleSelector(s);
#ifdef FULLDEBUGINFO
GameLog("%i %i",drivers->smgr->getMeshManipulator()->getPolyCount(mesh),
s->getTriangleCount()); //output:"468 0"
#endif
allUnitTriangeles->addTriangleSelector(s);
s->drop();
This should be all the relevant source code.
if(Hell.isFrozen())
{
...
rogerborg
Admin
Posts: 3590 Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:
Post
by rogerborg » Wed Jan 30, 2008 10:22 am
Instead of this:
Code: Select all
ITriangleSelector* s = drivers->smgr->createTriangleSelector(mesh, node);
I'd suggest getting an explicit IMesh* from your IAnimatedMesh* like this:
Code: Select all
ITriangleSelector* s = drivers->smgr->createTriangleSelector(mesh->getMesh(0), node);
JustMax
Posts: 7 Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany
Post
by JustMax » Wed Jan 30, 2008 3:10 pm
big thanks
it works now.
if(Hell.isFrozen())
{
...
rogerborg
Admin
Posts: 3590 Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:
Post
by rogerborg » Wed Jan 30, 2008 11:44 pm
n/p. IAnimatedMesh has been changed to be derived from IMesh. It wasn't always that way, and the behaviour when you pass an IAnimatedMesh* as an IMesh* isn't what you might expect. This is catching a lot of people out.