mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2024-11-24 21:01:59 +00:00
Fix missing transform in IntersectRayWithOBB
This commit is contained in:
parent
56e46c606d
commit
319c5083cc
2 changed files with 8 additions and 12 deletions
|
@ -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 );
|
Collision_ClearTrace( ray.m_Start + ray.m_StartOffset, ray.m_Delta, pTrace );
|
||||||
|
|
||||||
// Compute a bounding sphere around the bloated OBB
|
// Compute a bounding sphere around the bloated OBB
|
||||||
Vector vecOBBCenter;
|
Vector vecBoxExtents, vecOBBCenter;
|
||||||
VectorAdd( vecOBBMins, vecOBBMaxs, vecOBBCenter );
|
VectorAdd( vecOBBMins, vecOBBMaxs, vecBoxExtents );
|
||||||
vecOBBCenter *= 0.5f;
|
vecBoxExtents *= 0.5f;
|
||||||
vecOBBCenter.x += matOBBToWorld[0][3];
|
VectorTransform( vecBoxExtents, matOBBToWorld, vecOBBCenter );
|
||||||
vecOBBCenter.y += matOBBToWorld[1][3];
|
|
||||||
vecOBBCenter.z += matOBBToWorld[2][3];
|
|
||||||
|
|
||||||
Vector vecOBBHalfDiagonal;
|
Vector vecOBBHalfDiagonal;
|
||||||
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
|
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
|
||||||
|
|
|
@ -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 );
|
Collision_ClearTrace( ray.m_Start + ray.m_StartOffset, ray.m_Delta, pTrace );
|
||||||
|
|
||||||
// Compute a bounding sphere around the bloated OBB
|
// Compute a bounding sphere around the bloated OBB
|
||||||
Vector vecOBBCenter;
|
Vector vecBoxExtents, vecOBBCenter;
|
||||||
VectorAdd( vecOBBMins, vecOBBMaxs, vecOBBCenter );
|
VectorAdd( vecOBBMins, vecOBBMaxs, vecBoxExtents );
|
||||||
vecOBBCenter *= 0.5f;
|
vecBoxExtents *= 0.5f;
|
||||||
vecOBBCenter.x += matOBBToWorld[0][3];
|
VectorTransform( vecBoxExtents, matOBBToWorld, vecOBBCenter );
|
||||||
vecOBBCenter.y += matOBBToWorld[1][3];
|
|
||||||
vecOBBCenter.z += matOBBToWorld[2][3];
|
|
||||||
|
|
||||||
Vector vecOBBHalfDiagonal;
|
Vector vecOBBHalfDiagonal;
|
||||||
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
|
VectorSubtract( vecOBBMaxs, vecOBBMins, vecOBBHalfDiagonal );
|
||||||
|
|
Loading…
Reference in a new issue