summaryrefslogtreecommitdiffstats
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-10 10:04:20 +0200
committeraap <aap@papnet.eu>2020-05-10 10:04:20 +0200
commite9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274 (patch)
treebab6161fcd3d49bd6805619cb304d6958d1147a1 /src/rw/VisibilityPlugins.cpp
parentMerge pull request #528 from Nick007J/miami (diff)
downloadre3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.gz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.bz2
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.lz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.xz
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.tar.zst
re3-e9fbd2ccfd9bd70cfdae0161f4c32aa29f6b7274.zip
Diffstat (limited to '')
-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)
{