diff --git a/Engine/source/ts/tsCollision.cpp b/Engine/source/ts/tsCollision.cpp index 22381436b..04adffdf8 100644 --- a/Engine/source/ts/tsCollision.cpp +++ b/Engine/source/ts/tsCollision.cpp @@ -811,11 +811,11 @@ bool TSShapeInstance::buildConvexOpcode( const MatrixF &objMat, const Point3F &o return emitted; } -void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vector *outLOSDetails ) const +void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vector *outLOSDetails, S32 specifiedLOD) const { PROFILE_SCOPE( TSShape_findColDetails ); - if ( useVisibleMesh ) + if ( useVisibleMesh || (specifiedLOD !=0)) { // If we're using the visible mesh for collision then // find the highest detail and use that. @@ -836,12 +836,23 @@ void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vect dStrStartsWith( name, "LOS" ) ) continue; */ - - // Otherwise test against the current highest size - if ( details[i].size > highestSize ) + if (specifiedLOD != 0) { - highestDetail = i; - highestSize = details[i].size; + if (details[i].size == specifiedLOD) + { + highestDetail = i; + highestSize = details[i].size; + + } + } + else + { + // Otherwise test against the current highest size + if (details[i].size > highestSize) + { + highestDetail = i; + highestSize = details[i].size; + } } } @@ -852,7 +863,6 @@ void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vect if ( outLOSDetails ) outLOSDetails->push_back( highestDetail ); } - return; } diff --git a/Engine/source/ts/tsShape.h b/Engine/source/ts/tsShape.h index c2a3fc1c4..c4446faa5 100644 --- a/Engine/source/ts/tsShape.h +++ b/Engine/source/ts/tsShape.h @@ -475,7 +475,7 @@ class TSShape /// @param outDetails The output detail index vector. /// @param outLOSDetails The optional output LOS detail vector. /// - void findColDetails( bool useVisibleMesh, Vector *outDetails, Vector *outLOSDetails ) const; + void findColDetails(bool useVisibleMesh, Vector* outDetails, Vector* outLOSDetails, S32 specifiedLOD = 0 ) const; /// Builds a physics collision shape at the requested scale. ///