Isle
Loading...
Searching...
No Matches
roi.h
Go to the documentation of this file.
1#ifndef ROI_H
2#define ROI_H
3
4// ROI stands for Real-time Object Instance.
5
6#include "compat.h"
7#include "decomp.h"
8#include "lodlist.h"
10#include "mxstl/stlcompat.h"
11
12/*
13 * A simple bounding box object with Min and Max accessor methods.
14 */
15// SIZE 0x28
21public:
26 const Vector3& Min() const { return min; }
31 Vector3& Min() { return min; }
36 const Vector3& Max() const { return max; }
41 Vector3& Max() { return max; }
42
43private:
44 Mx3DPointFloat min;
45 Mx3DPointFloat max;
46};
47
48/*
49 * A simple bounding sphere object with center and radius accessor methods.
50 */
51// SIZE 0x18
57public:
62 const Vector3& Center() const { return center; }
67 Vector3& Center() { return center; }
72 const float& Radius() const { return radius; }
77 float& Radius() { return radius; }
78
79 // SYNTHETIC: BETA10 0x1001fb90
80 // BoundingSphere::operator=
81
82private:
83 Mx3DPointFloat center;
84 float radius;
85};
86
87/*
88 * Abstract base class representing a single LOD version of
89 * a geometric object.
90 */
91// VTABLE: LEGO1 0x100dbd90
92// SIZE 0x04
97class LODObject {
98public:
99 // LODObject();
100
101 // FUNCTION: LEGO1 0x100a6f00
102 virtual ~LODObject() {}
103
107 virtual double AveragePolyArea() const = 0; // vtable+0x04
111 virtual int NVerts() const = 0; // vtable+0x08
115 virtual int NumPolys() const = 0; // vtable+0x0c
119 virtual float VTable0x10() = 0; // vtable+0x10
120
121 // SYNTHETIC: LEGO1 0x100a6f10
122 // LODObject::`scalar deleting destructor'
123};
124
125/*
126 * A CompoundObject is simply a set of ROI objects which
127 * all together represent a single object with sub-parts.
128 */
133class ROI;
134// typedef std::set<ROI*, std::less<const ROI*> > CompoundObject;
135typedef list<ROI*> CompoundObject;
136
137/*
138 * A ROIList is a list of ROI objects.
139 */
144typedef vector<const ROI*> ROIList;
145
146/*
147 * A simple list of integers.
148 * Returned by RealtimeView::SelectLODs as indices into an ROIList.
149 */
154typedef vector<int> IntList;
155
156// VTABLE: LEGO1 0x100dbc38
157// SIZE 0x10
162class ROI {
163public:
168 {
169 comp = 0;
170 lods = 0;
171 m_visible = true;
172 }
176 virtual ~ROI()
177 {
178 // if derived class set the comp and lods, it should delete them
179 assert(!comp);
180 assert(!lods);
181 }
185 virtual float IntrinsicImportance() const = 0; // vtable+0x04
190 virtual const float* GetWorldVelocity() const = 0; // vtable+0x08
194 virtual const BoundingBox& GetWorldBoundingBox() const = 0; // vtable+0x0c
198 virtual const BoundingSphere& GetWorldBoundingSphere() const = 0; // vtable+0x10
199
203 const LODListBase* GetLODs() const { return lods; }
208 const LODObject* GetLOD(int i) const
209 {
210 assert(lods);
211 return (*lods)[i];
212 }
216 int GetLODCount() const { return lods ? lods->Size() : 0; }
217
221 // FUNCTION: BETA10 0x10027110
222 const CompoundObject* GetComp() const { return comp; }
223
227 // FUNCTION: BETA10 0x10049e10
228 unsigned char GetVisibility() { return m_visible; }
229
234 // FUNCTION: BETA10 0x10011720
235 void SetVisibility(unsigned char p_visible) { m_visible = p_visible; }
236
237 // SYNTHETIC: LEGO1 0x100a5d60
238 // ROI::`scalar deleting destructor'
239
240protected:
243 unsigned char m_visible;
244};
245
246// TEMPLATE: LEGO1 0x10084930
247// list<ROI *,allocator<ROI *> >::~list<ROI *,allocator<ROI *> >
248
249// SYNTHETIC: LEGO1 0x100a5d50
250// ROI::~ROI
251
252#endif // ROI_H
[AI] Represents an axis-aligned bounding box in 3D space, using minimum and maximum points.
Definition: roi.h:20
const Vector3 & Min() const
[AI] Const accessor for the minimum corner of the bounding box.
Definition: roi.h:26
const Vector3 & Max() const
[AI] Const accessor for the maximum corner of the bounding box.
Definition: roi.h:36
Vector3 & Min()
[AI] Non-const accessor for the minimum corner of the bounding box.
Definition: roi.h:31
Vector3 & Max()
[AI] Non-const accessor for the maximum corner of the bounding box.
Definition: roi.h:41
[AI] Represents a bounding sphere in 3D space with center and radius.
Definition: roi.h:56
float & Radius()
[AI] Non-const accessor for the sphere radius.
Definition: roi.h:77
const float & Radius() const
[AI] Const accessor for the sphere radius.
Definition: roi.h:72
Vector3 & Center()
[AI] Non-const accessor for the center of the sphere.
Definition: roi.h:67
const Vector3 & Center() const
[AI] Const accessor for the center of the sphere.
Definition: roi.h:62
[AI] Abstract base class for an ordered list of LODObject pointers, where each entry represents an in...
Definition: lodlist.h:31
size_t Size() const
[AI] Returns the current number of LODObject pointers contained.
Definition: lodlist.h:165
[AI] Abstract base class for a Level-of-Detail (LOD) variant of a geometric object.
Definition: roi.h:97
virtual double AveragePolyArea() const =0
[AI] Returns the average polygon area for this LOD.
virtual float VTable0x10()=0
[AI] Unknown method related to the LOD.
virtual int NVerts() const =0
[AI] Returns the number of vertices for this LOD.
virtual ~LODObject()
Definition: roi.h:102
virtual int NumPolys() const =0
[AI] Returns the number of polygons for this LOD.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Abstract base class for Real-time Object Instances (ROI) in the world.
Definition: roi.h:162
CompoundObject * comp
[AI] List of sub-ROIs composing this ROI (compound object), or NULL. [AI]
Definition: roi.h:241
unsigned char GetVisibility()
[AI] Returns the visibility flag; true if visible, false if hidden.
Definition: roi.h:228
virtual const BoundingBox & GetWorldBoundingBox() const =0
[AI] Returns the world-space bounding box of the object.
ROI()
[AI] Constructs an empty ROI, initially visible with no LOD or compound object assigned.
Definition: roi.h:167
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
Definition: roi.h:235
const CompoundObject * GetComp() const
[AI] Returns the pointer to the compound object structure, or NULL if not present.
Definition: roi.h:222
virtual const float * GetWorldVelocity() const =0
[AI] Returns the object's world-space velocity as a pointer to float values.
int GetLODCount() const
[AI] Returns the number of available LODs for this ROI.
Definition: roi.h:216
const LODListBase * GetLODs() const
[AI] Returns the LOD list associated with this ROI, or NULL if not set.
Definition: roi.h:203
virtual const BoundingSphere & GetWorldBoundingSphere() const =0
[AI] Returns the world-space bounding sphere of the object.
virtual float IntrinsicImportance() const =0
[AI] Returns the intrinsic importance (used for LOD selection, culling etc).
LODListBase * lods
[AI] Pointer to list of LODObject instances, or NULL if not set. [AI]
Definition: roi.h:242
const LODObject * GetLOD(int i) const
[AI] Returns the LODObject at the specified index.
Definition: roi.h:208
unsigned char m_visible
[AI] Visibility flag: nonzero = visible. [AI]
Definition: roi.h:243
virtual ~ROI()
[AI] Destroys the ROI and asserts that 'comp' and 'lods' are managed/deleted by derived types.
Definition: roi.h:176
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
vector< const ROI * > ROIList
[AI] Typedef for a list of ROI pointers.
Definition: roi.h:144
list< ROI * > CompoundObject
Definition: roi.h:135
vector< int > IntList
[AI] Typedef for a list of integer indices, e.g.
Definition: roi.h:154
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...