From 3b0ed17c0de8eb26d9a5099b1b9d39e4b1ba8d92 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 22 Jan 2023 12:05:28 +0100 Subject: [PATCH] Ray_t structure improvements Apparently it has 2 flag fields? --- r5dev/public/cmodel.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/r5dev/public/cmodel.h b/r5dev/public/cmodel.h index edbcfe99..0c3729e4 100644 --- a/r5dev/public/cmodel.h +++ b/r5dev/public/cmodel.h @@ -30,28 +30,32 @@ struct Ray_t int m_nUnk58; bool m_IsRay; bool m_IsSwept; - void* m_pUnk60; + int m_nFlags2; // Unsure what these do yet. + int m_nUnk68; - Ray_t() : m_pWorldAxisTransform(NULL) {}; + Ray_t() : m_pWorldAxisTransform(nullptr) {}; + Ray_t(Vector3D const& start, Vector3D const& end, int nFlags1 = 0x3f800000, int nFlags2 = NULL) { Init(start, end, nFlags1, nFlags2); }; - void Init(Vector3D const& start, Vector3D const& end) + void Init(Vector3D const& start, Vector3D const& end, int nFlags1, int nFlags2) { VectorSubtract(end, start, m_Delta); m_IsSwept = (m_Delta.LengthSqr() != 0); m_nUnk30 = NULL; m_nUnk34 = NULL; + m_nUnk38 = NULL; m_nUnk3C = NULL; - m_nUnk44 = NULL; + m_nUnk40 = NULL; m_nUnk44 = NULL; - m_nFlags = 0x3F800000; // !TODO: Reverse these flags! + m_nFlags = nFlags1; // !TODO: Reverse these flags! - m_pWorldAxisTransform = NULL; + m_pWorldAxisTransform = nullptr; m_IsRay = true; m_nUnk58 = NULL; - m_pUnk60 = NULL; + m_nFlags2 = nFlags2; // !TODO: Reverse these flags! + m_nUnk68 = NULL; VectorClear(m_StartOffset); VectorCopy(start, m_Start);