summaryrefslogtreecommitdiff
path: root/src/d
diff options
context:
space:
mode:
authorelijah-thomas774 <elijahthomas774@gmail.com>2026-09-24 17:21:34 -0400
committerelijah-thomas774 <elijahthomas774@gmail.com>2026-09-24 17:21:34 -0400
commitfe566ba5dbc764a01774643f8a47b7ff5d53fd87 (patch)
treedbdcba8daa19d66a0512154aa1a0576b189b1923 /src/d
parent93e4f125268d37b96059629a00ae76aa18a46d7c (diff)
d_a_e_skytail OK
Diffstat (limited to 'src/d')
-rw-r--r--src/d/a/e/d_a_en_base.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/d/a/e/d_a_en_base.cpp b/src/d/a/e/d_a_en_base.cpp
new file mode 100644
index 00000000..5dad582a
--- /dev/null
+++ b/src/d/a/e/d_a_en_base.cpp
@@ -0,0 +1,18 @@
+#include "d/a/e/d_a_en_base.h"
+
+#include "d/d_stage_mgr.h"
+#include "m/m_vec.h"
+#include "nw4r/g3d/g3d_camera.h"
+
+bool dAcEnBase_c::isWithinCameraView(f32 w, f32 h) {
+ nw4r::g3d::Camera cam = dStageMgr_c::GetInstance()->getCamera(0);
+
+ f32 x, y, width, height, near, far;
+ cam.GetViewport(&x, &y, &width, &height, &near, &far);
+
+ mVec3_c src;
+ cam.Project(src, mPosition);
+
+ return ((width * w <= src.x) && (src.x < width * (1.0f - w))) &&
+ ((height * h <= src.y) && src.y < height * (1.0f - h)) && ((near <= src.z) && (src.z < far));
+}