2013-12-02 19:31:46 -08:00
|
|
|
//========= Copyright Valve Corporation, All rights reserved. ============//
|
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
//
|
|
|
|
// $NoKeywords: $
|
|
|
|
//=============================================================================//
|
|
|
|
#ifndef PROPS_H
|
|
|
|
#define PROPS_H
|
|
|
|
#ifdef _WIN32
|
|
|
|
#pragma once
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "props_shared.h"
|
|
|
|
#include "baseanimating.h"
|
|
|
|
#include "physics_bone_follower.h"
|
|
|
|
#include "player_pickup.h"
|
|
|
|
#include "positionwatcher.h"
|
|
|
|
|
|
|
|
//=============================================================================================================
|
|
|
|
// PROP TYPES
|
|
|
|
//=============================================================================================================
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CBaseProp : public CBaseAnimating
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( CBaseProp, CBaseAnimating );
|
|
|
|
public:
|
|
|
|
|
|
|
|
void Spawn( void );
|
|
|
|
void Precache( void );
|
|
|
|
void Activate( void );
|
|
|
|
bool KeyValue( const char *szKeyName, const char *szValue );
|
|
|
|
void CalculateBlockLOS( void );
|
|
|
|
int ParsePropData( void );
|
|
|
|
|
|
|
|
void DrawDebugGeometryOverlays( void );
|
|
|
|
|
|
|
|
// Don't treat as a live target
|
|
|
|
virtual bool IsAlive( void ) { return false; }
|
|
|
|
virtual bool OverridePropdata() { return true; }
|
2019-08-31 19:28:20 +00:00
|
|
|
|
|
|
|
#ifdef MAPBASE
|
|
|
|
// Attempt to replace a dynamic_cast
|
|
|
|
virtual bool IsPropPhysics() { return false; }
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CBreakableProp : public CBaseProp, public IBreakableWithPropData, public CDefaultPlayerPickupVPhysics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CBreakableProp();
|
|
|
|
|
|
|
|
DECLARE_CLASS( CBreakableProp, CBaseProp );
|
|
|
|
DECLARE_SERVERCLASS();
|
|
|
|
DECLARE_DATADESC();
|
|
|
|
|
|
|
|
virtual void Spawn();
|
|
|
|
virtual void Precache();
|
|
|
|
virtual float GetAutoAimRadius() { return 24.0f; }
|
|
|
|
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
virtual bool KeyValue( const char *szKeyName, const char *szValue );
|
|
|
|
#endif
|
|
|
|
|
2013-12-02 19:31:46 -08:00
|
|
|
void BreakablePropTouch( CBaseEntity *pOther );
|
|
|
|
|
|
|
|
virtual int OnTakeDamage( const CTakeDamageInfo &info );
|
|
|
|
void Event_Killed( const CTakeDamageInfo &info );
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
// Marks Break() as virtual
|
|
|
|
virtual
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
void Break( CBaseEntity *pBreaker, const CTakeDamageInfo &info );
|
|
|
|
void BreakThink( void );
|
|
|
|
void AnimateThink( void );
|
|
|
|
|
|
|
|
virtual void PlayPuntSound();
|
|
|
|
|
|
|
|
void InputBreak( inputdata_t &inputdata );
|
|
|
|
void InputAddHealth( inputdata_t &inputdata );
|
|
|
|
void InputRemoveHealth( inputdata_t &inputdata );
|
|
|
|
void InputSetHealth( inputdata_t &inputdata );
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
void InputSetInteraction( inputdata_t &inputdata );
|
|
|
|
void InputRemoveInteraction( inputdata_t &inputdata );
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
|
|
|
|
int GetNumBreakableChunks( void ) { return m_iNumBreakableChunks; }
|
|
|
|
|
|
|
|
virtual bool OverridePropdata() { return false; }
|
|
|
|
virtual IPhysicsObject *GetRootPhysicsObjectForBreak();
|
|
|
|
|
|
|
|
bool PropDataOverrodeBlockLOS( void ) { return m_bBlockLOSSetByPropData; }
|
|
|
|
bool PropDataOverrodeAIWalkable( void ) { return m_bIsWalkableSetByPropData; }
|
|
|
|
|
|
|
|
virtual bool HasPreferredCarryAnglesForPlayer( CBasePlayer *pPlayer )
|
|
|
|
{
|
|
|
|
if ( HasInteraction( PROPINTER_PHYSGUN_LAUNCH_SPIN_Z ) )
|
|
|
|
return true;
|
|
|
|
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
if ( m_bUsesCustomCarryAngles )
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
|
2013-12-02 19:31:46 -08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual QAngle PreferredCarryAngles( void ) { return m_preferredCarryAngles; }
|
|
|
|
|
|
|
|
virtual void Ignite( float flFlameLifetime, bool bNPCOnly, float flSize = 0.0f, bool bCalledByLevelDesigner = false );
|
|
|
|
|
|
|
|
// Specific interactions
|
|
|
|
void HandleFirstCollisionInteractions( int index, gamevcollisionevent_t *pEvent );
|
|
|
|
void HandleInteractionStick( int index, gamevcollisionevent_t *pEvent );
|
|
|
|
void StickAtPosition( const Vector &stickPosition, const Vector &savePosition, const QAngle &saveAngles );
|
Mapbase v2.0; bulk commit
- Added custom map compile tools (vbsp, vvis, vrad)
- Changed blink fix (shouldn't change anything in-game)
- Added auto-completion to ent_create, npc_create, and the main set of "npc_" debug commands
- Added ent_create_aimed, an ent_create equivalent of npc_create_aimed
- Made hunters start using the "vs. player" melee animation against smaller NPCs that look weird with the "stab" attack
- Added "explosion_sparks" convar, which fixes broken code for giving explosions sparks (disabled by default because of how different it looks)
- Made interaction code capable of being dispatched on any entity, not just combat characters
- Added npc_barnacle_ignite convar, which lets barnacles be ignited by flares
- Fixed certain NPCs getting out of the way for the player when they hate them
- Fixed auto-generated "speak" scene responses not using parameters that work on real VCDs
- Made "stop_on_nonidle" capable of being used in any mod, not just HL2 episodic mods
- Selectable color for ragdoll boogie/point_ragdollboogie
- Fixed PickupWeaponInstant not firing weapon pickup outputs
- Introduced inputs and keyvalues for "lerping" to math_counter_advanced
- Fixed ClearConsole on logic_console
- logic_convar should now detect client convars correctly
- New NormalizeAngles input on math_vector
- logic_modelinfo LookupActivity input
- math_generate fixed and expanded to be more like math_counter
- Added a WIP game logging system for playtesting maps
- Introduced logic_playerinfo, an entity that can read a player's name or ID
- Fixed some new filters not working with filter_multi
- Added radius pickup spawnflag to func_physbox
- Added "Preserve name" spawnflag to weapons
- Added cc_achievement_debug message for when an achievement doesn't exist
- Made npc_combine_s not speak while in logic_choreographed_scenes
- Fixed zombie torsos/legs/headcrabs not being serverside when zombie is forced to server ragdoll
- Expanded and cleaned up npc_zombie_custom
- Fixed func_commandredirects not cleaning up correctly and sometimes crashing the game
- Allowed player squad commands to go through +USE-held objects
- Added a bunch of I/O/KV to trigger_waterydeath for better configuration
- Changed save comment system to use the chapter title from world properties, and the ability to suppress the title popup that normally results from it
- Adjusted game_convar_mod for MP planning
- Removed the func_precipitation custom particle/splash code for now, as it was causing problems
- Fixed env_global_light not accepting lightcolor
- Added "Additional Buttons" to player_speedmod
- Added save comment to RPC
- Added env_projectedtexture attenuation
- Added scripted_sequence OnPreIdleSequence
- Added OnCrab to zombies
- Added skill_changed game event (may need further testing)
- Added a fix for viewmodels flipping under extreme FOV values
- Added code that allows mappers to change the skin on shotgunners without it usually flipping back randomly
- Fixed a very, very, very major shader performance issue
- New SetAbsOrigin/Angles inputs on all entities, analogous to SetLocalOrigin/Angles
- Code improvements for I/O involving angles
- logic_entity_position improvements/fixes, including a new OutAngles output that outputs the angles on position calls
- Alternate collision/player avoidance spawnflag obsoletion enforcement disabled
- Enable/DisableHazardLights inputs on the EP2 jalopy, equivalent to the keyvalue
- Miscellaneous shader formatting adjustments and fixes
- Fixed AlwaysDrawOff on env_projectedtexture not being a valid input
2019-12-14 04:20:02 +00:00
|
|
|
|
|
|
|
#ifdef MAPBASE
|
|
|
|
// Uses the new CBaseEntity interaction implementation
|
|
|
|
bool HandleInteraction( int interactionType, void *data, CBaseCombatCharacter* sourceEnt );
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
|
|
|
|
// Disable auto fading under dx7 or when level fades are specified
|
|
|
|
void DisableAutoFade();
|
|
|
|
|
|
|
|
public:
|
|
|
|
COutputEvent m_OnBreak;
|
|
|
|
COutputFloat m_OnHealthChanged;
|
|
|
|
COutputEvent m_OnTakeDamage;
|
|
|
|
|
|
|
|
float m_impactEnergyScale;
|
|
|
|
|
|
|
|
int m_iMinHealthDmg;
|
|
|
|
|
|
|
|
QAngle m_preferredCarryAngles;
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
// Indicates whether the prop is using the keyvalue carry angles.
|
|
|
|
bool m_bUsesCustomCarryAngles;
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
// IBreakableWithPropData
|
|
|
|
void SetDmgModBullet( float flDmgMod ) { m_flDmgModBullet = flDmgMod; }
|
|
|
|
void SetDmgModClub( float flDmgMod ) { m_flDmgModClub = flDmgMod; }
|
|
|
|
void SetDmgModExplosive( float flDmgMod ) { m_flDmgModExplosive = flDmgMod; }
|
|
|
|
float GetDmgModBullet( void ) { return m_flDmgModBullet; }
|
|
|
|
float GetDmgModClub( void ) { return m_flDmgModClub; }
|
|
|
|
float GetDmgModExplosive( void ) { return m_flDmgModExplosive; }
|
|
|
|
void SetExplosiveRadius( float flRadius ) { m_explodeRadius = flRadius; }
|
|
|
|
void SetExplosiveDamage( float flDamage ) { m_explodeDamage = flDamage; }
|
|
|
|
float GetExplosiveRadius( void ) { return m_explodeRadius; }
|
|
|
|
float GetExplosiveDamage( void ) { return m_explodeDamage; }
|
|
|
|
void SetPhysicsDamageTable( string_t iszTableName ) { m_iszPhysicsDamageTableName = iszTableName; }
|
|
|
|
string_t GetPhysicsDamageTable( void ) { return m_iszPhysicsDamageTableName; }
|
|
|
|
void SetBreakableModel( string_t iszModel ) { m_iszBreakableModel = iszModel; }
|
|
|
|
string_t GetBreakableModel( void ) { return m_iszBreakableModel; }
|
|
|
|
void SetBreakableSkin( int iSkin ) { m_iBreakableSkin = iSkin; }
|
|
|
|
int GetBreakableSkin( void ) { return m_iBreakableSkin; }
|
|
|
|
void SetBreakableCount( int iCount ) { m_iBreakableCount = iCount; }
|
|
|
|
int GetBreakableCount( void ) { return m_iBreakableCount; }
|
|
|
|
void SetMaxBreakableSize( int iSize ) { m_iMaxBreakableSize = iSize; }
|
|
|
|
int GetMaxBreakableSize( void ) { return m_iMaxBreakableSize; }
|
|
|
|
void SetPropDataBlocksLOS( bool bBlocksLOS ) { m_bBlockLOSSetByPropData = true; SetBlocksLOS( bBlocksLOS ); }
|
|
|
|
void SetPropDataIsAIWalkable( bool b ) { m_bIsWalkableSetByPropData = true; SetAIWalkable( b ); }
|
|
|
|
void SetBasePropData( string_t iszBase ) { m_iszBasePropData = iszBase; }
|
|
|
|
string_t GetBasePropData( void ) { return m_iszBasePropData; }
|
|
|
|
void SetInteraction( propdata_interactions_t Interaction ) { m_iInteractions |= (1 << Interaction); }
|
|
|
|
void RemoveInteraction( propdata_interactions_t Interaction ) { m_iInteractions &= ~(1 << Interaction); }
|
|
|
|
bool HasInteraction( propdata_interactions_t Interaction ) { return ( m_iInteractions & (1 << Interaction) ) != 0; }
|
|
|
|
void SetMultiplayerBreakMode( mp_break_t mode ) { m_mpBreakMode = mode; }
|
|
|
|
mp_break_t GetMultiplayerBreakMode( void ) const { return m_mpBreakMode; }
|
|
|
|
|
|
|
|
// derived by multiplayer phys props:
|
|
|
|
virtual void SetPhysicsMode(int iMode) {}
|
|
|
|
virtual int GetPhysicsMode() { return PHYSICS_MULTIPLAYER_SOLID; }
|
|
|
|
|
|
|
|
// Copy fade from another breakable prop
|
|
|
|
void CopyFadeFrom( CBreakableProp *pSource );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
bool UpdateHealth( int iNewHealth, CBaseEntity *pActivator );
|
|
|
|
virtual void OnBreak( const Vector &vecVelocity, const AngularImpulse &angVel, CBaseEntity *pBreaker ) {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
unsigned int m_createTick;
|
|
|
|
float m_flPressureDelay;
|
|
|
|
EHANDLE m_hBreaker;
|
|
|
|
|
|
|
|
PerformanceMode_t m_PerformanceMode;
|
|
|
|
|
|
|
|
// Prop data storage
|
|
|
|
float m_flDmgModBullet;
|
|
|
|
float m_flDmgModClub;
|
|
|
|
float m_flDmgModExplosive;
|
|
|
|
string_t m_iszPhysicsDamageTableName;
|
|
|
|
string_t m_iszBreakableModel;
|
|
|
|
int m_iBreakableSkin;
|
|
|
|
int m_iBreakableCount;
|
|
|
|
int m_iMaxBreakableSize;
|
|
|
|
string_t m_iszBasePropData;
|
|
|
|
int m_iInteractions;
|
|
|
|
float m_explodeDamage;
|
|
|
|
float m_explodeRadius;
|
|
|
|
string_t m_iszBreakModelMessage;
|
|
|
|
|
|
|
|
// Count of how many pieces we'll break into, custom or generic
|
|
|
|
int m_iNumBreakableChunks;
|
|
|
|
|
|
|
|
void SetEnableMotionPosition( const Vector &position, const QAngle &angles );
|
|
|
|
bool GetEnableMotionPosition( Vector *pPosition, QAngle *pAngles );
|
|
|
|
void ClearEnableMotionPosition();
|
|
|
|
private:
|
|
|
|
CBaseEntity *FindEnableMotionFixup();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool OnAttemptPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason );
|
|
|
|
virtual void OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason );
|
|
|
|
virtual void OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t reason );
|
|
|
|
virtual AngularImpulse PhysGunLaunchAngularImpulse();
|
|
|
|
virtual CBasePlayer *HasPhysicsAttacker( float dt );
|
|
|
|
|
|
|
|
#ifdef HL2_EPISODIC
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
virtual float GetFlareLifetime() { return 30.0f; }
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
void CreateFlare( float flLifetime );
|
|
|
|
#endif //HL2_EPISODIC
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetPhysicsAttacker( CBasePlayer *pEntity, float flTime );
|
|
|
|
void CheckRemoveRagdolls();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void InputEnablePhyscannonPickup( inputdata_t &inputdata );
|
|
|
|
void InputDisablePhyscannonPickup( inputdata_t &inputdata );
|
|
|
|
|
|
|
|
void InputEnablePuntSound( inputdata_t &inputdata ) { m_bUsePuntSound = true; }
|
|
|
|
void InputDisablePuntSound( inputdata_t &inputdata ) { m_bUsePuntSound = false; }
|
|
|
|
|
|
|
|
// Prevents fade scale from happening
|
|
|
|
void ForceFadeScaleToAlwaysVisible();
|
|
|
|
void RampToDefaultFadeScale();
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum PhysgunState_t
|
|
|
|
{
|
|
|
|
PHYSGUN_MUST_BE_DETACHED = 0,
|
|
|
|
PHYSGUN_IS_DETACHING,
|
|
|
|
PHYSGUN_CAN_BE_GRABBED,
|
|
|
|
PHYSGUN_ANIMATE_ON_PULL,
|
|
|
|
PHYSGUN_ANIMATE_IS_ANIMATING,
|
|
|
|
PHYSGUN_ANIMATE_FINISHED,
|
|
|
|
PHYSGUN_ANIMATE_IS_PRE_ANIMATING,
|
|
|
|
PHYSGUN_ANIMATE_IS_POST_ANIMATING,
|
|
|
|
};
|
|
|
|
|
|
|
|
CHandle<CBasePlayer> m_hPhysicsAttacker;
|
|
|
|
float m_flLastPhysicsInfluenceTime;
|
|
|
|
bool m_bBlockLOSSetByPropData;
|
|
|
|
bool m_bIsWalkableSetByPropData;
|
|
|
|
bool m_bOriginalBlockLOS; // BlockLOS state before physgun pickup
|
|
|
|
char m_nPhysgunState; // Ripped-off state
|
|
|
|
COutputEvent m_OnPhysCannonDetach; // We've ripped it off!
|
|
|
|
COutputEvent m_OnPhysCannonAnimatePreStarted; // Started playing the pre-pull animation
|
|
|
|
COutputEvent m_OnPhysCannonAnimatePullStarted; // Player started the pull anim
|
|
|
|
COutputEvent m_OnPhysCannonAnimatePostStarted; // Started playing the post-pull animation
|
|
|
|
COutputEvent m_OnPhysCannonPullAnimFinished; // We've had our pull anim finished, or the post-pull has finished if there is one
|
|
|
|
float m_flDefaultFadeScale; // Things may temporarily change the fade scale, but this is its steady-state condition
|
|
|
|
|
|
|
|
mp_break_t m_mpBreakMode;
|
|
|
|
|
|
|
|
EHANDLE m_hLastAttacker; // Last attacker that harmed me.
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
protected:
|
|
|
|
// Needs to be protected for prop_flare entity usage
|
|
|
|
EHANDLE m_hFlareEnt;
|
|
|
|
private:
|
|
|
|
#else
|
2013-12-02 19:31:46 -08:00
|
|
|
EHANDLE m_hFlareEnt;
|
2019-08-31 19:28:20 +00:00
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
string_t m_iszPuntSound;
|
|
|
|
bool m_bUsePuntSound;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Spawnflags
|
|
|
|
#define SF_DYNAMICPROP_USEHITBOX_FOR_RENDERBOX 64
|
|
|
|
#define SF_DYNAMICPROP_NO_VPHYSICS 128
|
|
|
|
#define SF_DYNAMICPROP_DISABLE_COLLISION 256
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CDynamicProp : public CBreakableProp, public IPositionWatcher
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( CDynamicProp, CBreakableProp );
|
|
|
|
|
|
|
|
public:
|
|
|
|
DECLARE_SERVERCLASS();
|
|
|
|
DECLARE_DATADESC();
|
|
|
|
|
|
|
|
CDynamicProp();
|
|
|
|
|
|
|
|
void Spawn( void );
|
|
|
|
bool CreateVPhysics( void );
|
|
|
|
void CreateBoneFollowers();
|
|
|
|
void UpdateOnRemove( void );
|
|
|
|
void AnimThink( void );
|
|
|
|
void PropSetSequence( int nSequence );
|
|
|
|
void OnRestore( void );
|
|
|
|
bool OverridePropdata( void );
|
|
|
|
void HandleAnimEvent( animevent_t *pEvent );
|
|
|
|
|
|
|
|
// baseentity - watch dynamic hierarchy updates
|
|
|
|
virtual void SetParent( CBaseEntity* pNewParent, int iAttachment = -1 );
|
|
|
|
bool TestCollision( const Ray_t &ray, unsigned int mask, trace_t& trace );
|
|
|
|
|
|
|
|
// breakable prop
|
|
|
|
virtual IPhysicsObject *GetRootPhysicsObjectForBreak();
|
|
|
|
|
|
|
|
// IPositionWatcher
|
|
|
|
virtual void NotifyPositionChanged( CBaseEntity *pEntity );
|
|
|
|
|
|
|
|
// Input handlers
|
|
|
|
void InputSetAnimation( inputdata_t &inputdata );
|
|
|
|
void InputSetDefaultAnimation( inputdata_t &inputdata );
|
|
|
|
void InputTurnOn( inputdata_t &inputdata );
|
|
|
|
void InputTurnOff( inputdata_t &inputdata );
|
|
|
|
void InputDisableCollision( inputdata_t &inputdata );
|
|
|
|
void InputEnableCollision( inputdata_t &inputdata );
|
|
|
|
void InputSetPlaybackRate( inputdata_t &inputdata );
|
|
|
|
|
|
|
|
COutputEvent m_pOutputAnimBegun;
|
|
|
|
COutputEvent m_pOutputAnimOver;
|
|
|
|
|
|
|
|
string_t m_iszDefaultAnim;
|
|
|
|
|
|
|
|
int m_iGoalSequence;
|
|
|
|
int m_iTransitionDirection;
|
|
|
|
|
|
|
|
// Random animations
|
|
|
|
bool m_bRandomAnimator;
|
|
|
|
float m_flNextRandAnim;
|
|
|
|
float m_flMinRandAnimTime;
|
|
|
|
float m_flMaxRandAnimTime;
|
|
|
|
short m_nPendingSequence;
|
|
|
|
|
|
|
|
bool m_bStartDisabled;
|
|
|
|
bool m_bDisableBoneFollowers;
|
|
|
|
|
|
|
|
CNetworkVar( bool, m_bUseHitboxesForRenderBox );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void FinishSetSequence( int nSequence );
|
|
|
|
void PropSetAnim( const char *szAnim );
|
|
|
|
void BoneFollowerHierarchyChanged();
|
|
|
|
|
|
|
|
// Contained Bone Follower manager
|
|
|
|
CBoneFollowerManager m_BoneFollowerManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class CPhysicsProp : public CBreakableProp
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( CPhysicsProp, CBreakableProp );
|
|
|
|
DECLARE_SERVERCLASS();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~CPhysicsProp();
|
|
|
|
CPhysicsProp( void )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Spawn( void );
|
|
|
|
void Precache();
|
|
|
|
bool CreateVPhysics( void );
|
|
|
|
bool OverridePropdata( void );
|
|
|
|
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
// Attempt to replace a dynamic_cast
|
|
|
|
virtual bool IsPropPhysics() { return true; }
|
|
|
|
#endif
|
|
|
|
|
2013-12-02 19:31:46 -08:00
|
|
|
virtual void VPhysicsUpdate( IPhysicsObject *pPhysics );
|
|
|
|
virtual void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent );
|
|
|
|
|
|
|
|
void InputWake( inputdata_t &inputdata );
|
|
|
|
void InputSleep( inputdata_t &inputdata );
|
|
|
|
void InputEnableMotion( inputdata_t &inputdata );
|
|
|
|
void InputDisableMotion( inputdata_t &inputdata );
|
|
|
|
void InputDisableFloating( inputdata_t &inputdata );
|
2019-08-31 19:28:20 +00:00
|
|
|
#ifdef MAPBASE
|
|
|
|
void InputSetDebris( inputdata_t &inputdata );
|
|
|
|
#endif
|
2013-12-02 19:31:46 -08:00
|
|
|
|
|
|
|
void EnableMotion( void );
|
|
|
|
bool CanBePickedUpByPhyscannon( void );
|
|
|
|
void OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason );
|
|
|
|
void OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t reason );
|
|
|
|
|
|
|
|
bool GetPropDataAngles( const char *pKeyName, QAngle &vecAngles );
|
|
|
|
float GetCarryDistanceOffset( void );
|
|
|
|
|
|
|
|
int ObjectCaps();
|
|
|
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
|
|
|
|
|
|
|
void GetMassCenter( Vector *pMassCenter );
|
|
|
|
float GetMass() const;
|
|
|
|
|
|
|
|
void ClearFlagsThink( void );
|
|
|
|
|
|
|
|
virtual int OnTakeDamage( const CTakeDamageInfo &info );
|
|
|
|
int DrawDebugTextOverlays(void);
|
|
|
|
bool IsGib();
|
|
|
|
DECLARE_DATADESC();
|
|
|
|
|
|
|
|
// Specific interactions
|
|
|
|
void HandleAnyCollisionInteractions( int index, gamevcollisionevent_t *pEvent );
|
|
|
|
|
|
|
|
string_t GetPhysOverrideScript( void ) { return m_iszOverrideScript; }
|
|
|
|
float GetMassScale( void ) { return m_massScale; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Compute impulse to apply to the enabled entity.
|
|
|
|
void ComputeEnablingImpulse( int index, gamevcollisionevent_t *pEvent );
|
|
|
|
|
|
|
|
COutputEvent m_MotionEnabled;
|
|
|
|
COutputEvent m_OnAwakened;
|
|
|
|
COutputEvent m_OnPhysGunPickup;
|
|
|
|
COutputEvent m_OnPhysGunPunt;
|
|
|
|
COutputEvent m_OnPhysGunOnlyPickup;
|
|
|
|
COutputEvent m_OnPhysGunDrop;
|
|
|
|
COutputEvent m_OnPlayerUse;
|
|
|
|
COutputEvent m_OnPlayerPickup;
|
|
|
|
COutputEvent m_OnOutOfWorld;
|
|
|
|
|
|
|
|
float m_massScale;
|
|
|
|
float m_inertiaScale;
|
|
|
|
int m_damageType;
|
|
|
|
string_t m_iszOverrideScript;
|
|
|
|
int m_damageToEnableMotion;
|
|
|
|
float m_flForceToEnableMotion;
|
|
|
|
|
|
|
|
bool m_bThrownByPlayer;
|
|
|
|
bool m_bFirstCollisionAfterLaunch;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CNetworkVar( bool, m_bAwake );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// An interface so that objects parented to props can receive collision interaction events.
|
|
|
|
enum parentCollisionInteraction_t
|
|
|
|
{
|
|
|
|
COLLISIONINTER_PARENT_FIRST_IMPACT = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
abstract_class IParentPropInteraction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void OnParentCollisionInteraction( parentCollisionInteraction_t eType, int index, gamevcollisionevent_t *pEvent ) = 0;
|
|
|
|
virtual void OnParentPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason ) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Used by prop_physics_create and the server benchmark.
|
|
|
|
// pModelName should not include the "models/" prefix.
|
|
|
|
CPhysicsProp* CreatePhysicsProp( const char *pModelName, const Vector &vTraceStart, const Vector &vTraceEnd, const IHandleEntity *pTraceIgnore, bool bRequireVCollide, const char *pClassName="physics_prop" );
|
|
|
|
|
|
|
|
bool UTIL_CreateScaledPhysObject( CBaseAnimating *pInstance, float flScale );
|
|
|
|
|
|
|
|
float GetBreakableDamage( const CTakeDamageInfo &inputInfo, IBreakableWithPropData *pProp = NULL );
|
|
|
|
int PropBreakablePrecacheAll( string_t modelName );
|
|
|
|
|
|
|
|
extern ConVar func_breakdmg_bullet;
|
|
|
|
extern ConVar func_breakdmg_club;
|
|
|
|
extern ConVar func_breakdmg_explosive;
|
|
|
|
|
|
|
|
#endif // PROPS_H
|