From 0f173df0d4c81f0e9a66b5724c918b082161b4ed Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 28 Jan 2016 00:42:08 -0600 Subject: [PATCH 1/2] setDetailFromDistance aspect ratio friendly adjustment --- Engine/source/ts/tsShapeInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index 821e02dba..03b8c79c3 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -593,7 +593,7 @@ S32 TSShapeInstance::setDetailFromDistance( const SceneRenderState *state, F32 s // 4:3 aspect ratio, we've changed the reference value // to 300 to be more compatible with legacy shapes. // - const F32 pixelScale = state->getViewport().extent.y / 300.0f; + const F32 pixelScale = (state->getViewport().extent.x / state->getViewport().extent.y); // This is legacy DTS support for older "multires" based // meshes. The original crossbow weapon uses this. From 7924f056bdfcabb4152c2b55c79695dac8534e27 Mon Sep 17 00:00:00 2001 From: RoundedIcon Date: Mon, 1 Feb 2016 16:58:39 -0700 Subject: [PATCH 2/2] Fix for collision issues with scaled players Players scaled after their creation have collision issues with terrain. Changing this bit of code fixes those issues for downsized players, even when shrunk to 10% of their original size. --- Engine/source/T3D/player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 3c258c374..6e33284a6 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -4659,9 +4659,9 @@ Point3F Player::_move( const F32 travelTime, Collision *outCol ) } Point3F distance = end - start; - if (mFabs(distance.x) < mObjBox.len_x() && - mFabs(distance.y) < mObjBox.len_y() && - mFabs(distance.z) < mObjBox.len_z()) + if (mFabs(distance.x) < mScaledBox.len_x() && + mFabs(distance.y) < mScaledBox.len_y() && + mFabs(distance.z) < mScaledBox.len_z()) { // We can potentially early out of this. If there are no polys in the clipped polylist at our // end position, then we can bail, and just set start = end;