summaryrefslogtreecommitdiffstats
path: root/src/renderer/Glass.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-15 17:19:32 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-17 23:04:26 +0200
commitd0404cbdb77bd82abf578ce28093990db94743f2 (patch)
tree1a7232c3dcdd6c371ab5fbde0fc6bf04c5bc7005 /src/renderer/Glass.h
parentMerge pull request #1217 from Nopey/master (diff)
downloadre3-d0404cbdb77bd82abf578ce28093990db94743f2.tar
re3-d0404cbdb77bd82abf578ce28093990db94743f2.tar.gz
re3-d0404cbdb77bd82abf578ce28093990db94743f2.tar.bz2
re3-d0404cbdb77bd82abf578ce28093990db94743f2.tar.lz
re3-d0404cbdb77bd82abf578ce28093990db94743f2.tar.xz
re3-d0404cbdb77bd82abf578ce28093990db94743f2.tar.zst
re3-d0404cbdb77bd82abf578ce28093990db94743f2.zip
Diffstat (limited to 'src/renderer/Glass.h')
-rw-r--r--src/renderer/Glass.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/renderer/Glass.h b/src/renderer/Glass.h
new file mode 100644
index 00000000..51c5aae9
--- /dev/null
+++ b/src/renderer/Glass.h
@@ -0,0 +1,52 @@
+#pragma once
+
+class CEntity;
+
+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;
+
+ 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 point, float moveSpeed, bool cracked, bool explosion);
+ 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);
+}; \ No newline at end of file