diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/game/server/hl2/func_bulletshield.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/game/server/hl2/func_bulletshield.cpp')
| -rw-r--r-- | sp/src/game/server/hl2/func_bulletshield.cpp | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/sp/src/game/server/hl2/func_bulletshield.cpp b/sp/src/game/server/hl2/func_bulletshield.cpp index 28fbcd20..3d5bcefd 100644 --- a/sp/src/game/server/hl2/func_bulletshield.cpp +++ b/sp/src/game/server/hl2/func_bulletshield.cpp @@ -1,101 +1,101 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
-#include "cbase.h"
-#include "entityoutput.h"
-#include "ndebugoverlay.h"
-#include "func_bulletshield.h"
-#include "collisionutils.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-extern ConVar ent_debugkeys;
-extern ConVar showtriggers;
-
-
-
-LINK_ENTITY_TO_CLASS( func_bulletshield, CFuncBulletShield );
-
-BEGIN_DATADESC( CFuncBulletShield )
-
-/*
- DEFINE_INPUTFUNC( FIELD_VOID, "Enable", InputTurnOn ),
- DEFINE_INPUTFUNC( FIELD_VOID, "Disable", InputTurnOff ),
- DEFINE_INPUTFUNC( FIELD_VOID, "Toggle", InputToggle ),
- DEFINE_KEYFIELD( m_iDisabled, FIELD_INTEGER, "StartDisabled" ),
- DEFINE_KEYFIELD( m_iSolidity, FIELD_INTEGER, "Solidity" ),
- DEFINE_KEYFIELD( m_bSolidBsp, FIELD_BOOLEAN, "solidbsp" ),
- DEFINE_KEYFIELD( m_iszExcludedClass, FIELD_STRING, "excludednpc" ),
- DEFINE_KEYFIELD( m_bInvertExclusion, FIELD_BOOLEAN, "invert_exclusion" ),
-*/
-
-END_DATADESC()
-
-
-
-void CFuncBulletShield::Spawn( void )
-{
- BaseClass::Spawn();
-
- AddSolidFlags( FSOLID_CUSTOMRAYTEST );
- AddSolidFlags( FSOLID_CUSTOMBOXTEST );
- // SetSolid(SOLID_CUSTOM);
-
- VPhysicsDestroyObject();
-}
-
-/*
-bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta,
- const matrix3x4_t &matOBBToWorld, const Vector &vecOBBMins, const Vector &vecOBBMaxs,
- float flTolerance, CBaseTrace *pTrace );
-
-bool IntersectRayWithOBB( const Vector &vecRayOrigin, const Vector &vecRayDelta,
- const Vector &vecBoxOrigin, const QAngle &angBoxRotation,
- const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace );
-
-bool IntersectRayWithOBB( const Ray_t &ray, const Vector &vecBoxOrigin, const QAngle &angBoxRotation,
- const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace );
-
-bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld,
- const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace );
-
-bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta,
- const matrix3x4_t &matOBBToWorld, const Vector &vecOBBMins, const Vector &vecOBBMaxs,
- float flTolerance, BoxTraceInfo_t *pTrace );
- */
-
-bool CFuncBulletShield::TestCollision( const Ray_t &ray, unsigned int mask, trace_t& trace )
-{
- // ignore unless a shot
- if ((mask & MASK_SHOT) == MASK_SHOT)
- {
- // use obb collision
- ICollideable *pCol = GetCollideable();
- Assert(pCol);
-
- return IntersectRayWithOBB(ray,pCol->GetCollisionOrigin(),pCol->GetCollisionAngles(),
- pCol->OBBMins(),pCol->OBBMaxs(),1.0f,&trace);
-
- /*
- const model_t *pModel = this->GetCollisionModel();
- if ( pModel && pModel->type == mod_brush )
- {
- int nModelIndex = this->GetCollisionModelIndex();
- cmodel_t *pCModel = CM_InlineModelNumber( nModelIndex - 1 );
- int nHeadNode = pCModel->headnode;
-
- CM_TransformedBoxTrace( ray, nHeadNode, fMask, this->GetCollisionOrigin(), this->GetCollisionAngles(), *pTrace );
- return true;
- }
- return false;
- */
-
- // return BaseClass::TestCollision( ray, mask, trace );
- }
- else
- return false;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "cbase.h" +#include "entityoutput.h" +#include "ndebugoverlay.h" +#include "func_bulletshield.h" +#include "collisionutils.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +extern ConVar ent_debugkeys; +extern ConVar showtriggers; + + + +LINK_ENTITY_TO_CLASS( func_bulletshield, CFuncBulletShield ); + +BEGIN_DATADESC( CFuncBulletShield ) + +/* + DEFINE_INPUTFUNC( FIELD_VOID, "Enable", InputTurnOn ), + DEFINE_INPUTFUNC( FIELD_VOID, "Disable", InputTurnOff ), + DEFINE_INPUTFUNC( FIELD_VOID, "Toggle", InputToggle ), + DEFINE_KEYFIELD( m_iDisabled, FIELD_INTEGER, "StartDisabled" ), + DEFINE_KEYFIELD( m_iSolidity, FIELD_INTEGER, "Solidity" ), + DEFINE_KEYFIELD( m_bSolidBsp, FIELD_BOOLEAN, "solidbsp" ), + DEFINE_KEYFIELD( m_iszExcludedClass, FIELD_STRING, "excludednpc" ), + DEFINE_KEYFIELD( m_bInvertExclusion, FIELD_BOOLEAN, "invert_exclusion" ), +*/ + +END_DATADESC() + + + +void CFuncBulletShield::Spawn( void ) +{ + BaseClass::Spawn(); + + AddSolidFlags( FSOLID_CUSTOMRAYTEST ); + AddSolidFlags( FSOLID_CUSTOMBOXTEST ); + // SetSolid(SOLID_CUSTOM); + + VPhysicsDestroyObject(); +} + +/* +bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta, + const matrix3x4_t &matOBBToWorld, const Vector &vecOBBMins, const Vector &vecOBBMaxs, + float flTolerance, CBaseTrace *pTrace ); + +bool IntersectRayWithOBB( const Vector &vecRayOrigin, const Vector &vecRayDelta, + const Vector &vecBoxOrigin, const QAngle &angBoxRotation, + const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace ); + +bool IntersectRayWithOBB( const Ray_t &ray, const Vector &vecBoxOrigin, const QAngle &angBoxRotation, + const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace ); + +bool IntersectRayWithOBB( const Ray_t &ray, const matrix3x4_t &matOBBToWorld, + const Vector &vecOBBMins, const Vector &vecOBBMaxs, float flTolerance, CBaseTrace *pTrace ); + +bool IntersectRayWithOBB( const Vector &vecRayStart, const Vector &vecRayDelta, + const matrix3x4_t &matOBBToWorld, const Vector &vecOBBMins, const Vector &vecOBBMaxs, + float flTolerance, BoxTraceInfo_t *pTrace ); + */ + +bool CFuncBulletShield::TestCollision( const Ray_t &ray, unsigned int mask, trace_t& trace ) +{ + // ignore unless a shot + if ((mask & MASK_SHOT) == MASK_SHOT) + { + // use obb collision + ICollideable *pCol = GetCollideable(); + Assert(pCol); + + return IntersectRayWithOBB(ray,pCol->GetCollisionOrigin(),pCol->GetCollisionAngles(), + pCol->OBBMins(),pCol->OBBMaxs(),1.0f,&trace); + + /* + const model_t *pModel = this->GetCollisionModel(); + if ( pModel && pModel->type == mod_brush ) + { + int nModelIndex = this->GetCollisionModelIndex(); + cmodel_t *pCModel = CM_InlineModelNumber( nModelIndex - 1 ); + int nHeadNode = pCModel->headnode; + + CM_TransformedBoxTrace( ray, nHeadNode, fMask, this->GetCollisionOrigin(), this->GetCollisionAngles(), *pTrace ); + return true; + } + return false; + */ + + // return BaseClass::TestCollision( ray, mask, trace ); + } + else + return false; +} |