#ifndef __C_TRIANGLE_SELECTOR_H_INCLUDED__
#define __C_TRIANGLE_SELECTOR_H_INCLUDED__
#include "ITriangleSelector.h"
#include "IMesh.h"
#include "irrArray.h"
namespace irr
{
namespace scene
{
class ISceneNode;
class IAnimatedMeshSceneNode;
class CTriangleSelector : public ITriangleSelector
{
public:
CTriangleSelector(ISceneNode* node);
CTriangleSelector(const IMesh* mesh, ISceneNode* node);
CTriangleSelector(IAnimatedMeshSceneNode* node);
CTriangleSelector(const core::aabbox3d<f32>& box, ISceneNode* node);
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform=0) const;
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const;
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform=0) const;
virtual s32 getTriangleCount() const;
virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const { return SceneNode; }
protected:
virtual void createFromMesh(const IMesh* mesh);
virtual void updateFromMesh(const IMesh* mesh) const;
virtual void update(void) const;
ISceneNode* SceneNode;
mutable core::array<core::triangle3df> Triangles;
IAnimatedMeshSceneNode* AnimatedNode;
mutable s32 LastMeshFrame;
};
}
}
#endif