getIndices returns null??

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Felipe
Posts: 25
Joined: Thu Jun 10, 2004 9:13 pm
Location: Rio de Janeiro

getIndices returns null??

Post by Felipe »

I searched around the forums for 3 days or so, and couldn't find anything
on this:
When I try to use ITerrainSceneNode->getMesh()->getMeshBuffer()->getIndices() it will
invariably return 0.
Yet I can see the node therefore it is supposed to have indices, right?
This is also happening with IAnimatedSceneNodes so I can't get Neuton/ODE/Tokamak/ColDet to work with anything other than a BSP map.
Am I doing something horribly silly and not seeing it?
_zola

Post by _zola »

well it's been a while since i last used irrlicht but I'll try anyway.

Code: Select all


//! Returns pointer to the mesh
virtual IMesh* getMesh() = 0;
As far as i can see from the implementation in CTerrainSceneNode the Mesh you can get with 'getMesh' only contains the vertecis as provided by the heightmap.

Code: Select all

//! Gets the meshbuffer data based on a specified level of detail.
//! \param mb: A reference to an SMeshBuffer object
//! \param LOD: the level of detail you want the indices from.
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD) = 0;
This method fills the given meshbuffer with the mesh (vertecis and indices) for a given level of detail. Try the following in your code and you should get the mesh for the terrain.

Code: Select all

SMeshBufferLightMaps mybuf;
theTerrain->getMeshBufferForLOD(mybuf,0);
Felipe
Posts: 25
Joined: Thu Jun 10, 2004 9:13 pm
Location: Rio de Janeiro

Post by Felipe »

ok, that makes sense... But shouldn't it work with an animated scene node?
I've been doing this with a triangle selector as a walk-around. Looks like it's working fine so far.
Post Reply