2023-11-19 09:38:07 -05:00
|
|
|
#ifndef ROI_H
|
|
|
|
#define ROI_H
|
|
|
|
|
2023-11-19 09:49:36 -05:00
|
|
|
// ROI stands for Real-time Object Instance.
|
2023-11-19 09:38:07 -05:00
|
|
|
|
2023-12-11 16:33:46 -05:00
|
|
|
#include "compat.h"
|
2024-03-10 10:29:16 -04:00
|
|
|
#include "decomp.h"
|
2023-11-19 09:38:07 -05:00
|
|
|
#include "lodlist.h"
|
2024-01-12 19:34:38 -05:00
|
|
|
#include "mxgeometry/mxgeometry3d.h"
|
2024-01-08 04:58:49 -05:00
|
|
|
#include "mxstl/stlcompat.h"
|
2023-11-19 09:38:07 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A simple bounding box object with Min and Max accessor methods.
|
|
|
|
*/
|
2024-01-12 19:34:38 -05:00
|
|
|
// SIZE 0x28
|
2023-11-19 09:38:07 -05:00
|
|
|
class BoundingBox {
|
|
|
|
public:
|
2024-03-01 12:19:41 -05:00
|
|
|
const Vector3& Min() const { return min; }
|
|
|
|
Vector3& Min() { return min; }
|
|
|
|
const Vector3& Max() const { return max; }
|
|
|
|
Vector3& Max() { return max; }
|
2023-11-19 09:38:07 -05:00
|
|
|
|
|
|
|
private:
|
2024-02-17 10:07:34 -05:00
|
|
|
Mx3DPointFloat min; // 0x00
|
|
|
|
Mx3DPointFloat max; // 0x14
|
2023-11-19 09:38:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A simple bounding sphere object with center and radius accessor methods.
|
|
|
|
*/
|
2024-01-12 19:34:38 -05:00
|
|
|
// SIZE 0x18
|
2023-11-19 09:38:07 -05:00
|
|
|
class BoundingSphere {
|
|
|
|
public:
|
2024-03-01 12:19:41 -05:00
|
|
|
const Vector3& Center() const { return center; }
|
|
|
|
Vector3& Center() { return center; }
|
2023-11-19 09:38:07 -05:00
|
|
|
const float& Radius() const { return radius; }
|
|
|
|
float& Radius() { return radius; }
|
|
|
|
|
2024-09-14 19:14:11 -04:00
|
|
|
// SYNTHETIC: BETA10 0x1001fb90
|
|
|
|
// BoundingSphere::operator=
|
|
|
|
|
2023-11-19 09:38:07 -05:00
|
|
|
private:
|
2024-02-17 10:07:34 -05:00
|
|
|
Mx3DPointFloat center; // 0x00
|
|
|
|
float radius; // 0x14
|
2023-11-19 09:38:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Abstract base class representing a single LOD version of
|
|
|
|
* a geometric object.
|
|
|
|
*/
|
2024-03-04 16:57:35 -05:00
|
|
|
// VTABLE: LEGO1 0x100dbd90
|
|
|
|
// SIZE 0x04
|
2023-11-19 09:38:07 -05:00
|
|
|
class LODObject {
|
|
|
|
public:
|
|
|
|
// LODObject();
|
2024-03-04 16:57:35 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100a6f00
|
2023-11-19 09:38:07 -05:00
|
|
|
virtual ~LODObject() {}
|
2024-03-04 16:57:35 -05:00
|
|
|
|
|
|
|
virtual double AveragePolyArea() const = 0; // vtable+0x04
|
|
|
|
virtual int NVerts() const = 0; // vtable+0x08
|
|
|
|
virtual int NumPolys() const = 0; // vtable+0x0c
|
|
|
|
virtual float VTable0x10() = 0; // vtable+0x10
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x100a6f10
|
|
|
|
// LODObject::`scalar deleting destructor'
|
2023-11-19 09:38:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A CompoundObject is simply a set of ROI objects which
|
|
|
|
* all together represent a single object with sub-parts.
|
|
|
|
*/
|
|
|
|
class ROI;
|
|
|
|
// typedef std::set<ROI*, std::less<const ROI*> > CompoundObject;
|
|
|
|
typedef list<ROI*> CompoundObject;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A ROIList is a list of ROI objects.
|
|
|
|
*/
|
|
|
|
typedef vector<const ROI*> ROIList;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A simple list of integers.
|
|
|
|
* Returned by RealtimeView::SelectLODs as indices into an ROIList.
|
|
|
|
*/
|
|
|
|
typedef vector<int> IntList;
|
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
// VTABLE: LEGO1 0x100dbc38
|
2024-01-12 19:34:38 -05:00
|
|
|
// SIZE 0x10
|
2023-11-19 09:38:07 -05:00
|
|
|
class ROI {
|
|
|
|
public:
|
|
|
|
ROI()
|
|
|
|
{
|
2024-02-17 10:07:34 -05:00
|
|
|
comp = 0;
|
|
|
|
lods = 0;
|
2024-03-19 14:44:42 -04:00
|
|
|
m_visible = true;
|
2023-11-19 09:38:07 -05:00
|
|
|
}
|
|
|
|
virtual ~ROI()
|
|
|
|
{
|
|
|
|
// if derived class set the comp and lods, it should delete them
|
2024-02-17 10:07:34 -05:00
|
|
|
assert(!comp);
|
|
|
|
assert(!lods);
|
2023-11-19 09:38:07 -05:00
|
|
|
}
|
2024-01-29 16:17:17 -05:00
|
|
|
virtual float IntrinsicImportance() const = 0; // vtable+0x04
|
|
|
|
virtual const float* GetWorldVelocity() const = 0; // vtable+0x08
|
|
|
|
virtual const BoundingBox& GetWorldBoundingBox() const = 0; // vtable+0x0c
|
2023-12-14 11:50:29 -05:00
|
|
|
virtual const BoundingSphere& GetWorldBoundingSphere() const = 0; // vtable+0x10
|
2023-11-19 09:38:07 -05:00
|
|
|
|
2024-02-17 10:07:34 -05:00
|
|
|
const LODListBase* GetLODs() const { return lods; }
|
2023-11-19 09:38:07 -05:00
|
|
|
const LODObject* GetLOD(int i) const
|
|
|
|
{
|
2024-02-17 10:07:34 -05:00
|
|
|
assert(lods);
|
|
|
|
return (*lods)[i];
|
2023-11-19 09:38:07 -05:00
|
|
|
}
|
2024-02-17 10:07:34 -05:00
|
|
|
int GetLODCount() const { return lods ? lods->Size() : 0; }
|
2024-08-17 11:59:22 -04:00
|
|
|
|
|
|
|
// FUNCTION: BETA10 0x10027110
|
2024-02-17 10:07:34 -05:00
|
|
|
const CompoundObject* GetComp() const { return comp; }
|
2023-11-19 09:38:07 -05:00
|
|
|
|
2024-07-04 19:06:32 -04:00
|
|
|
unsigned char GetVisibility() { return m_visible; }
|
|
|
|
void SetVisibility(unsigned char p_visible) { m_visible = p_visible; }
|
2024-01-28 09:20:21 -05:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100a5d60
|
|
|
|
// ROI::`scalar deleting destructor'
|
|
|
|
|
2023-11-19 09:38:07 -05:00
|
|
|
protected:
|
2024-03-19 14:44:42 -04:00
|
|
|
CompoundObject* comp; // 0x04
|
|
|
|
LODListBase* lods; // 0x08
|
|
|
|
unsigned char m_visible; // 0x0c
|
2023-11-19 09:38:07 -05:00
|
|
|
};
|
2024-01-14 16:28:46 -05:00
|
|
|
|
2024-02-17 10:07:34 -05:00
|
|
|
// TEMPLATE: LEGO1 0x10084930
|
|
|
|
// list<ROI *,allocator<ROI *> >::~list<ROI *,allocator<ROI *> >
|
|
|
|
|
2024-01-14 16:28:46 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100a5d50
|
|
|
|
// ROI::~ROI
|
|
|
|
|
2023-11-19 09:38:07 -05:00
|
|
|
#endif // ROI_H
|