1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __C_META_TRIANGLE_SELECTOR_H_INCLUDED__
\r
6 #define __C_META_TRIANGLE_SELECTOR_H_INCLUDED__
\r
8 #include "IMetaTriangleSelector.h"
\r
9 #include "irrArray.h"
\r
16 //! Interface for making multiple triangle selectors work as one big selector.
\r
17 class CMetaTriangleSelector : public IMetaTriangleSelector
\r
22 CMetaTriangleSelector();
\r
25 virtual ~CMetaTriangleSelector();
\r
27 //! Get amount of all available triangles in this selector
\r
28 virtual s32 getTriangleCount() const _IRR_OVERRIDE_;
\r
30 //! Gets all triangles.
\r
31 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
\r
32 s32& outTriangleCount, const core::matrix4* transform, bool useNodeTransform,
\r
33 irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_;
\r
35 //! Gets all triangles which lie within a specific bounding box.
\r
36 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
\r
37 s32& outTriangleCount, const core::aabbox3d<f32>& box,
\r
38 const core::matrix4* transform, bool useNodeTransform,
\r
39 irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_;
\r
41 //! Gets all triangles which have or may have contact with a 3d line.
\r
42 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
\r
43 s32& outTriangleCount, const core::line3d<f32>& line,
\r
44 const core::matrix4* transform, bool useNodeTransform,
\r
45 irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_;
\r
47 //! Adds a triangle selector to the collection of triangle selectors
\r
48 //! in this metaTriangleSelector.
\r
49 virtual void addTriangleSelector(ITriangleSelector* toAdd) _IRR_OVERRIDE_;
\r
51 //! Removes a specific triangle selector which was added before from the collection.
\r
52 virtual bool removeTriangleSelector(ITriangleSelector* toRemove) _IRR_OVERRIDE_;
\r
54 //! Removes all triangle selectors from the collection.
\r
55 virtual void removeAllTriangleSelectors() _IRR_OVERRIDE_;
\r
57 //! Get the scene node associated with a given triangle.
\r
58 virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const _IRR_OVERRIDE_;
\r
60 // Get the number of TriangleSelectors that are part of this one
\r
61 virtual u32 getSelectorCount() const _IRR_OVERRIDE_;
\r
63 // Get the TriangleSelector based on index based on getSelectorCount
\r
64 virtual ITriangleSelector* getSelector(u32 index) _IRR_OVERRIDE_;
\r
66 // Get the TriangleSelector based on index based on getSelectorCount
\r
67 virtual const ITriangleSelector* getSelector(u32 index) const _IRR_OVERRIDE_;
\r
71 core::array<ITriangleSelector*> TriangleSelectors;
\r
74 } // end namespace scene
\r
75 } // end namespace irr
\r