re3/src/render/Glass.h

59 lines
1.8 KiB
C
Raw Normal View History

2019-05-15 14:52:37 +00:00
#pragma once
class CEntity;
2020-05-27 20:32:33 +00:00
class CVehicle;
2020-10-14 21:33:57 +00:00
class CPtrList;
2019-05-15 14:52:37 +00:00
2020-04-01 21:04:56 +00:00
class CFallingGlassPane : public CMatrix
{
public:
CVector m_vecMoveSpeed;
CVector m_vecTurn;
uint32 m_nTimer;
float m_fGroundZ;
float m_fStep;
uint8 m_nTriIndex;
bool m_bActive;
bool m_bShattered;
2020-10-14 21:33:57 +00:00
bool m_bCarGlass;
2020-04-01 21:04:56 +00:00
CFallingGlassPane() { }
~CFallingGlassPane() { }
void Update(void);
void Render(void);
};
VALIDATE_SIZE(CFallingGlassPane, 0x70);
enum
{
NUM_GLASSTRIANGLES = 5,
};
2019-05-15 14:52:37 +00:00
class CGlass
{
2020-04-01 21:04:56 +00:00
static uint32 NumGlassEntities;
static CEntity *apEntitiesToBeRendered[NUM_GLASSENTITIES];
static CFallingGlassPane aGlassPanes[NUM_GLASSPANES];
2019-05-15 14:52:37 +00:00
public:
2020-03-22 14:23:40 +00:00
static void Init(void);
2020-04-01 21:04:56 +00:00
static void Update(void);
static void Render(void);
static CFallingGlassPane *FindFreePane(void);
2020-10-14 21:33:57 +00:00
static void GeneratePanesForWindow(uint32 type, CVector pos, CVector up, CVector right, CVector speed, CVector center, float moveSpeed, bool cracked, bool explosion, int32 stepmul, bool carGlass);
2020-04-01 21:04:56 +00:00
static void AskForObjectToBeRenderedInGlass(CEntity *entity);
static void RenderEntityInGlass(CEntity *entity);
static int32 CalcAlphaWithNormal(CVector *normal);
static void RenderHiLightPolys(void);
static void RenderShatteredPolys(void);
static void RenderReflectionPolys(void);
static void WindowRespondsToCollision(CEntity *entity, float amount, CVector speed, CVector point, bool explosion);
static void WindowRespondsToSoftCollision(CEntity *entity, float amount);
static void WasGlassHitByBullet(CEntity *entity, CVector point);
static void WindowRespondsToExplosion(CEntity *entity, CVector point);
2020-10-14 21:33:57 +00:00
static void CarWindscreenShatters(CVehicle *vehicle, bool unk);
static bool HasGlassBeenShatteredAtCoors(float x, float y, float z);
static void FindWindowSectorList(CPtrList &list, float *dist, CEntity **entity, float x, float y, float z);
static void BreakGlassPhysically(CVector pos, float radius);
2020-04-01 21:04:56 +00:00
};