diff options
Diffstat (limited to 'src/rw')
-rw-r--r-- | src/rw/VisibilityPlugins.cpp | 8 | ||||
-rw-r--r-- | src/rw/VisibilityPlugins.h | 1 |
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); |