1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Update Ray_t. Fixes #70.

This commit is contained in:
Nick Hastings 2020-03-25 19:04:40 -04:00
parent cbaba621ec
commit c29c492594

View File

@ -1,4 +1,4 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
@ -57,16 +57,18 @@ struct csurface_t
//-----------------------------------------------------------------------------
// A ray...
//-----------------------------------------------------------------------------
struct Ray_t
{
VectorAligned m_Start; // starting point, centered within the extents
VectorAligned m_Delta; // direction + length of the ray
VectorAligned m_StartOffset; // Add this to m_Start to get the actual ray start
VectorAligned m_Extents; // Describes an axis aligned box extruded along a ray
const matrix3x4_t *m_pWorldAxisTransform;
bool m_IsRay; // are the extents zero?
bool m_IsSwept; // is delta != 0?
Ray_t() : m_pWorldAxisTransform( NULL ) {}
void Init( Vector const& start, Vector const& end )
{
Assert( &end );
@ -75,6 +77,7 @@ struct Ray_t
m_IsSwept = (m_Delta.LengthSqr() != 0);
VectorClear( m_Extents );
m_pWorldAxisTransform = NULL;
m_IsRay = true;
// Offset m_Start to be in the center of the box...
@ -87,6 +90,7 @@ struct Ray_t
Assert( &end );
VectorSubtract( end, start, m_Delta );
m_pWorldAxisTransform = NULL;
m_IsSwept = (m_Delta.LengthSqr() != 0);
VectorSubtract( maxs, mins, m_Extents );