summaryrefslogtreecommitdiffstats
path: root/src/renderer/Glass.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-17 23:03:57 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-17 23:03:57 +0200
commitc937bdbfea8f522d14d7a41f24372bddf5bdafcc (patch)
treeeb8f97f6cf9fac31d7ab90388af232d51cc9c137 /src/renderer/Glass.h
parentMerge pull request #1219 from withmorten/miami-ini (diff)
downloadre3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.gz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.bz2
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.lz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.xz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.zst
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.zip
Diffstat (limited to 'src/renderer/Glass.h')
-rw-r--r--src/renderer/Glass.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/renderer/Glass.h b/src/renderer/Glass.h
new file mode 100644
index 00000000..f1c85779
--- /dev/null
+++ b/src/renderer/Glass.h
@@ -0,0 +1,59 @@
+#pragma once
+
+class CEntity;
+class CVehicle;
+class CPtrList;
+
+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;
+ bool m_bCarGlass;
+
+ CFallingGlassPane() { }
+ ~CFallingGlassPane() { }
+
+ void Update(void);
+ void Render(void);
+};
+
+VALIDATE_SIZE(CFallingGlassPane, 0x70);
+
+enum
+{
+ NUM_GLASSTRIANGLES = 5,
+};
+
+class CGlass
+{
+ static uint32 NumGlassEntities;
+ static CEntity *apEntitiesToBeRendered[NUM_GLASSENTITIES];
+ static CFallingGlassPane aGlassPanes[NUM_GLASSPANES];
+public:
+ static void Init(void);
+ static void Update(void);
+ static void Render(void);
+ static CFallingGlassPane *FindFreePane(void);
+ 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);
+ 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);
+ 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);
+}; \ No newline at end of file