diff options
author | majestic <majesticcoding@gmail.com> | 2020-07-05 22:45:09 +0200 |
---|---|---|
committer | majestic <majesticcoding@gmail.com> | 2020-07-20 18:49:39 +0200 |
commit | 1ff27e3363c4deb027619375ac289a6148cda529 (patch) | |
tree | 3b39a423fff3d683dea4b16fc36308a46118286f /src/render/Occlusion.h | |
parent | fixes from master, menu helper text (diff) | |
download | re3-1ff27e3363c4deb027619375ac289a6148cda529.tar re3-1ff27e3363c4deb027619375ac289a6148cda529.tar.gz re3-1ff27e3363c4deb027619375ac289a6148cda529.tar.bz2 re3-1ff27e3363c4deb027619375ac289a6148cda529.tar.lz re3-1ff27e3363c4deb027619375ac289a6148cda529.tar.xz re3-1ff27e3363c4deb027619375ac289a6148cda529.tar.zst re3-1ff27e3363c4deb027619375ac289a6148cda529.zip |
Diffstat (limited to 'src/render/Occlusion.h')
-rw-r--r-- | src/render/Occlusion.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/render/Occlusion.h b/src/render/Occlusion.h index 0d3e26e9..9b7ba34f 100644 --- a/src/render/Occlusion.h +++ b/src/render/Occlusion.h @@ -1,5 +1,21 @@ #pragma once +struct ActiveOccluderLine { + CVector2D origin; + CVector2D direction; + float length; +}; + +class CActiveOccluder { + +public: + ActiveOccluderLine lines[6]; + int32 linesCount; + float radius; + + bool IsPointWithinOcclusionArea(float x, float y, float area); +}; + class COccluder { public: @@ -7,6 +23,10 @@ public: int16 x, y, z; uint16 angle; int16 listIndex; + + bool NearCamera(); + bool ProcessOneOccluder(CActiveOccluder *occl); + bool ProcessLineSegment(int corner1, int corner2, CActiveOccluder* occl); }; class COcclusion @@ -17,13 +37,19 @@ public: static int16 NearbyList; static int16 ListWalkThroughFA; static int16 PreviousListWalkThroughFA; + static int16 NumActiveOccluders; static COccluder aOccluders[NUMOCCLUSIONVOLUMES]; + static CActiveOccluder aActiveOccluders[NUMACTIVEOCCLUDERS]; static void Init(void); static void AddOne(float x, float y, float z, float width, float length, float height, float angle); - static void ProcessBeforeRendering(void); - - //TODO: - static bool IsAABoxOccluded(CVector pos, float, float, float) { return false; } + static void ProcessBeforeRendering(void); + static bool OccluderHidesBehind(CActiveOccluder *occl1, CActiveOccluder *occl2); + static bool IsAABoxOccluded(CVector pos, float width, float length, float height); + static bool IsPositionOccluded(CVector pos, float side); + static void Render(); }; + +bool CalcScreenCoors(CVector const &in, CVector *out, float *outw, float *outh); +bool CalcScreenCoors(CVector const &in, CVector *out);
\ No newline at end of file |