diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/server/AI_Interest_Target.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/server/AI_Interest_Target.h')
| -rw-r--r-- | sp/src/game/server/AI_Interest_Target.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/sp/src/game/server/AI_Interest_Target.h b/sp/src/game/server/AI_Interest_Target.h new file mode 100644 index 00000000..420f51c4 --- /dev/null +++ b/sp/src/game/server/AI_Interest_Target.h @@ -0,0 +1,88 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Hooks and classes for the support of humanoid NPCs with
+// groovy facial animation capabilities, aka, "Actors"
+//
+//=============================================================================//
+
+#ifndef AI_INTEREST_TARGET_H
+#define AI_INTEREST_TARGET_H
+
+#if defined( _WIN32 )
+#pragma once
+#endif
+
+
+//-----------------------------------------------------------------------------
+// CAI_BaseActor
+//
+// Purpose: The base class for all facially expressive NPCS.
+//
+//-----------------------------------------------------------------------------
+
+class CAI_InterestTarget_t
+{
+public:
+ enum CAI_InterestTarget_e
+ {
+ LOOKAT_ENTITY = 0,
+ LOOKAT_POSITION,
+ LOOKAT_BOTH
+ };
+
+public:
+ bool IsThis( CBaseEntity *pThis );
+ const Vector &GetPosition( void );
+ bool IsActive( void );
+ float Interest( void );
+
+public:
+ CAI_InterestTarget_e m_eType; // ????
+
+ EHANDLE m_hTarget;
+ Vector m_vecPosition;
+ float m_flStartTime;
+ float m_flEndTime;
+ float m_flRamp;
+ float m_flInterest;
+
+ DECLARE_SIMPLE_DATADESC();
+};
+
+
+class CAI_InterestTarget : public CUtlVector<CAI_InterestTarget_t>
+{
+public:
+ void Add( CBaseEntity *pTarget, float flImportance, float flDuration, float flRamp );
+ void Add( const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
+ void Add( CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
+ int Find( CBaseEntity *pTarget )
+ {
+ int i;
+ for ( i = 0; i < Count(); i++)
+ {
+ if (pTarget == (*this)[i].m_hTarget)
+ return i;
+ }
+ return InvalidIndex();
+ }
+
+ void Cleanup( void )
+ {
+ int i;
+ for (i = Count() - 1; i >= 0; i--)
+ {
+ if (!Element(i).IsActive())
+ {
+ Remove( i );
+ }
+ }
+ };
+
+private:
+ void Add( CAI_InterestTarget_t::CAI_InterestTarget_e type, CBaseEntity *pTarget, const Vector &vecPosition, float flImportance, float flDuration, float flRamp );
+};
+
+
+//-----------------------------------------------------------------------------
+#endif // AI_INTEREST_TARGET_H
|