2019-05-15 14:52:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BaseModelInfo.h"
|
|
|
|
|
|
|
|
class CSimpleModelInfo : public CBaseModelInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// atomics[2] is often a pointer to the non-LOD modelinfo
|
|
|
|
RpAtomic *m_atomics[3];
|
|
|
|
// m_lodDistances[2] holds the near distance for LODs
|
|
|
|
float m_lodDistances[3];
|
|
|
|
uint8 m_numAtomics;
|
|
|
|
uint8 m_alpha;
|
2019-06-17 08:30:02 +00:00
|
|
|
uint16 m_firstDamaged : 2; // 0: no damage model
|
|
|
|
// 1: 1 and 2 are damage models
|
|
|
|
// 2: 2 is damage model
|
2019-05-15 14:52:37 +00:00
|
|
|
uint16 m_normalCull : 1;
|
|
|
|
uint16 m_isDamaged : 1;
|
|
|
|
uint16 m_isBigBuilding : 1;
|
|
|
|
uint16 m_noFade : 1;
|
|
|
|
uint16 m_drawLast : 1;
|
|
|
|
uint16 m_additive : 1;
|
|
|
|
uint16 m_isSubway : 1;
|
|
|
|
uint16 m_ignoreLight : 1;
|
|
|
|
uint16 m_noZwrite : 1;
|
|
|
|
|
|
|
|
CSimpleModelInfo(void) : CBaseModelInfo(MITYPE_SIMPLE) {}
|
2020-05-05 11:02:42 +00:00
|
|
|
CSimpleModelInfo(ModelInfoType id) : CBaseModelInfo(id) {}
|
2019-05-15 14:52:37 +00:00
|
|
|
~CSimpleModelInfo() {}
|
|
|
|
void DeleteRwObject(void);
|
|
|
|
RwObject *CreateInstance(void);
|
|
|
|
RwObject *CreateInstance(RwMatrix *);
|
|
|
|
RwObject *GetRwObject(void) { return (RwObject*)m_atomics[0]; }
|
|
|
|
|
|
|
|
void Init(void);
|
|
|
|
void IncreaseAlpha(void);
|
|
|
|
void SetAtomic(int n, RpAtomic *atomic);
|
|
|
|
void SetLodDistances(float *dist);
|
2020-05-05 11:02:42 +00:00
|
|
|
float GetLodDistance(int i);
|
2019-05-15 14:52:37 +00:00
|
|
|
float GetNearDistance(void);
|
|
|
|
float GetLargestLodDistance(void);
|
|
|
|
RpAtomic *GetAtomicFromDistance(float dist);
|
2020-05-05 15:04:43 +00:00
|
|
|
#ifdef MIAMI
|
|
|
|
RpAtomic *GetFirstAtomicFromDistance(float dist); // inline
|
|
|
|
#endif
|
2019-05-15 14:52:37 +00:00
|
|
|
void FindRelatedModel(void);
|
|
|
|
void SetupBigBuilding(void);
|
|
|
|
|
|
|
|
void SetNumAtomics(int n) { m_numAtomics = n; }
|
|
|
|
CSimpleModelInfo *GetRelatedModel(void){
|
|
|
|
return (CSimpleModelInfo*)m_atomics[2]; }
|
|
|
|
void SetRelatedModel(CSimpleModelInfo *m){
|
|
|
|
m_atomics[2] = (RpAtomic*)m; }
|
|
|
|
};
|
|
|
|
static_assert(sizeof(CSimpleModelInfo) == 0x4C, "CSimpleModelInfo: error");
|