summaryrefslogtreecommitdiff
path: root/src/rw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-07-01 18:03:39 +0200
committeraap <aap@papnet.eu>2020-07-01 18:04:02 +0200
commit2141247e0829baec36c9011f0c660ad7d8e40dd8 (patch)
treef413928cb6dd07e5447113cac0b84e32d45b1318 /src/rw
parent389123cff3e53b2e2fa1fed89b23684ae0ccf06e (diff)
CBoat and friends
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/VisibilityPlugins.cpp8
-rw-r--r--src/rw/VisibilityPlugins.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index cff1ff16..25dffb4e 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -626,6 +626,14 @@ CVisibilityPlugins::RenderPedCB(RpAtomic *atomic)
}
float
+CVisibilityPlugins::GetDistanceSquaredFromCamera(RwV3d *pos)
+{
+ RwV3d dist;
+ RwV3dSub(&dist, pos, ms_pCameraPosn);
+ return RwV3dDotProduct(&dist, &dist);
+}
+
+float
CVisibilityPlugins::GetDistanceSquaredFromCamera(RwFrame *frame)
{
RwMatrix *m;
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index 89583432..d426abec 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -83,6 +83,7 @@ public:
static bool VehicleVisibilityCB(RpClump *clump);
static bool VehicleVisibilityCB_BigVehicle(RpClump *clump);
+ static float GetDistanceSquaredFromCamera(RwV3d *pos);
static float GetDistanceSquaredFromCamera(RwFrame *frame);
static float GetDotProductWithCameraVector(RwMatrix *atomicMat, RwMatrix *clumpMat, uint32 flags);