]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Tweak the accidentally pushed CSQC model LOD support to work with large models
authorMario <mario@smbclan.net>
Mon, 19 Feb 2018 15:22:37 +0000 (01:22 +1000)
committerMario <mario@smbclan.net>
Mon, 19 Feb 2018 15:22:37 +0000 (01:22 +1000)
qcsrc/client/csqcmodel_hooks.qc

index ebec91d625254ee9fd66a6048661b4af2ce98f39..2807f996aa228db0e538a596a151dffa55a52894 100644 (file)
@@ -79,7 +79,7 @@ void CSQCPlayer_LOD_Apply(entity this, bool isplayer)
        }
        else
        {
-               float distance = vlen(this.origin - view_origin);
+               float distance = vlen(((isplayer) ? this.origin : NearestPointOnBox(this, view_origin)) - view_origin); // TODO: perhaps it should just use NearestPointOnBox all the time, player hitbox can potentially be huge
                float f = (distance * current_viewzoom + 100.0) * detailreduction;
                f *= 1.0 / bound(0.01, view_quality, 1);
                if(f > autocvar_cl_loddistance2)