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?
getIndices returns null??
well it's been a while since i last used irrlicht but I'll try anyway.
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.
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
//! Returns pointer to the mesh
virtual IMesh* getMesh() = 0;
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;
Code: Select all
SMeshBufferLightMaps mybuf;
theTerrain->getMeshBufferForLOD(mybuf,0);