summaryrefslogtreecommitdiffstats
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-10 11:26:32 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-10 11:26:32 +0200
commita827f0dd559331d756f57ddf63e535d100503ab2 (patch)
tree30e72a7fb5ab5fe27bf9b0f810486854c0814991 /src/rw/VisibilityPlugins.cpp
parentmore car control (diff)
parentCClumpModelInfo; little fixes (diff)
downloadre3-a827f0dd559331d756f57ddf63e535d100503ab2.tar
re3-a827f0dd559331d756f57ddf63e535d100503ab2.tar.gz
re3-a827f0dd559331d756f57ddf63e535d100503ab2.tar.bz2
re3-a827f0dd559331d756f57ddf63e535d100503ab2.tar.lz
re3-a827f0dd559331d756f57ddf63e535d100503ab2.tar.xz
re3-a827f0dd559331d756f57ddf63e535d100503ab2.tar.zst
re3-a827f0dd559331d756f57ddf63e535d100503ab2.zip
Diffstat (limited to 'src/rw/VisibilityPlugins.cpp')
-rw-r--r--src/rw/VisibilityPlugins.cpp19
1 files changed, 19 insertions, 0 deletions
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)
{