From e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 10 May 2020 10:04:20 +0200 Subject: CWeaponModelInfo --- src/rw/VisibilityPlugins.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/rw/VisibilityPlugins.cpp') diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp index 14f68e52..93a478e5 100644 --- a/src/rw/VisibilityPlugins.cpp +++ b/src/rw/VisibilityPlugins.cpp @@ -218,6 +218,25 @@ CVisibilityPlugins::RenderAlphaAtomic(RpAtomic *atomic, int alpha) return atomic; } +//--MIAMI: done +RpAtomic* +CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic) +{ + RwMatrix *m; + RwV3d view; + float maxdist, distsq; + CSimpleModelInfo *mi; + + mi = GetAtomicModelInfo(atomic); + m = RwFrameGetLTM(RpAtomicGetFrame(atomic)); + RwV3dSub(&view, RwMatrixGetPos(m), ms_pCameraPosn); + maxdist = mi->GetLodDistance(0); + distsq = RwV3dDotProduct(&view, &view); + if(distsq < maxdist*maxdist) + AtomicDefaultRenderCallBack(atomic); + return atomic; +} + RpAtomic* CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist) { -- cgit v1.2.3