1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-03 16:13:22 +08:00

Updated collisionproperty.h.

This commit is contained in:
Nicholas Hastings 2012-10-29 21:53:07 -04:00
parent 1458e20376
commit 177a18b2b6

View File

@ -72,8 +72,10 @@ public:
// Methods of ICollideable
virtual IHandleEntity *GetEntityHandle();
virtual const Vector& OBBMins( ) const;
virtual const Vector& OBBMaxs( ) const;
virtual const Vector& OBBMinsPreScaled() const { return m_vecMinsPreScaled.Get(); }
virtual const Vector& OBBMaxsPreScaled() const { return m_vecMaxsPreScaled.Get(); }
virtual const Vector& OBBMins() const { return m_vecMins.Get(); }
virtual const Vector& OBBMaxs() const { return m_vecMaxs.Get(); }
virtual void WorldSpaceTriggerBounds( Vector *pVecWorldMins, Vector *pVecWorldMaxs ) const;
virtual bool TestCollision( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
virtual bool TestHitboxes( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
@ -102,6 +104,9 @@ public:
// Sets the collision bounds + the size (OBB)
void SetCollisionBounds( const Vector& mins, const Vector &maxs );
// Rebuilds the scaled bounds from the pre-scaled bounds after a model's scale has changed
void RefreshScaledCollisionBounds( void );
// Sets special trigger bounds. The bloat amount indicates how much bigger the
// trigger bounds should be beyond the bounds set in SetCollisionBounds
// This method will also set the FSOLID flag FSOLID_USE_TRIGGER_BOUNDS
@ -164,6 +169,12 @@ public:
// Computes a bounding box in world space surrounding the collision bounds
void WorldSpaceAABB( Vector *pWorldMins, Vector *pWorldMaxs ) const;
// Get the collision space mins directly
const Vector & CollisionSpaceMins( void ) const;
// Get the collision space maxs directly
const Vector & CollisionSpaceMaxs( void ) const;
// Computes a "normalized" point (range 0,0,0 - 1,1,1) in collision space
// Useful for things like getting a point 75% of the way along z on the OBB, for example
const Vector & NormalizedToCollisionSpace( const Vector &in, Vector *pResult ) const;
@ -228,6 +239,8 @@ private:
private:
CBaseEntity *m_pOuter;
CNetworkVector( m_vecMinsPreScaled );
CNetworkVector( m_vecMaxsPreScaled );
CNetworkVector( m_vecMins );
CNetworkVector( m_vecMaxs );
float m_flRadius;
@ -245,6 +258,8 @@ private:
// SUCKY: We didn't use to have to store this previously
// but storing it here means that we can network it + avoid a ton of
// client-side mismatch problems
CNetworkVector( m_vecSpecifiedSurroundingMinsPreScaled );
CNetworkVector( m_vecSpecifiedSurroundingMaxsPreScaled );
CNetworkVector( m_vecSpecifiedSurroundingMins );
CNetworkVector( m_vecSpecifiedSurroundingMaxs );
@ -441,6 +456,19 @@ inline void CCollisionProperty::WorldSpaceAABB( Vector *pWorldMins, Vector *pWor
}
// Get the collision space mins directly
inline const Vector & CCollisionProperty::CollisionSpaceMins( void ) const
{
return m_vecMins;
}
// Get the collision space maxs directly
inline const Vector & CCollisionProperty::CollisionSpaceMaxs( void ) const
{
return m_vecMaxs;
}
//-----------------------------------------------------------------------------
// Does a rotation make us need to recompute the surrounding box?
//-----------------------------------------------------------------------------