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"
|
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"
|
|
|
|
#include "realtime/realtime.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-01-12 19:34:38 -05:00
|
|
|
const Mx3DPointFloat& Min() const { return min; }
|
|
|
|
Mx3DPointFloat& Min() { return min; }
|
|
|
|
const Mx3DPointFloat& Max() const { return max; }
|
|
|
|
Mx3DPointFloat& Max() { return max; }
|
2023-11-19 09:38:07 -05:00
|
|
|
|
|
|
|
private:
|
2024-01-12 19:34:38 -05:00
|
|
|
Mx3DPointFloat min;
|
|
|
|
Mx3DPointFloat max;
|
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-01-12 19:34:38 -05:00
|
|
|
const Mx3DPointFloat& Center() const { return center; }
|
|
|
|
Mx3DPointFloat& Center() { return center; }
|
2023-11-19 09:38:07 -05:00
|
|
|
const float& Radius() const { return radius; }
|
|
|
|
float& Radius() { return radius; }
|
|
|
|
|
|
|
|
private:
|
2024-01-12 19:34:38 -05:00
|
|
|
Mx3DPointFloat center;
|
2023-11-19 09:38:07 -05:00
|
|
|
float radius;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Abstract base class representing a single LOD version of
|
|
|
|
* a geometric object.
|
|
|
|
*/
|
|
|
|
class LODObject {
|
|
|
|
public:
|
|
|
|
// LODObject();
|
|
|
|
virtual ~LODObject() {}
|
2023-12-14 11:50:29 -05:00
|
|
|
virtual float Cost(float pixels_covered) const = 0; // vtable+0x4
|
|
|
|
virtual float AveragePolyArea() const = 0; // vtable+0x8
|
|
|
|
virtual int NVerts() const = 0; // vtable+0xc
|
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()
|
|
|
|
{
|
|
|
|
m_comp = 0;
|
|
|
|
m_lods = 0;
|
2024-01-12 19:34:38 -05:00
|
|
|
m_unk0xc = 1;
|
2023-11-19 09:38:07 -05:00
|
|
|
}
|
|
|
|
virtual ~ROI()
|
|
|
|
{
|
|
|
|
// if derived class set the comp and lods, it should delete them
|
|
|
|
assert(!m_comp);
|
|
|
|
assert(!m_lods);
|
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
virtual float IntrinsicImportance() const = 0; // vtable+0x4
|
2024-01-12 19:34:38 -05:00
|
|
|
virtual const float* GetWorldVelocity() const = 0; // vtable+0x8
|
2023-12-14 11:50:29 -05:00
|
|
|
virtual const BoundingBox& GetWorldBoundingBox() const = 0; // vtable+0xc
|
|
|
|
virtual const BoundingSphere& GetWorldBoundingSphere() const = 0; // vtable+0x10
|
2023-11-19 09:38:07 -05:00
|
|
|
|
|
|
|
const LODListBase* GetLODs() const { return m_lods; }
|
|
|
|
const LODObject* GetLOD(int i) const
|
|
|
|
{
|
|
|
|
assert(m_lods);
|
|
|
|
return (*m_lods)[i];
|
|
|
|
}
|
|
|
|
int GetLODCount() const { return m_lods ? m_lods->Size() : 0; }
|
|
|
|
const CompoundObject* GetComp() const { return m_comp; }
|
|
|
|
|
|
|
|
protected:
|
2023-12-14 11:50:29 -05:00
|
|
|
CompoundObject* m_comp; // 0x4
|
|
|
|
LODListBase* m_lods; // 0x8
|
2024-01-12 19:34:38 -05:00
|
|
|
undefined m_unk0xc; // 0xc
|
2023-11-19 09:38:07 -05:00
|
|
|
};
|
2024-01-14 16:28:46 -05:00
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x100a5d50
|
|
|
|
// ROI::~ROI
|
|
|
|
|
2023-11-19 09:38:07 -05:00
|
|
|
#endif // ROI_H
|