diff options
author | aap <aap@papnet.eu> | 2020-07-01 18:03:39 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-07-01 18:04:02 +0200 |
commit | 2141247e0829baec36c9011f0c660ad7d8e40dd8 (patch) | |
tree | f413928cb6dd07e5447113cac0b84e32d45b1318 /src/rw | |
parent | fix (diff) | |
download | re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar.gz re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar.bz2 re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar.lz re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar.xz re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.tar.zst re3-2141247e0829baec36c9011f0c660ad7d8e40dd8.zip |
Diffstat (limited to '')
-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); |