Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
ITriangleSelector.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_TRIANGLE_SELECTOR_HPP_INCLUDED
6#define NIRT_I_TRIANGLE_SELECTOR_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/triangle3d.hpp>
10#include <nirtcpp/core/engine/aabbox3d.hpp>
11#include <nirtcpp/core/engine/matrix4.hpp>
12#include <nirtcpp/core/engine/line3d.hpp>
13#include <nirtcpp/core/engine/irrArray.hpp>
14
15namespace nirt
16{
17namespace scene
18{
19
20class ISceneNode;
21class ITriangleSelector;
22class IMeshBuffer;
23
25
29{
30public:
32 : RangeStart(0), RangeSize(0)
33 , Selector(0), SceneNode(0)
35 {}
36
38
41 bool isIndexInRange(nirt::u32 triangleIndex) const
42 {
43 return triangleIndex >= RangeStart && triangleIndex < RangeStart+RangeSize;
44 }
45
48
51
54
57
61
64};
65
67
74{
75public:
76
78 virtual s32 getTriangleCount() const = 0;
79
81
101 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
102 s32& outTriangleCount, const core::matrix4* transform=0,
103 bool useNodeTransform=true,
104 nirt::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
105
107
131 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
132 s32& outTriangleCount, const core::aabbox3d<f32>& box,
133 const core::matrix4* transform=0, bool useNodeTransform=true,
134 nirt::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
135
137
161 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
162 s32& outTriangleCount, const core::line3d<f32>& line,
163 const core::matrix4* transform=0, bool useNodeTransform=true,
164 nirt::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
165
167
169 virtual u32 getSelectorCount() const = 0;
170
172
174 virtual ITriangleSelector* getSelector(u32 index) = 0;
175
177
179 virtual const ITriangleSelector* getSelector(u32 index) const = 0;
180
182
190 virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const = 0;
191};
192
193} // end namespace scene
194} // end namespace nirt
195
196#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Struct for holding a mesh with a single material.
Definition IMeshBuffer.hpp:41
Scene node interface.
Definition ISceneNode.hpp:43
Interface to return triangles with specific properties.
Definition ITriangleSelector.hpp:74
virtual void getTriangles(core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::line3d< f32 > &line, const core::matrix4 *transform=0, bool useNodeTransform=true, nirt::core::array< SCollisionTriangleRange > *outTriangleInfo=0) const =0
Gets the triangles for one associated node which have or may have contact with a 3d line.
virtual ITriangleSelector * getSelector(u32 index)=0
Get TriangleSelector based on index based on getSelectorCount.
virtual ISceneNode * getSceneNodeForTriangle(u32 triangleIndex) const =0
Get scene node associated with a given triangle.
virtual void getTriangles(core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::matrix4 *transform=0, bool useNodeTransform=true, nirt::core::array< SCollisionTriangleRange > *outTriangleInfo=0) const =0
Gets the triangles for one associated node.
virtual const ITriangleSelector * getSelector(u32 index) const =0
Get TriangleSelector based on index based on getSelectorCount.
virtual void getTriangles(core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::aabbox3d< f32 > &box, const core::matrix4 *transform=0, bool useNodeTransform=true, nirt::core::array< SCollisionTriangleRange > *outTriangleInfo=0) const =0
Gets the triangles for one associated node which may lie within a specific bounding box.
virtual s32 getTriangleCount() const =0
Get amount of all available triangles in this selector.
virtual u32 getSelectorCount() const =0
Get number of TriangleSelectors that are part of this one.
Additional information about the triangle arrays returned by ITriangleSelector::getTriangles.
Definition ITriangleSelector.hpp:29
const IMeshBuffer * MeshBuffer
Definition ITriangleSelector.hpp:60
ISceneNode * SceneNode
SceneNode from which the triangles are from.
Definition ITriangleSelector.hpp:56
nirt::u32 MaterialIndex
Index of selected material in the SceneNode. Usually only valid when MeshBuffer is also set,...
Definition ITriangleSelector.hpp:63
bool isIndexInRange(nirt::u32 triangleIndex) const
Check if this triangle index inside the range.
Definition ITriangleSelector.hpp:41
nirt::u32 RangeSize
Number of elements in the returned triangle array for which this struct is valid (starting with Range...
Definition ITriangleSelector.hpp:50
nirt::u32 RangeStart
First index in the returned triangle array for which this struct is valid.
Definition ITriangleSelector.hpp:47
const ITriangleSelector * Selector
Real selector which contained those triangles (useful when working with MetaTriangleSelector)
Definition ITriangleSelector.hpp:53
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print