Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions mp/src/public/collisionutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,12 +1475,10 @@ bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld,
Collision_ClearTrace( ray.m_Start + ray.m_StartOffset, ray.m_Delta, pTrace );

// Compute a bounding sphere around the bloated OBB
Vector vecOBBCenter;
VectorAdd( vecOBBMins, vecOBBMaxs, vecOBBCenter );
vecOBBCenter *= 0.5f;
vecOBBCenter.x += matOBBToWorld[0][3];
vecOBBCenter.y += matOBBToWorld[1][3];
vecOBBCenter.z += matOBBToWorld[2][3];
Vector vecBoxExtents, vecOBBCenter;
VectorAdd( vecOBBMins, vecOBBMaxs, vecBoxExtents );
vecBoxExtents *= 0.5f;
VectorTransform( vecBoxExtents, matOBBToWorld, vecOBBCenter );

Vector vecOBBHalfDiagonal;
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
Expand Down Expand Up @@ -1666,7 +1664,7 @@ bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld,
}
temp.type = 3;

MatrixITransformPlane( matOBBToWorld, temp, pTrace->plane );
MatrixTransformPlane( matOBBToWorld, temp, pTrace->plane );
return true;
}

Expand Down
12 changes: 5 additions & 7 deletions sp/src/public/collisionutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,12 +1475,10 @@ bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld,
Collision_ClearTrace( ray.m_Start + ray.m_StartOffset, ray.m_Delta, pTrace );

// Compute a bounding sphere around the bloated OBB
Vector vecOBBCenter;
VectorAdd( vecOBBMins, vecOBBMaxs, vecOBBCenter );
vecOBBCenter *= 0.5f;
vecOBBCenter.x += matOBBToWorld[0][3];
vecOBBCenter.y += matOBBToWorld[1][3];
vecOBBCenter.z += matOBBToWorld[2][3];
Vector vecBoxExtents, vecOBBCenter;
VectorAdd( vecOBBMins, vecOBBMaxs, vecBoxExtents );
vecBoxExtents *= 0.5f;
VectorTransform( vecBoxExtents, matOBBToWorld, vecOBBCenter );

Vector vecOBBHalfDiagonal;
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
Expand Down Expand Up @@ -1666,7 +1664,7 @@ bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld,
}
temp.type = 3;

MatrixITransformPlane( matOBBToWorld, temp, pTrace->plane );
MatrixTransformPlane( matOBBToWorld, temp, pTrace->plane );
return true;
}

Expand Down