diff --git a/public/cmodel.h b/public/cmodel.h index 4524a588..b86a4423 100644 --- a/public/cmodel.h +++ b/public/cmodel.h @@ -57,17 +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 - void *padding; + 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,9 +76,8 @@ struct Ray_t m_IsSwept = (m_Delta.LengthSqr() != 0); - padding = NULL; - VectorClear( m_Extents ); + m_pWorldAxisTransform = NULL; m_IsRay = true; // Offset m_Start to be in the center of the box... @@ -90,8 +90,7 @@ struct Ray_t Assert( &end ); VectorSubtract( end, start, m_Delta ); - padding = NULL; - + m_pWorldAxisTransform = NULL; m_IsSwept = (m_Delta.LengthSqr() != 0); VectorSubtract( maxs, mins, m_Extents ); diff --git a/public/datamap.h b/public/datamap.h index 3604d1ed..7971d3b7 100644 --- a/public/datamap.h +++ b/public/datamap.h @@ -64,6 +64,8 @@ typedef enum _fieldtypes FIELD_MATERIALINDEX, // a material index (using the material precache string table) FIELD_VECTOR2D, // 2 floats + FIELD_INTEGER64, // 64bit integer + FIELD_TYPECOUNT, // MUST BE LAST } fieldtype_t; @@ -98,6 +100,7 @@ DECLARE_FIELD_SIZE( FIELD_VECTOR, 3 * sizeof(float) ) DECLARE_FIELD_SIZE( FIELD_VECTOR2D, 2 * sizeof(float) ) DECLARE_FIELD_SIZE( FIELD_QUATERNION, 4 * sizeof(float)) DECLARE_FIELD_SIZE( FIELD_INTEGER, sizeof(int)) +DECLARE_FIELD_SIZE( FIELD_INTEGER64, sizeof(int64)) DECLARE_FIELD_SIZE( FIELD_BOOLEAN, sizeof(char)) DECLARE_FIELD_SIZE( FIELD_SHORT, sizeof(short)) DECLARE_FIELD_SIZE( FIELD_CHARACTER, sizeof(char)) @@ -165,6 +168,7 @@ DECLARE_FIELD_SIZE( FIELD_MATERIALINDEX, sizeof(int) ) #ifndef NO_ENTITY_PREDICTION +// FTYPEDESC_KEY tells the prediction copy system to report the full nameof the field when reporting errors #define DEFINE_PRED_TYPEDESCRIPTION( name, fieldtype ) \ { FIELD_EMBEDDED, #name, { offsetof(classNameTypedef, name), 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, &fieldtype::m_PredMap } @@ -247,7 +251,7 @@ struct typedescription_t; enum { TD_OFFSET_NORMAL = 0, -// TD_OFFSET_PACKED = 1, + TD_OFFSET_PACKED = 1, // Must be last TD_OFFSET_COUNT, @@ -257,7 +261,7 @@ struct typedescription_t { fieldtype_t fieldType; const char *fieldName; - int fieldOffset[ TD_OFFSET_COUNT ]; // 0 == normal, 1 == packed offset + int fieldOffset; // Local offset value unsigned short fieldSize; short flags; // the name of the variable in the map/fgd data, or the name of the action @@ -280,8 +284,10 @@ struct typedescription_t // Tolerance for field errors for float fields float fieldTolerance; - - int unknown[3]; + + // For raw fields (including children of embedded stuff) this is the flattened offset + int flatOffset[ TD_OFFSET_COUNT ]; + unsigned short flatGroup; }; diff --git a/public/dt_common.h b/public/dt_common.h index bcd5f750..37bca567 100644 --- a/public/dt_common.h +++ b/public/dt_common.h @@ -103,7 +103,7 @@ typedef enum DPT_Int=0, DPT_Float, DPT_Vector, - DPT_VectorXY, + DPT_VectorXY, // Only encodes the XY of a vector, ignores Z DPT_String, DPT_Array, // An array of the base types (can't be of datatables). DPT_DataTable, @@ -117,50 +117,54 @@ typedef enum class DVariant { public: - DVariant() {m_Type = DPT_Float;} - DVariant(float val) {m_Type = DPT_Float; m_Float = val;} + DVariant() {m_Type = DPT_Float;} + DVariant(float val) {m_Type = DPT_Float; m_Float = val;} - const char *ToString() - { - static char text[128]; + const char *ToString() + { + static char text[128]; - switch ( m_Type ) - { - case DPT_Int : - Q_snprintf( text, sizeof(text), "%i", m_Int ); - break; - case DPT_Float : - Q_snprintf( text, sizeof(text), "%.3f", m_Float ); - break; - case DPT_Vector : - Q_snprintf( text, sizeof(text), "(%.3f,%.3f,%.3f)", - m_Vector[0], m_Vector[1], m_Vector[2] ); - break; + switch ( m_Type ) + { + case DPT_Int : + Q_snprintf( text, sizeof(text), "%i", m_Int ); + break; + case DPT_Float : + Q_snprintf( text, sizeof(text), "%.3f", m_Float ); + break; + case DPT_Vector : + Q_snprintf( text, sizeof(text), "(%.3f,%.3f,%.3f)", + m_Vector[0], m_Vector[1], m_Vector[2] ); + break; + case DPT_VectorXY : + Q_snprintf( text, sizeof(text), "(%.3f,%.3f)", + m_Vector[0], m_Vector[1] ); + break; #if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!! - case DPT_Quaternion : - Q_snprintf( text, sizeof(text), "(%.3f,%.3f,%.3f %.3f)", - m_Vector[0], m_Vector[1], m_Vector[2], m_Vector[3] ); - break; + case DPT_Quaternion : + Q_snprintf( text, sizeof(text), "(%.3f,%.3f,%.3f %.3f)", + m_Vector[0], m_Vector[1], m_Vector[2], m_Vector[3] ); + break; #endif - case DPT_String : - if ( m_pString ) - return m_pString; - else - return "NULL"; - break; - case DPT_Array : - Q_snprintf( text, sizeof(text), "Array" ); - break; - case DPT_DataTable : - Q_snprintf( text, sizeof(text), "DataTable" ); - break; - default : - Q_snprintf( text, sizeof(text), "DVariant type %i unknown", m_Type ); - break; - } + case DPT_String : + if ( m_pString ) + return m_pString; + else + return "NULL"; + break; + case DPT_Array : + Q_snprintf( text, sizeof(text), "Array" ); + break; + case DPT_DataTable : + Q_snprintf( text, sizeof(text), "DataTable" ); + break; + default : + Q_snprintf( text, sizeof(text), "DVariant type %i unknown", m_Type ); + break; + } - return text; - } + return text; + } union { diff --git a/public/dt_send.h b/public/dt_send.h index 24c7fb2f..e96372fc 100644 --- a/public/dt_send.h +++ b/public/dt_send.h @@ -202,7 +202,7 @@ public: // If it's one of the numbered "000", "001", etc properties in an array, then // these can be used to get its array property name for debugging. - const char* GetParentArrayPropName(); + const char* GetParentArrayPropName() const; void SetParentArrayPropName( const char *pArrayPropName ); const char* GetName() const; @@ -249,18 +249,15 @@ public: float m_fLowValue; float m_fHighValue; - SendProp *m_pArrayProp; // If this is an array, this is the property that defines each array element. + SendProp *m_pArrayProp; // If this is an array, this is the property that defines each array element. ArrayLengthSendProxyFn m_ArrayLengthProxy; // This callback returns the array length. - int m_nElements; // Number of elements in the array (or 1 if it's not an array). - int m_ElementStride; // Pointer distance between array elements. + int m_nElements; // Number of elements in the array (or 1 if it's not an array). + int m_ElementStride; // Pointer distance between array elements. + + const char *m_pExcludeDTName; // If this is an exclude prop, then this is the name of the datatable to exclude a prop from. + const char *m_pParentArrayPropName; - union - { - const char *m_pExcludeDTName; // If this is an exclude prop, then this is the name of the datatable to exclude a prop from. - const char *m_pParentArrayPropName; - }; - int m_Unknown; const char *m_pVarName; float m_fHighLowMul; @@ -329,7 +326,7 @@ inline char const* SendProp::GetExcludeDTName() const return m_pExcludeDTName; } -inline const char* SendProp::GetParentArrayPropName() +inline const char* SendProp::GetParentArrayPropName() const { return m_pParentArrayPropName; } @@ -614,6 +611,7 @@ void SendProxy_QAngles ( const SendProp *pProp, const void *pStruct, const voi void SendProxy_AngleToFloat ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); void SendProxy_FloatToFloat ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); void SendProxy_VectorToVector ( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); +void SendProxy_VectorXYToVectorXY( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); #if 0 // We can't ship this since it changes the size of DTVariant to be 20 bytes instead of 16 and that breaks MODs!!! void SendProxy_QuaternionToQuaternion( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); #endif @@ -657,6 +655,16 @@ SendProp SendPropVector( float fHighValue=HIGH_DEFAULT, // High value. If HIGH_DEFAULT, it's (1<& playerbits ) = 0; - - // Begin a message from a server side entity to its client side counterpart (func_breakable glass, e.g.) - virtual bf_write *EntityMessageBegin( int ent_index, ServerClass * ent_class, bool reliable ) = 0; - // Begin a usermessage from the server to the client .dll - virtual bf_write *UserMessageBegin( IRecipientFilter *filter, int msg_type ) = 0; - // Finish the Entity or UserMessage and dispatch to network layer - virtual void MessageEnd( void ) = 0; - - // Print szMsg to the client console. - virtual void ClientPrintf( edict_t *pEdict, const char *szMsg ) = 0; - - // SINGLE PLAYER/LISTEN SERVER ONLY (just matching the client .dll api for this) - // Prints the formatted string to the notification area of the screen ( down the right hand edge - // numbered lines starting at position 0 - virtual void Con_NPrintf( int pos, const char *fmt, ... ) = 0; - // SINGLE PLAYER/LISTEN SERVER ONLY(just matching the client .dll api for this) - // Similar to Con_NPrintf, but allows specifying custom text color and duration information - virtual void Con_NXPrintf( const struct con_nprint_s *info, const char *fmt, ... ) = 0; - - // For ConCommand parsing or parsing client commands issued by players typing at their console - // Retrieves the raw command string (untokenized) - virtual const char *Cmd_Args( void ) = 0; - // Returns the number of tokens in the command string - virtual int Cmd_Argc( void ) = 0; - // Retrieves a specified token - virtual char *Cmd_Argv( int argc ) = 0; - - // Change a specified player's "view entity" (i.e., use the view entity position/orientation for rendering the client view) - virtual void SetView( const edict_t *pClient, const edict_t *pViewent ) = 0; - - // Get a high precision timer for doing profiling work - virtual float Time( void ) = 0; - - // Set the player's crosshair angle - virtual void CrosshairAngle( const edict_t *pClient, float pitch, float yaw ) = 0; - - // Get the current game directory (hl2, tf2, hl1, cstrike, etc.) - virtual void GetGameDir( char *szGetGameDir, int maxlength ) = 0; - - // Used by AI node graph code to determine if .bsp and .ain files are out of date - virtual int CompareFileTime( const char *filename1, const char *filename2, int *iCompare ) = 0; - - // Locks/unlocks the network string tables (.e.g, when adding bots to server, this needs to happen). - // Be sure to reset the lock after executing your code!!! - virtual bool LockNetworkStringTables( bool lock ) = 0; - - // Create a bot with the given name. Returns NULL if fake client can't be created - virtual edict_t *CreateFakeClient( const char *netname ) = 0; - - // Get a convar keyvalue for s specified client - virtual const char *GetClientConVarValue( int clientIndex, const char *name ) = 0; - - // Parse a token from a file - virtual const char *ParseFile( const char *data, char *token, int maxlen ) = 0; - // Copies a file - virtual bool CopyFile( const char *source, const char *destination ) = 0; - - // Reset the pvs, pvssize is the size in bytes of the buffer pointed to by pvs. - // This should be called right before any calls to AddOriginToPVS - virtual void ResetPVS( byte *pvs, int pvssize ) = 0; - // Merge the pvs bits into the current accumulated pvs based on the specified origin ( not that each pvs origin has an 8 world unit fudge factor ) - virtual void AddOriginToPVS( const Vector &origin ) = 0; - // Mark a specified area portal as open/closes - virtual void SetAreaPortalState( int portalNumber, int isOpen ) = 0; - // Queue a temp entity for transmission - virtual void PlaybackTempEntity( IRecipientFilter& filter, float delay, const void *pSender, const SendTable *pST, int classID ) = 0; - // Given a node number and the specified PVS, return with the node is in the PVS - virtual int CheckHeadnodeVisible( int nodenum, const byte *pvs, int vissize ) = 0; - // Using area bits, cheeck whether area1 flows into area2 and vice versa (depends on area portal state) - virtual int CheckAreasConnected( int area1, int area2 ) = 0; - // Given an origin, determine which area index the origin is within - virtual int GetArea( const Vector &origin ) = 0; - // Get area portal bit set - virtual void GetAreaBits( int area, unsigned char *bits, int buflen ) = 0; - // Given a view origin (which tells us the area to start looking in) and a portal key, - // fill in the plane that leads out of this area (it points into whatever area it leads to). - virtual bool GetAreaPortalPlane( Vector const &vViewOrigin, int portalKey, VPlane *pPlane ) = 0; - - // Apply a modification to the terrain. - virtual void ApplyTerrainMod( TerrainModType type, CTerrainModParams const ¶ms ) = 0; - - // Save/restore wrapper - FIXME: At some point we should move this to it's own interface - virtual bool LoadGameState( char const *pMapName, bool createPlayers ) = 0; - virtual void LoadAdjacentEnts( const char *pOldLevel, const char *pLandmarkName ) = 0; - virtual void ClearSaveDir() = 0; - - // Get the pristine map entity lump string. (e.g., used by CS to reload the map entities when restarting a round.) - virtual const char* GetMapEntitiesString() = 0; - - // Text message system -- lookup the text message of the specified name - virtual client_textmessage_t *TextMessageGet( const char *pName ) = 0; - - // Print a message to the server log file - virtual void LogPrint( const char *msg ) = 0; - - // Builds PVS information for an entity - virtual void BuildEntityClusterList( edict_t *pEdict, PVSInfo_t *pPVSInfo ) = 0; - - // A solid entity moved, update spatial partition - virtual void SolidMoved( edict_t *pSolidEnt, ICollideable *pSolidCollide, const Vector* pPrevAbsOrigin ) = 0; - // A trigger entity moved, update spatial partition - virtual void TriggerMoved( edict_t *pTriggerEnt ) = 0; - - // Create/destroy a custom spatial partition - virtual ISpatialPartition *CreateSpatialPartition( const Vector& worldmin, const Vector& worldmax ) = 0; - virtual void DestroySpatialPartition( ISpatialPartition * ) = 0; - - // Draw the brush geometry in the map into the scratch pad. - // Flags is currently unused. - virtual void DrawMapToScratchPad( IScratchPad3D *pPad, unsigned long iFlags ) = 0; - - // This returns which entities, to the best of the server's knowledge, the client currently knows about. - // This is really which entities were in the snapshot that this client last acked. - // This returns a bit vector with one bit for each entity. - // - // USE WITH CARE. Whatever tick the client is really currently on is subject to timing and - // ordering differences, so you should account for about a quarter-second discrepancy in here. - // Also, this will return NULL if the client doesn't exist or if this client hasn't acked any frames yet. - // - // iClientIndex is the CLIENT index, so if you use pPlayer->entindex(), subtract 1. - virtual const CBitVec* GetEntityTransmitBitsForClient( int iClientIndex ) = 0; - - // Is the game paused? - virtual bool IsPaused() = 0; - - // Marks the filename for consistency checking. This should be called after precaching the file. - virtual void ForceExactFile( const char *s ) = 0; - virtual void ForceModelBounds( const char *s, const Vector &mins, const Vector &maxs ) = 0; - virtual void ClearSaveDirAfterClientLoad() = 0; - - // Sets a USERINFO client ConVar for a fakeclient - virtual void SetFakeClientConVarValue( edict_t *pEntity, const char *cvar, const char *value ) = 0; - - virtual void InsertServerCommand( const char *str ) = 0; - - // Marks the material (vmt file) for consistency checking. If the client and server have different - // contents for the file, the client's vmt can only use the VertexLitGeneric shader, and can only - // contain $baseTexture and $bumpmap vars. - virtual void ForceSimpleMaterial( const char *s ) = 0; - - - // Is the engine in Commentary mode? - virtual int IsInCommentaryMode( void ) = 0; -}; - -} // end namespace - - -//----------------------------------------------------------------------------- -// Purpose: These are the interfaces that the game .dll exposes to the engine -//----------------------------------------------------------------------------- -#define SERVERGAMEDLL_INTERFACEVERSION_3 "ServerGameDLL003" - -namespace ServerGameDLLV3 -{ - -abstract_class IServerGameDLL -{ -public: - // Initialize the game (one-time call when the DLL is first loaded ) - // Return false if there is an error during startup. - virtual bool DLLInit( CreateInterfaceFn engineFactory, - CreateInterfaceFn physicsFactory, - CreateInterfaceFn fileSystemFactory, - CGlobalVars *pGlobals) = 0; - - // This is called when a new game is started. (restart, map) - virtual bool GameInit( void ) = 0; - - // Called any time a new level is started (after GameInit() also on level transitions within a game) - virtual bool LevelInit( char const *pMapName, - char const *pMapEntities, char const *pOldLevel, - char const *pLandmarkName, bool loadGame, bool background ) = 0; - - // The server is about to activate - virtual void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) = 0; - - // The server should run physics/think on all edicts - virtual void GameFrame( bool simulating ) = 0; - - // Called once per simulation frame on the final tick - virtual void PreClientUpdate( bool simulating ) = 0; - - // Called when a level is shutdown (including changing levels) - virtual void LevelShutdown( void ) = 0; - // This is called when a game ends (server disconnect, death, restart, load) - // NOT on level transitions within a game - virtual void GameShutdown( void ) = 0; - - // Called once during DLL shutdown - virtual void DLLShutdown( void ) = 0; - - // Get the simulation interval (must be compiled with identical values into both client and game .dll for MOD!!!) - // Right now this is only requested at server startup time so it can't be changed on the fly, etc. - virtual float GetTickInterval( void ) const = 0; - - // Give the list of datatable classes to the engine. The engine matches class names from here with - // edict_t::classname to figure out how to encode a class's data for networking - virtual ServerClass* GetAllServerClasses( void ) = 0; - - // Returns string describing current .dll. e.g., TeamFortress 2, Half-Life 2. - // Hey, it's more descriptive than just the name of the game directory - virtual const char *GetGameDescription( void ) = 0; - - // Let the game .dll allocate it's own network/shared string tables - virtual void CreateNetworkStringTables( void ) = 0; - - // Save/restore system hooks - virtual CSaveRestoreData *SaveInit( int size ) = 0; - virtual void SaveWriteFields( CSaveRestoreData *, const char *, void *, datamap_t *, typedescription_t *, int ) = 0; - virtual void SaveReadFields( CSaveRestoreData *, const char *, void *, datamap_t *, typedescription_t *, int ) = 0; - virtual void SaveGlobalState( CSaveRestoreData * ) = 0; - virtual void RestoreGlobalState( CSaveRestoreData * ) = 0; - virtual void PreSave( CSaveRestoreData * ) = 0; - virtual void Save( CSaveRestoreData * ) = 0; - virtual void GetSaveComment( char *comment, int maxlength ) = 0; - virtual void WriteSaveHeaders( CSaveRestoreData * ) = 0; - virtual void ReadRestoreHeaders( CSaveRestoreData * ) = 0; - virtual void Restore( CSaveRestoreData *, bool ) = 0; - virtual bool IsRestoring() = 0; - - // Returns the number of entities moved across the transition - virtual int CreateEntityTransitionList( CSaveRestoreData *, int ) = 0; - // Build the list of maps adjacent to the current map - virtual void BuildAdjacentMapList( void ) = 0; - - // Retrieve info needed for parsing the specified user message - virtual bool GetUserMessageInfo( int msg_type, char *name, int maxnamelength, int& size ) = 0; - - // Hand over the StandardSendProxies in the game DLL's module. - virtual CStandardSendProxiesV1* GetStandardSendProxies() = 0; -}; - -} // end namespace - - -//----------------------------------------------------------------------------- -// Just an interface version name for the random number interface -// See vstdlib/random.h for the interface definition -// NOTE: If you change this, also change VENGINE_CLIENT_RANDOM_INTERFACE_VERSION in cdll_int.h -//----------------------------------------------------------------------------- -#define VENGINE_SERVER_RANDOM_INTERFACE_VERSION_1 "VEngineRandom001" - -//----------------------------------------------------------------------------- -// Purpose: Interface to get at server entities -//----------------------------------------------------------------------------- -#define SERVERGAMEENTS_INTERFACEVERSION_1 "ServerGameEnts001" - -namespace ServerGameEntsV1 -{ - -abstract_class IServerGameEnts -{ -public: - virtual ~IServerGameEnts() {} - - // Only for debugging. Set the edict base so you can get an edict's index in the debugger while debugging the game .dll - virtual void SetDebugEdictBase(edict_t *base) = 0; - - // The engine wants to mark two entities as touching - virtual void MarkEntitiesAsTouching( edict_t *e1, edict_t *e2 ) = 0; - - // Frees the entity attached to this edict - virtual void FreeContainingEntity( edict_t * ) = 0; - - // This allows the engine to get at edicts in a CGameTrace. - virtual edict_t* BaseEntityToEdict( CBaseEntity *pEnt ) = 0; - virtual CBaseEntity* EdictToBaseEntity( edict_t *pEdict ) = 0; - - // This sets a bit in pInfo for each edict in the list that wants to be transmitted to the - // client specified in pInfo. - // - // This is also where an entity can force other entities to be transmitted if it refers to them - // with ehandles. - virtual void CheckTransmit( CCheckTransmitInfo *pInfo, const unsigned short *pEdictIndices, int nEdicts ) = 0; -}; - -} // end namespace ServerGameEntsV1 - - -//----------------------------------------------------------------------------- -// Purpose: Player / Client related functions -//----------------------------------------------------------------------------- -#define SERVERGAMECLIENTS_INTERFACEVERSION_3 "ServerGameClients003" - -namespace ServerGameClientsV3 -{ - -abstract_class IServerGameClients -{ -public: - // Get server maxplayers and lower bound for same - virtual void GetPlayerLimits( int& minplayers, int& maxplayers, int &defaultMaxPlayers ) const = 0; - - // Client is connecting to server ( return false to reject the connection ) - // You can specify a rejection message by writing it into reject - virtual bool ClientConnect( edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen ) = 0; - - // Client is going active - // If bLoadGame is true, don't spawn the player because its state is already setup. - virtual void ClientActive( edict_t *pEntity, bool bLoadGame ) = 0; - - // Client is disconnecting from server - virtual void ClientDisconnect( edict_t *pEntity ) = 0; - - // Client is connected and should be put in the game - virtual void ClientPutInServer( edict_t *pEntity, char const *playername ) = 0; - - // The client has typed a command at the console - virtual void ClientCommand( edict_t *pEntity ) = 0; - - // Sets the client index for the client who typed the command into his/her console - virtual void SetCommandClient( int index ) = 0; - - // A player changed one/several replicated cvars (name etc) - virtual void ClientSettingsChanged( edict_t *pEdict ) = 0; - - // Determine PVS origin and set PVS for the player/viewentity - virtual void ClientSetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char *pvs, int pvssize ) = 0; - - // A block of CUserCmds has arrived from the user, decode them and buffer for execution during player simulation - virtual float ProcessUsercmds( edict_t *player, bf_read *buf, int numcmds, int totalcmds, - int dropped_packets, bool ignore, bool paused ) = 0; - - // Let the game .dll do stuff after messages have been sent to all of the clients once the server frame is complete - virtual void PostClientMessagesSent( void ) = 0; - - // For players, looks up the CPlayerState structure corresponding to the player - virtual CPlayerState *GetPlayerState( edict_t *player ) = 0; - - // Get the ear position for a specified client - virtual void ClientEarPosition( edict_t *pEntity, Vector *pEarOrigin ) = 0; - - // returns number of delay ticks if player is in Replay mode (0 = no delay) - virtual int GetReplayDelay( edict_t *player ) = 0; - - // Anything this game .dll wants to add to the bug reporter text (e.g., the entity/model under the picker crosshair) - // can be added here - virtual void GetBugReportInfo( char *buf, int buflen ) = 0; -}; - -} // end namespace ServerGameClientsV3 - - -#define UPLOADGAMESTATS_INTERFACEVERSION_1 "ServerUploadGameStats001" - -namespace UploadGameStatsV1 -{ - -abstract_class IUploadGameStats -{ -public: - // Note that this call will block the server until the upload is completed, so use only at levelshutdown if at all. - virtual bool UploadGameStats( - char const *mapname, // Game map name - unsigned int blobversion, // Version of the binary blob data - unsigned int blobsize, // Size in bytes of blob data - const void *pvBlobData ) = 0; // Pointer to the blob data. -}; - -} // end namespace UploadGameStatsV1 - - -#endif // EIFACEV21_H diff --git a/public/engine/IEngineSound.h b/public/engine/IEngineSound.h index 07380b6f..460fcc6d 100644 --- a/public/engine/IEngineSound.h +++ b/public/engine/IEngineSound.h @@ -59,8 +59,6 @@ public: virtual bool PrecacheSound( const char *pSample, bool bPreload = false, bool bIsUISound = false ) = 0; virtual bool IsSoundPrecached( const char *pSample ) = 0; virtual void PrefetchSound( const char *pSample ) = 0; - - // Client only virtual bool IsLoopingSound( const char *pSample ) = 0; // Just loads the file header and checks for duration (not hooked up for .mp3's yet) @@ -119,9 +117,11 @@ public: virtual void PrecacheSentenceGroup( const char *pGroupName ) = 0; virtual void NotifyBeginMoviePlayback() = 0; virtual void NotifyEndMoviePlayback() = 0; + + virtual bool GetSoundChannelVolume( const char* sound, float &flVolumeLeft, float &flVolumeRight ) = 0; - // Client only - virtual float GetSoundChannelVolume( const char *, float &, float & ) = 0; + virtual float GetElapsedTimeByGuid( int guid ) = 0; + }; diff --git a/public/engine/IEngineTrace.h b/public/engine/IEngineTrace.h index 4610b47d..4a92d28b 100644 --- a/public/engine/IEngineTrace.h +++ b/public/engine/IEngineTrace.h @@ -15,6 +15,7 @@ #include "basehandle.h" #include "utlvector.h" //need CUtlVector for IEngineTrace::GetBrushesIn*() #include "mathlib/vector4d.h" +#include "bspflags.h" class Vector; class IHandleEntity; @@ -23,6 +24,7 @@ class CGameTrace; typedef CGameTrace trace_t; class ICollideable; class QAngle; +class ITraceListData; class CPhysCollide; struct cplane_t; @@ -44,16 +46,6 @@ public: virtual TraceType_t GetTraceType() const = 0; }; -abstract_class ITraceListData -{ -public: - virtual ~ITraceListData() {}; - - virtual void Reset() = 0; - virtual bool IsEmpty() = 0; - virtual bool CanTraceRay( const Ray_t &ray ) = 0; -}; - //----------------------------------------------------------------------------- // Classes are expected to inherit these + implement the ShouldHitEntity method @@ -138,9 +130,11 @@ abstract_class IEngineTrace { public: // Returns the contents mask + entity at a particular world-space position - virtual int GetPointContents( const Vector &vecAbsPosition, int mask = 0, IHandleEntity** ppEntity = NULL ) = 0; + virtual int GetPointContents( const Vector &vecAbsPosition, int contentsMask = MASK_ALL, IHandleEntity** ppEntity = NULL ) = 0; - virtual int GetPointContents_WorldOnly( const Vector &vecAbsPosition, int mask = 0 ) = 0; + // Returns the contents mask of the world only @ the world-space position (static props are ignored) + virtual int GetPointContents_WorldOnly( const Vector &vecAbsPosition, int contentsMask = MASK_ALL ) = 0; + // Get the point contents, but only test the specific entity. This works // on static props and brush models. // @@ -158,9 +152,9 @@ public: virtual void TraceRay( const Ray_t &ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace ) = 0; // A version that sets up the leaf and entity lists and allows you to pass those in for collision. - virtual void SetupLeafAndEntityListRay( const Ray_t &ray, ITraceListData *traceData ) = 0; - virtual void SetupLeafAndEntityListBox( const Vector &vecBoxMin, const Vector &vecBoxMax, ITraceListData *traceData ) = 0; - virtual void TraceRayAgainstLeafAndEntityList( const Ray_t &ray, ITraceListData *traceData, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace ) = 0; + virtual void SetupLeafAndEntityListRay( const Ray_t &ray, ITraceListData *pTraceData ) = 0; + virtual void SetupLeafAndEntityListBox( const Vector &vecBoxMin, const Vector &vecBoxMax, ITraceListData *pTraceData ) = 0; + virtual void TraceRayAgainstLeafAndEntityList( const Ray_t &ray, ITraceListData *pTraceData, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace ) = 0; // A version that sweeps a collideable through the world // abs start + abs end represents the collision origins you want to sweep the collideable through @@ -195,9 +189,9 @@ public: // Walks bsp to find the leaf containing the specified point virtual int GetLeafContainingPoint( const Vector &ptTest ) = 0; - - virtual ITraceListData *AllocTraceListData( void ) = 0; - virtual void FreeTraceListData( ITraceListData *traceData ) = 0; + + virtual ITraceListData *AllocTraceListData() = 0; + virtual void FreeTraceListData(ITraceListData *) = 0; }; diff --git a/public/engine/ivmodelinfo.h b/public/engine/ivmodelinfo.h index 69de44a0..11b918dd 100644 --- a/public/engine/ivmodelinfo.h +++ b/public/engine/ivmodelinfo.h @@ -35,6 +35,17 @@ class CUtlBuffer; class IClientRenderable; +//----------------------------------------------------------------------------- +// Indicates the type of translucency of an unmodulated renderable +//----------------------------------------------------------------------------- +enum RenderableTranslucencyType_t +{ + RENDERABLE_IS_OPAQUE = 0, + RENDERABLE_IS_TRANSLUCENT, + RENDERABLE_IS_TWO_PASS, // has both translucent and opaque sub-partsa +}; + + //----------------------------------------------------------------------------- // Model info interface //----------------------------------------------------------------------------- @@ -64,8 +75,8 @@ public: virtual bool ModelHasMaterialProxy( const model_t *model ) const = 0; virtual bool IsTranslucent( model_t const* model ) const = 0; virtual bool IsTranslucentTwoPass( const model_t *model ) const = 0; - virtual void Unused0( void ) { } - virtual int ComputeTranslucencyType( const model_t *model, int nSkin, int nBody ) = 0; + virtual void Unused0() {}; + virtual RenderableTranslucencyType_t ComputeTranslucencyType( const model_t *model, int nSkin, int nBody ) = 0; virtual int GetModelMaterialCount( const model_t* model ) const = 0; virtual void GetModelMaterials( const model_t *model, int count, IMaterial** ppMaterial ) = 0; virtual bool IsModelVertexLit( const model_t *model ) const = 0; @@ -118,7 +129,6 @@ public: virtual int GetBrushModelPlaneCount( const model_t *model ) const = 0; virtual void GetBrushModelPlane( const model_t *model, int nIndex, cplane_t &plane, Vector *pOrigin ) const = 0; virtual int GetSurfacepropsForVirtualTerrain( int index ) = 0; - virtual bool UsesEnvCubemap( const model_t *model ) const = 0; virtual bool UsesStaticLighting( const model_t *model ) const = 0; }; diff --git a/public/engine/ivmodelrender.h b/public/engine/ivmodelrender.h index 9e4723be..85377130 100644 --- a/public/engine/ivmodelrender.h +++ b/public/engine/ivmodelrender.h @@ -16,6 +16,7 @@ #include "interface.h" #include "mathlib/mathlib.h" #include "istudiorender.h" +#include "datacache/idatacache.h" //----------------------------------------------------------------------------- // forward declarations @@ -28,6 +29,7 @@ class Vector; struct studiohdr_t; class IMaterial; class CStudioHdr; +struct MaterialLightingState_t; FORWARD_DECLARE_HANDLE( LightCacheHandle_t ); @@ -91,10 +93,24 @@ struct StaticPropRenderInfo_t const model_t *pModel; IClientRenderable *pRenderable; Vector *pLightingOrigin; - short skin; ModelInstanceHandle_t instance; + uint8 skin; + uint8 alpha; }; +struct LightingQuery_t +{ + Vector m_LightingOrigin; + ModelInstanceHandle_t m_InstanceHandle; + bool m_bAmbientBoost; +}; + +struct StaticLightingQuery_t : public LightingQuery_t +{ + IClientRenderable *m_pRenderable; +}; + + // UNDONE: Move this to hud export code, subsume previous functions abstract_class IVModelRender { @@ -160,7 +176,7 @@ public: virtual int DrawModelExStaticProp( ModelRenderInfo_t &pInfo ) = 0; - virtual bool DrawModelSetup( ModelRenderInfo_t &pInfo, DrawModelState_t *pState, matrix3x4_t *pCustomBoneToWorld, matrix3x4_t** ppBoneToWorldOut ) = 0; + virtual bool DrawModelSetup( ModelRenderInfo_t &pInfo, DrawModelState_t *pState, matrix3x4_t **ppBoneToWorldOut ) = 0; virtual void DrawModelExecute( const DrawModelState_t &state, const ModelRenderInfo_t &pInfo, matrix3x4_t *pCustomBoneToWorld = NULL ) = 0; // Sets up lighting context for a point in space @@ -174,13 +190,26 @@ public: virtual void SuppressEngineLighting( bool bSuppress ) = 0; virtual void SetupColorMeshes( int nTotalVerts ) = 0; - - virtual void SetupLightingEx( const Vector &, unsigned short ) = 0; - virtual int GetBrightestShadowingLightSource( const Vector &, Vector &, Vector &, bool ) = 0; - virtual void ComputeLightingState( int, const LightingQuery_t *, MaterialLightingState_t *, ITexture **) = 0; - virtual void GetModelDecalHandles( StudioDecalHandle_t__ **, int, int, const unsigned short * ) = 0; - virtual void ComputeStaticLightingState( int, const StaticLightingQuery_t *, MaterialLightingState_t *, MaterialLightingState_t *, ColorMeshInfo_t **, ITexture **, memhandle_t__ **) = 0; - virtual void CleanupStaticLightingState( int, memhandle_t__ **) = 0; + + // Sets up lighting context for a point in space, with smooth interpolation per model. + // Passing MODEL_INSTANCE_INVALID as a handle is equivalent to calling SetupLighting. + virtual void SetupLightingEx( const Vector &vecCenter, ModelInstanceHandle_t handle ) = 0; + + // Finds the brightest light source illuminating a point. Returns false if there isn't any. + virtual bool GetBrightestShadowingLightSource( const Vector &vecCenter, Vector& lightPos, Vector& lightBrightness, bool bAllowNonTaggedLights ) = 0; + + // Computes lighting state for an array of lighting requests + virtual void ComputeLightingState( int nCount, const LightingQuery_t *pQuery, MaterialLightingState_t *pState, ITexture **ppEnvCubemapTexture ) = 0; + + // Gets an array of decal handles given model instances + virtual void GetModelDecalHandles( StudioDecalHandle_t *pDecals, int nDecalStride, int nCount, const ModelInstanceHandle_t *pHandles ) = 0; + + // Computes lighting state for an array of lighting requests for renderables which use static lighting + virtual void ComputeStaticLightingState( int nCount, const StaticLightingQuery_t *pQuery, MaterialLightingState_t *pState, MaterialLightingState_t *pDecalState, ColorMeshInfo_t **ppStaticLighting, ITexture **ppEnvCubemapTexture, DataCacheHandle_t *pColorMeshHandles ) = 0; + + // Cleans up lighting state. Must be called after the draw call that uses + // the color meshes return from ComputeStaticLightingState has been issued + virtual void CleanupStaticLightingState( int nCount, DataCacheHandle_t *pColorMeshHandles ) = 0; }; diff --git a/public/filesystem.h b/public/filesystem.h index 12ce2dc6..10810ba2 100644 --- a/public/filesystem.h +++ b/public/filesystem.h @@ -26,6 +26,7 @@ //----------------------------------------------------------------------------- class CUtlBuffer; +class CUtlString; class KeyValues; class IFileList; @@ -736,17 +737,20 @@ public: // Installs a callback used to display a dirty disk dialog virtual void InstallDirtyDiskReportFunc( FSDirtyDiskReportFunc_t func ) = 0; + + virtual bool IsLaunchedFromXboxHDD() = 0; + virtual bool IsInstalledToXboxHDDCache() = 0; + virtual bool IsDVDHosted() = 0; + virtual bool IsInstallAllowed() = 0; + + virtual int GetSearchPathID( char *pPath, int nMaxLen ) = 0; + virtual bool FixupSearchPathsAfterInstall() = 0; - virtual bool IsLaunchedFromXboxHDD( void ) = 0; - virtual bool IsInstalledToXboxHDDCache( void ) = 0; - virtual bool IsDVDHosted( void ) = 0; - virtual bool IsInstallAllowed( void ) = 0; - virtual void GetSearchPathID( char *, int ) = 0; - virtual bool FixupSearchPathsAfterInstall( void ) = 0; - - virtual FSDirtyDiskReportFunc_t GetDirtyDiskReportFunc( void ) = 0; - - virtual int AddVPKFile( const char *file ) = 0; + virtual FSDirtyDiskReportFunc_t GetDirtyDiskReportFunc() = 0; + + virtual void AddVPKFile( char const *pszName, SearchPathAdd_t addType = PATH_ADD_TO_TAIL ) = 0; + virtual void RemoveVPKFile( char const *pszName ) = 0; + virtual void GetVPKFileNames( CUtlVector &destVector ) = 0; }; //----------------------------------------------------------------------------- diff --git a/public/filesystem_passthru.h b/public/filesystem_passthru.h index 0885a790..fc942ea0 100644 --- a/public/filesystem_passthru.h +++ b/public/filesystem_passthru.h @@ -229,14 +229,19 @@ public: virtual void SetWhitelistSpewFlags( int spewFlags ) { m_pFileSystemPassThru->SetWhitelistSpewFlags( spewFlags ); } virtual void InstallDirtyDiskReportFunc( FSDirtyDiskReportFunc_t func ) { m_pFileSystemPassThru->InstallDirtyDiskReportFunc( func ); } - virtual bool IsLaunchedFromXboxHDD() { return m_pFileSystemPassThru->IsLaunchedFromXboxHDD(); } - virtual bool IsInstalledToXboxHDDCache() { return m_pFileSystemPassThru->IsInstalledToXboxHDDCache(); } - virtual bool IsDVDHosted() { return m_pFileSystemPassThru->IsDVDHosted(); } - virtual bool IsInstallAllowed() { return m_pFileSystemPassThru->IsInstallAllowed(); } - virtual void GetSearchPathID( char *a, int b ) { m_pFileSystemPassThru->GetSearchPathID(a, b); } - virtual bool FixupSearchPathsAfterInstall() { return m_pFileSystemPassThru->FixupSearchPathsAfterInstall(); } + + virtual bool IsLaunchedFromXboxHDD() { return m_pFileSystemPassThru->IsLaunchedFromXboxHDD(); } + virtual bool IsInstalledToXboxHDDCache() { return m_pFileSystemPassThru->IsInstalledToXboxHDDCache(); } + virtual bool IsDVDHosted() { return m_pFileSystemPassThru->IsDVDHosted(); } + virtual bool IsInstallAllowed() { return m_pFileSystemPassThru->IsInstallAllowed(); } + virtual int GetSearchPathID( char *pPath, int nMaxLen ) { return m_pFileSystemPassThru->GetSearchPathID( pPath, nMaxLen ); } + virtual bool FixupSearchPathsAfterInstall() { return m_pFileSystemPassThru->FixupSearchPathsAfterInstall(); } + virtual FSDirtyDiskReportFunc_t GetDirtyDiskReportFunc() { return m_pFileSystemPassThru->GetDirtyDiskReportFunc(); } - virtual int AddVPKFile( const char *file ) { return m_pFileSystemPassThru->AddVPKFile(file); } + + virtual void AddVPKFile( char const *pPkName, SearchPathAdd_t addType = PATH_ADD_TO_TAIL ) { m_pFileSystemPassThru->AddVPKFile( pPkName, addType ); } + virtual void RemoveVPKFile( char const *pPkName ) { m_pFileSystemPassThru->RemoveVPKFile( pPkName ); } + virtual void GetVPKFileNames( CUtlVector &destVector ) { m_pFileSystemPassThru->GetVPKFileNames( destVector ); } protected: IFileSystem *m_pFileSystemPassThru; diff --git a/public/gametrace.h b/public/gametrace.h index c64df4ea..6ebd0797 100644 --- a/public/gametrace.h +++ b/public/gametrace.h @@ -93,6 +93,19 @@ typedef CGameTrace trace_t; //============================================================================= +class ITraceListData +{ +public: + virtual ~ITraceListData() {} + + virtual void Reset() = 0; + virtual bool IsEmpty() = 0; + // CanTraceRay will return true if the current volume encloses the ray + // NOTE: The leaflist trace will NOT check this. Traces are intersected + // against the culled volume exclusively. + virtual bool CanTraceRay( const Ray_t &ray ) = 0; +}; + #define TLD_DEF_LEAF_MAX 256 #define TLD_DEF_ENTITY_MAX 1024 diff --git a/public/iclient.h b/public/iclient.h index 9e4c9a03..3ab8a4a8 100644 --- a/public/iclient.h +++ b/public/iclient.h @@ -12,6 +12,7 @@ #include #include "tier0/platform.h" +#include "tier1/utlvector.h" class IServer; class INetMessage; @@ -24,7 +25,7 @@ public: virtual ~IClient() {} // connect client - virtual void Connect(const char * szName, int nUserID, INetChannel *pNetChannel, bool bFakePlayer, CUtlVector< NetMessageCvar_t > *) = 0; + virtual void Connect( const char * szName, int nUserID, INetChannel *pNetChannel, bool bFakePlayer, CUtlVector< NetMessageCvar_t > *pVecCvars = NULL ) = 0; // set the client in a pending state waiting for a new game virtual void Inactivate( void ) = 0; @@ -81,12 +82,20 @@ public: virtual bool IsProximityHearingClient(int index) const = 0; virtual void SetMaxRoutablePayloadSize( int nMaxRoutablePayloadSize ) = 0; - - virtual bool IsSplitScreenUser( void ) = 0; - virtual bool CheckConnect ( void ) = 0; - virtual bool IsLowViolenceClient( void ) = 0; - virtual int GetSplitScreenOwner( void ) = 0; - virtual int GetNumPlayers( void ) = 0; + + // returns true, if client is a split screen user + virtual bool IsSplitScreenUser( void ) const = 0; + + virtual bool CheckConnect( void ) = 0; + + virtual bool IsLowViolenceClient( void ) const = 0; + + virtual IClient *GetSplitScreenOwner() = 0; + + // get the number of players on this client's machine + virtual int GetNumPlayers() = 0; + + virtual bool IsHumanPlayer() const = 0; }; #endif // ICLIENT_H diff --git a/public/icvar.h b/public/icvar.h index 9f52aea1..da39973a 100644 --- a/public/icvar.h +++ b/public/icvar.h @@ -34,6 +34,8 @@ public: virtual void ColorPrint( const Color& clr, const char *pMessage ) = 0; virtual void Print( const char *pMessage ) = 0; virtual void DPrint( const char *pMessage ) = 0; + + virtual void GetConsoleText( char *pchText, size_t bufSize ) const = 0; }; @@ -48,16 +50,6 @@ public: virtual bool AreConVarsLinkable( const ConVar *child, const ConVar *parent ) = 0; }; -abstract_class ICvarIteratorInternal -{ -public: - virtual void SetFirst( void ) = 0; - virtual void Next( void ) = 0; - virtual bool IsValid( void ) = 0; - virtual ConCommandBase *Get( void ) = 0; -}; - - //----------------------------------------------------------------------------- // Purpose: DLL interface to ConVars/ConCommands //----------------------------------------------------------------------------- @@ -84,6 +76,8 @@ public: virtual ConCommand *FindCommand( const char *name ) = 0; virtual const ConCommand *FindCommand( const char *name ) const = 0; + + // Install a global change callback (to be called when any convar changes) virtual void InstallGlobalChangeCallback( FnChangeCallback_t callback ) = 0; virtual void RemoveGlobalChangeCallback( FnChangeCallback_t callback ) = 0; @@ -108,32 +102,101 @@ public: virtual void PublishToVXConsole( ) = 0; #endif - virtual void SetMaxSplitScreenSlots( int ) = 0; - virtual int GetMaxSplitScreenSlots() const = 0; - virtual void AddSplitScreenConVars() = 0; - virtual void RemoveSplitScreenConVars( int ) = 0; - virtual int GetConsoleDisplayFuncCount() const = 0; - virtual void GetConsoleText( int, char *, unsigned int ) const = 0; - virtual bool IsMaterialThreadSetAllowed() const = 0; - virtual void QueueMaterialThreadSetValue( ConVar *, const char * ) = 0; - virtual void QueueMaterialThreadSetValue( ConVar *, int ) = 0; - virtual void QueueMaterialThreadSetValue( ConVar *, float ) = 0; - virtual bool HasQueuedMaterialThreadConVarSets() const = 0; - virtual int ProcessQueuedMaterialThreadConVarSets() = 0; - - // Returns a cvar iterator pointer. - // - // If memoverride is not used, use g_pMemAlloc->Free() to deallocate the memory - // used by these iterators. - // - // If memoverride is used, you can use the delete operator even though there - // is no virtual destructor. This can be done because memoverride overloads the - // delete operator so that it will call g_pMemAlloc-Free(). - virtual ICvarIteratorInternal *FactoryInternalIterator() = 0; + virtual void SetMaxSplitScreenSlots( int nSlots ) = 0; + virtual int GetMaxSplitScreenSlots() const = 0; + + virtual void AddSplitScreenConVars() = 0; + virtual void RemoveSplitScreenConVars( CVarDLLIdentifier_t id ) = 0; + + virtual int GetConsoleDisplayFuncCount() const = 0; + virtual void GetConsoleText( int nDisplayFuncIndex, char *pchText, size_t bufSize ) const = 0; + + // Utilities for convars accessed by the material system thread + virtual bool IsMaterialThreadSetAllowed( ) const = 0; + virtual void QueueMaterialThreadSetValue( ConVar *pConVar, const char *pValue ) = 0; + virtual void QueueMaterialThreadSetValue( ConVar *pConVar, int nValue ) = 0; + virtual void QueueMaterialThreadSetValue( ConVar *pConVar, float flValue ) = 0; + virtual bool HasQueuedMaterialThreadConVarSets() const = 0; + virtual int ProcessQueuedMaterialThreadConVarSets() = 0; + +protected: class ICVarIteratorInternal; +public: + /// Iteration over all cvars. + /// (THIS IS A SLOW OPERATION AND YOU SHOULD AVOID IT.) + /// usage: + /// { ICVar::Iterator iter(g_pCVar); + /// for ( iter.SetFirst() ; iter.IsValid() ; iter.Next() ) + /// { + /// ConCommandBase *cmd = iter.Get(); + /// } + /// } + /// The Iterator class actually wraps the internal factory methods + /// so you don't need to worry about new/delete -- scope takes care + // of it. + /// We need an iterator like this because we can't simply return a + /// pointer to the internal data type that contains the cvars -- + /// it's a custom, protected class with unusual semantics and is + /// prone to change. + class Iterator + { + public: + inline Iterator(ICvar *icvar); + inline ~Iterator(void); + inline void SetFirst( void ); + inline void Next( void ); + inline bool IsValid( void ); + inline ConCommandBase *Get( void ); + private: + ICVarIteratorInternal *m_pIter; + }; + +protected: + // internals for ICVarIterator + class ICVarIteratorInternal + { + public: + virtual void SetFirst( void ) = 0; + virtual void Next( void ) = 0; + virtual bool IsValid( void ) = 0; + virtual ConCommandBase *Get( void ) = 0; + }; + + virtual ICVarIteratorInternal *FactoryInternalIterator( void ) = 0; + friend class Iterator; }; #define CVAR_INTERFACE_VERSION "VEngineCvar007" +inline ICvar::Iterator::Iterator(ICvar *icvar) +{ + m_pIter = icvar->FactoryInternalIterator(); +} + +inline ICvar::Iterator::~Iterator( void ) +{ + g_pMemAlloc->Free(m_pIter); +} + +inline void ICvar::Iterator::SetFirst( void ) +{ + m_pIter->SetFirst(); +} + +inline void ICvar::Iterator::Next( void ) +{ + m_pIter->Next(); +} + +inline bool ICvar::Iterator::IsValid( void ) +{ + return m_pIter->IsValid(); +} + +inline ConCommandBase * ICvar::Iterator::Get( void ) +{ + return m_pIter->Get(); +} + //----------------------------------------------------------------------------- // These global names are defined by tier1.h, duplicated here so you diff --git a/public/igameevents.h b/public/igameevents.h index a93a208f..a2a08a0c 100644 --- a/public/igameevents.h +++ b/public/igameevents.h @@ -75,17 +75,19 @@ public: // Data access virtual bool GetBool( const char *keyName = NULL, bool defaultValue = false ) = 0; virtual int GetInt( const char *keyName = NULL, int defaultValue = 0 ) = 0; - virtual unsigned long long GetUint64 ( const char *keyName = NULL, unsigned long long defaultValue = 0) = 0; + virtual uint64 GetUint64( const char *keyName = NULL, uint64 defaultValue = 0 ) = 0; virtual float GetFloat( const char *keyName = NULL, float defaultValue = 0.0f ) = 0; virtual const char *GetString( const char *keyName = NULL, const char *defaultValue = "" ) = 0; virtual void SetBool( const char *keyName, bool value ) = 0; virtual void SetInt( const char *keyName, int value ) = 0; - virtual void SetUint64( const char *keyName, unsigned long long value ) = 0; + virtual void SetUint64( const char *keyName, uint64 value ) = 0; virtual void SetFloat( const char *keyName, float value ) = 0; virtual void SetString( const char *keyName, const char *value ) = 0; }; +#define EVENT_DEBUG_ID_INIT 42 +#define EVENT_DEBUG_ID_SHUTDOWN 13 abstract_class IGameEventListener2 { @@ -95,10 +97,8 @@ public: // FireEvent is called by EventManager if event just occured // KeyValue memory will be freed by manager if not needed anymore virtual void FireGameEvent( IGameEvent *event ) = 0; - virtual int GetEventDebugID( void ) - { - return 42; - } + + virtual int GetEventDebugID( void ) = 0; }; abstract_class IGameEventManager2 : public IBaseInterface @@ -123,7 +123,7 @@ public: // create an event by name, but doesn't fire it. returns NULL is event is not // known or no listener is registered for it. bForce forces the creation even if no listener is active - virtual IGameEvent *CreateEvent( const char *name, bool bForce = false, int *unknown=NULL) = 0; + virtual IGameEvent *CreateEvent( const char *name, bool bForce = false, int *pCookie = NULL ) = 0; // fires a server event created earlier, if bDontBroadcast is set, event is not send to clients virtual bool FireEvent( IGameEvent *event, bool bDontBroadcast = false ) = 0; diff --git a/public/inetchannel.h b/public/inetchannel.h index b1ad8bf7..fd8fd2d8 100644 --- a/public/inetchannel.h +++ b/public/inetchannel.h @@ -13,13 +13,30 @@ #include "tier0/platform.h" #include "inetchannelinfo.h" #include "tier1/bitbuf.h" +#include "tier1/netadr.h" class IDemoRecorder; class INetMessage; class INetChannelHandler; class INetChannelInfo; typedef struct netpacket_s netpacket_t; -typedef struct netadr_s netadr_t; + +#ifndef NET_PACKET_ST_DEFINED +#define NET_PACKET_ST_DEFINED +typedef struct netpacket_s +{ + netadr_t from; // sender IP + int source; // received source + double received; // received time + unsigned char *data; // pointer to raw packet data + bf_read message; // easy bitbuf data access + int size; // size in bytes + int wiresize; // size in bytes before decompression + bool stream; // was send as stream + struct netpacket_s *pNext; // for internal use, should be NULL in public +} netpacket_t; +#endif // NET_PACKET_ST_DEFINED + abstract_class INetChannel : public INetChannelInfo { @@ -30,7 +47,7 @@ public: virtual bool RegisterMessage(INetMessage *msg) = 0; virtual bool StartStreaming( unsigned int challengeNr ) = 0; virtual void ResetStreaming( void ) = 0; - virtual void SetTimeout(float seconds) = 0; + virtual void SetTimeout(float seconds, bool bForceExact = false) = 0; virtual void SetDemoRecorder(IDemoRecorder *recorder) = 0; virtual void SetChallengeNr(unsigned int chnr) = 0; @@ -82,10 +99,12 @@ public: // Max # of payload bytes before we must split/fragment the packet virtual void SetMaxRoutablePayloadSize( int nSplitSize ) = 0; virtual int GetMaxRoutablePayloadSize() = 0; - - virtual bool SetActiveChannel( INetChannel *msg ) = 0; - virtual void AttachSplitPlayer( int player, INetChannel *msg ) = 0; - virtual void DetachSplitPlayer( int player ) = 0; + + // For routing messages to a different handler + virtual bool SetActiveChannel( INetChannel *pNewChannel ) = 0; + virtual void AttachSplitPlayer( int nSplitPlayerSlot, INetChannel *pChannel ) = 0; + virtual void DetachSplitPlayer( int nSplitPlayerSlot ) = 0; + virtual bool IsRemoteDisconnected() const = 0; }; diff --git a/public/inetmsghandler.h b/public/inetmsghandler.h index 5a8a8a50..66bb0fcf 100644 --- a/public/inetmsghandler.h +++ b/public/inetmsghandler.h @@ -50,9 +50,6 @@ public: #define PROCESS_CLC_MESSAGE( name ) \ virtual bool Process##name( CLC_##name *msg ) -#define PROCESS_MM_MESSAGE( name ) \ - virtual bool Process##name( MM_##name *msg ) - #define REGISTER_NET_MSG( name ) \ NET_##name * p##name = new NET_##name(); \ @@ -69,10 +66,6 @@ public: p##name->m_pMessageHandler = this; \ chan->RegisterMessage( p##name ); \ -#define REGISTER_MM_MSG( name ) \ - MM_##name * p##name = new MM_##name(); \ - p##name->m_pMessageHandler = this; \ - chan->RegisterMessage( p##name ); \ class NET_Tick; class NET_StringCmd; @@ -80,6 +73,7 @@ class NET_SetConVar; class NET_SignonState; class NET_SplitScreenUser; + class INetMessageHandler { public: @@ -101,6 +95,7 @@ class CLC_RespondCvarValue; class CLC_SplitPlayerConnect; class CLC_FileCRCCheck; class CLC_LoadingProgress; +class CLC_CmdKeyValues; class IClientMessageHandler : public INetMessageHandler { @@ -116,6 +111,7 @@ public: PROCESS_CLC_MESSAGE( SplitPlayerConnect ) = 0; PROCESS_CLC_MESSAGE( FileCRCCheck ) = 0; PROCESS_CLC_MESSAGE( LoadingProgress ) = 0; + PROCESS_CLC_MESSAGE( CmdKeyValues ) = 0; }; class SVC_Print; @@ -142,6 +138,7 @@ class SVC_Menu; class SVC_GameEventList; class SVC_GetCvarValue; class SVC_SplitScreen; +class SVC_CmdKeyValues; class IServerMessageHandler : public INetMessageHandler { @@ -172,34 +169,7 @@ public: PROCESS_SVC_MESSAGE( GameEventList ) = 0; PROCESS_SVC_MESSAGE( GetCvarValue ) = 0; PROCESS_SVC_MESSAGE( SplitScreen ) = 0; -}; - -class MM_Heartbeat; -class MM_ClientInfo; -class MM_ClientJoinRequest; -class MM_RegisterResponse; -class MM_Mutelist; -class MM_Checkpoint; -class MM_JoinResponse; -class MM_Migrate; -class MM_ClientChat; -class MM_ClientRequest; - -class IMatchmakingMessageHandler : public INetMessageHandler -{ -public: - virtual ~IMatchmakingMessageHandler( void ) {}; - - PROCESS_MM_MESSAGE( Heartbeat ) = 0; - PROCESS_MM_MESSAGE( ClientInfo ) = 0; - PROCESS_MM_MESSAGE( ClientJoinRequest ) = 0; - PROCESS_MM_MESSAGE( RegisterResponse ) = 0; - PROCESS_MM_MESSAGE( Mutelist ) = 0; - PROCESS_MM_MESSAGE( Checkpoint) = 0; - PROCESS_MM_MESSAGE( JoinResponse ) = 0; - PROCESS_MM_MESSAGE( Migrate ) = 0; - PROCESS_MM_MESSAGE( ClientChat ) = 0; - PROCESS_MM_MESSAGE( ClientRequest ) = 0; + PROCESS_SVC_MESSAGE( CmdKeyValues ) = 0; }; class IConnectionlessPacketHandler diff --git a/public/networkstringtabledefs.h b/public/networkstringtabledefs.h index cb206c29..299c8cf3 100644 --- a/public/networkstringtabledefs.h +++ b/public/networkstringtabledefs.h @@ -49,31 +49,19 @@ public: // Accessors (length -1 means don't change user data if string already exits) virtual int AddString( bool bIsServer, const char *value, int length = -1, const void *userdata = 0 ) = 0; - virtual const char *GetString( int stringNumber ) = 0; + virtual const char *GetString( int stringNumber ) const = 0; virtual void SetStringUserData( int stringNumber, int length, const void *userdata ) = 0; - virtual const void *GetStringUserData( int stringNumber, int *length ) = 0; + virtual const void *GetStringUserData( int stringNumber, int *length ) const = 0; virtual int FindStringIndex( char const *string ) = 0; // returns INVALID_STRING_INDEX if not found // Callbacks virtual void SetStringChangedCallback( void *object, pfnStringChanged changeFunc ) = 0; }; -class INetworkStringDict +enum ENetworkStringtableFlags { -public: - - virtual ~INetworkStringDict( void ) {}; - - virtual int Count( void ) = 0; - virtual void Purge( void ) = 0; - virtual const char *String( int index ) = 0; - virtual bool IsValidIndex( int index ) = 0; - virtual int Insert( const char *string ) = 0; - virtual int Find( const char *string ) = 0; - virtual void UpdateDictionary( int ) = 0; - virtual int DictionaryIndex( int ) = 0; - virtual int Element( int ) = 0; - virtual int Element( int ) const = 0; + NSF_NONE = 0, + NSF_DICTIONARY_ENABLED = (1<<0), // Uses pre-calculated per map dictionaries to reduce bandwidth }; class INetworkStringTableContainer @@ -83,7 +71,7 @@ public: virtual ~INetworkStringTableContainer( void ) {}; // table creation/destruction - virtual INetworkStringTable *CreateStringTable( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0, int unknown = 0 ) = 0; + virtual INetworkStringTable *CreateStringTable( const char *tableName, int maxentries, int userdatafixedsize = 0, int userdatanetworkbits = 0, int flags = NSF_NONE ) = 0; virtual void RemoveAllTables( void ) = 0; // table infos @@ -92,7 +80,8 @@ public: virtual int GetNumTables( void ) const = 0; virtual void SetAllowClientSideAddString( INetworkStringTable *table, bool bAllowClientSideAddString ) = 0; - virtual INetworkStringDict *CreateDictionary( const char *dictName ) = 0; + + virtual void CreateDictionary( char const *pchMapName ) = 0; }; #endif // NETWORKSTRINGTABLEDEFS_H diff --git a/public/tier0/memalloc.h b/public/tier0/memalloc.h index a7167ffe..5fdf6214 100644 --- a/public/tier0/memalloc.h +++ b/public/tier0/memalloc.h @@ -54,6 +54,9 @@ public: virtual void Free( void *pMem, const char *pFileName, int nLine ) = 0; virtual void *Expand_NoLongerSupported( void *pMem, size_t nSize, const char *pFileName, int nLine ) = 0; + inline void *IndirectAlloc( size_t nSize ) { return Alloc( nSize ); } + inline void *IndirectAlloc( size_t nSize, const char *pFileName, int nLine ) { return Alloc( nSize, pFileName, nLine ); } + // Returns size of a particular allocation virtual size_t GetSize( void *pMem ) = 0; @@ -63,7 +66,7 @@ public: // FIXME: Remove when we have our own allocator // these methods of the Crt debug code is used in our codebase currently - virtual long CrtSetBreakAlloc( long lNewBreakAlloc ) = 0; + virtual int32 CrtSetBreakAlloc( int32 lNewBreakAlloc ) = 0; virtual int CrtSetReportMode( int nReportType, int nReportMode ) = 0; virtual int CrtIsValidHeapPointer( const void *pMem ) = 0; virtual int CrtIsValidPointer( const void *pMem, unsigned int size, int access ) = 0; @@ -74,8 +77,7 @@ public: // FIXME: Make a better stats interface virtual void DumpStats() = 0; virtual void DumpStatsFileBase( char const *pchFileBase ) = 0; - - virtual size_t ComputeMemoryUsedBy( const char *pFileName ) = 0; + virtual size_t ComputeMemoryUsedBy( char const *pchSubStr ) = 0; // FIXME: Remove when we have our own allocator virtual void* CrtSetReportFile( int nRptType, void* hFile ) = 0; @@ -88,8 +90,8 @@ public: virtual bool IsDebugHeap() = 0; virtual void GetActualDbgInfo( const char *&pFileName, int &nLine ) = 0; - virtual void RegisterAllocation( const char *pFileName, int nLine, int nLogicalSize, int nActualSize, unsigned nTime ) = 0; - virtual void RegisterDeallocation( const char *pFileName, int nLine, int nLogicalSize, int nActualSize, unsigned nTime ) = 0; + virtual void RegisterAllocation( const char *pFileName, int nLine, size_t nLogicalSize, size_t nActualSize, unsigned nTime ) = 0; + virtual void RegisterDeallocation( const char *pFileName, int nLine, size_t nLogicalSize, size_t nActualSize, unsigned nTime ) = 0; virtual int GetVersion() = 0; @@ -106,9 +108,10 @@ public: // Returns 0 if no failure, otherwise the size_t of the last requested chunk virtual size_t MemoryAllocFailed() = 0; - - virtual void CompactIncremental() = 0; - virtual void OutOfMemory( size_t ) = 0; + + virtual void CompactIncremental() = 0; + + virtual void OutOfMemory( size_t nBytesAttempted = 0 ) = 0; }; //----------------------------------------------------------------------------- diff --git a/public/tier1/convar.h b/public/tier1/convar.h index 34b10f91..cc607c21 100644 --- a/public/tier1/convar.h +++ b/public/tier1/convar.h @@ -120,10 +120,10 @@ public: virtual bool IsFlagSet( int flag ) const; // Set flag virtual void AddFlags( int flags ); - // Remove flag + // Clear flag virtual void RemoveFlags( int flags ); - // Get flags - virtual int GetFlags( void ) const; + + virtual int GetFlags() const; // Return name of cvar virtual const char *GetName( void ) const; @@ -329,6 +329,7 @@ class ConVar : public ConCommandBase, public IConVar friend class CCvar; friend class ConVarRef; + public: typedef ConCommandBase BaseClass; diff --git a/public/tier1/iconvar.h b/public/tier1/iconvar.h index d673b027..d5467f02 100644 --- a/public/tier1/iconvar.h +++ b/public/tier1/iconvar.h @@ -40,7 +40,7 @@ class CCommand; #define FCVAR_DEVELOPMENTONLY (1<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined. #define FCVAR_GAMEDLL (1<<2) // defined by the game DLL #define FCVAR_CLIENTDLL (1<<3) // defined by the client DLL -#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or autocomplete. Like DEVELOPMENTONLY, but can't be compiled out. +#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out. // ConVar only #define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value @@ -48,7 +48,6 @@ class CCommand; #define FCVAR_ARCHIVE (1<<7) // set to cause it to be saved to vars.rc #define FCVAR_NOTIFY (1<<8) // notifies players when changed #define FCVAR_USERINFO (1<<9) // changes the client's info string -#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats #define FCVAR_PRINTABLEONLY (1<<10) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). #define FCVAR_UNLOGGED (1<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log @@ -60,11 +59,17 @@ class CCommand; // If a change is requested it must come from the console (i.e., no remote client changes) // If a value is changed while a server is active, it's replicated to all connected clients #define FCVAR_REPLICATED (1<<13) // server setting enforced on clients, TODO rename to FCAR_SERVER at some time -#define FCVAR_DEMO (1<<16) // record this cvar when starting a demo file -#define FCVAR_DONTRECORD (1<<17) // don't record these command in demofiles +#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats +#define FCVAR_SS (1<<15) // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated +#define FCVAR_DEMO (1<<16) // record this cvar when starting a demo file +#define FCVAR_DONTRECORD (1<<17) // don't record these command in demofiles +#define FCVAR_SS_ADDED (1<<18) // This is one of the "added" FCVAR_SS variables for the splitscreen players +#define FCVAR_RELEASE (1<<19) // Cvars tagged with this are the only cvars avaliable to customers +#define FCVAR_RELOAD_MATERIALS (1<<20) // If this cvar changes, it forces a material reload +#define FCVAR_RELOAD_TEXTURES (1<<21) // If this cvar changes, if forces a texture reload #define FCVAR_NOT_CONNECTED (1<<22) // cvar cannot be changed by a client that is connected to a server - +#define FCVAR_MATERIAL_SYSTEM_THREAD (1<<23) // Indicates this cvar is read from the material system thread #define FCVAR_ARCHIVE_XBOX (1<<24) // cvar written to config.cfg on the Xbox #define FCVAR_SERVER_CAN_EXECUTE (1<<28)// the server is allowed to execute this command on clients via ClientCommand/NET_StringCmd/CBaseClientState::ProcessStringCmd. @@ -72,17 +77,12 @@ class CCommand; #define FCVAR_CLIENTCMD_CAN_EXECUTE (1<<30) // IVEngineClient::ClientCmd is allowed to execute this command. // Note: IVEngineClient::ClientCmd_Unrestricted can run any client command. -// #define FCVAR_AVAILABLE (1<<15) -// #define FCVAR_AVAILABLE (1<<18) -// #define FCVAR_AVAILABLE (1<<19) -// #define FCVAR_AVAILABLE (1<<20) -// #define FCVAR_AVAILABLE (1<<21) -// #define FCVAR_AVAILABLE (1<<23) -// #define FCVAR_AVAILABLE (1<<25) +#define FCVAR_ACCESSIBLE_FROM_THREADS (1<<25) // used as a debugging tool necessary to check material system thread convars // #define FCVAR_AVAILABLE (1<<26) // #define FCVAR_AVAILABLE (1<<27) // #define FCVAR_AVAILABLE (1<<31) +#define FCVAR_MATERIAL_THREAD_MASK ( FCVAR_RELOAD_MATERIALS | FCVAR_RELOAD_TEXTURES | FCVAR_MATERIAL_SYSTEM_THREAD ) //----------------------------------------------------------------------------- // Called when a ConVar changes value @@ -104,13 +104,15 @@ public: // Return name of command virtual const char *GetName( void ) const = 0; + + // Return name of command (usually == GetName(), except in case of FCVAR_SS_ADDED vars virtual const char *GetBaseName( void ) const = 0; // Accessors.. not as efficient as using GetState()/GetInfo() // if you call these methods multiple times on the same IConVar virtual bool IsFlagSet( int nFlag ) const = 0; - - virtual int GetSplitScreenPlayerSlot( void ) const = 0; + + virtual int GetSplitScreenPlayerSlot() const = 0; }; diff --git a/public/vphysics_interface.h b/public/vphysics_interface.h index 6b1c51bc..54431242 100644 --- a/public/vphysics_interface.h +++ b/public/vphysics_interface.h @@ -269,7 +269,7 @@ public: // begins parsing a vcollide. NOTE: This keeps pointers to the text // If you free the text and call members of IVPhysicsKeyParser, it will crash virtual IVPhysicsKeyParser *VPhysicsKeyParserCreate( const char *pKeyData ) = 0; - virtual IVPhysicsKeyParser *VPhysicsKeyParserCreate( vcollide_t * ) = 0; + virtual IVPhysicsKeyParser *VPhysicsKeyParserCreate( vcollide_t *pVCollide ) = 0; // Free the parser created by VPhysicsKeyParserCreate virtual void VPhysicsKeyParserDestroy( IVPhysicsKeyParser *pParser ) = 0; @@ -299,13 +299,17 @@ public: // dumps info about the collide to Msg() virtual void OutputDebugInfo( const CPhysCollide *pCollide ) = 0; virtual unsigned int ReadStat( int statID ) = 0; - - virtual int CollideGetRadius( const CPhysCollide *pCollide ) = 0; - virtual void *VCollideAllocUserData( vcollide_t *, unsigned int ) = 0; - virtual void VCollideFreeUserData( vcollide_t * ) = 0; - virtual int VCollideCheck( vcollide_t *, const char * ) = 0; + + // Get an AABB for an oriented collision model + virtual float CollideGetRadius( const CPhysCollide *pCollide ) = 0; + + virtual void *VCollideAllocUserData( vcollide_t *pVCollide, size_t userDataSize ) = 0; + virtual void VCollideFreeUserData( vcollide_t *pVCollide ) = 0; + virtual void VCollideCheck( vcollide_t *pVCollide, const char *pName ) = 0; }; + + // this can be used to post-process a collision model abstract_class ICollisionQuery { @@ -663,11 +667,12 @@ public: virtual void EnableConstraintNotify( bool bEnable ) = 0; virtual void DebugCheckContacts(void) = 0; - - virtual void SetAlternateGravity( const Vector& ) = 0; - virtual void GetAlternateGravity( Vector * ) const = 0; - virtual float GetDeltaFrameTime( int ) = 0; - virtual void ForceObjectsToSleep( IPhysicsObject **, int ) = 0; + + virtual void SetAlternateGravity( const Vector &gravityVector ) = 0; + virtual void GetAlternateGravity( Vector *pGravityVector ) const = 0; + + virtual float GetDeltaFrameTime( int maxTicks ) const = 0; + virtual void ForceObjectsToSleep( IPhysicsObject **pList, int listCount ) = 0; }; enum callbackflags @@ -771,6 +776,7 @@ public: // Get the radius if this is a sphere object (zero if this is a polygonal mesh) virtual float GetSphereRadius() const = 0; + // Set the radius on a sphere. May need to force recalculation of contact points virtual void SetSphereRadius( float radius ) = 0; virtual float GetEnergy() const = 0; virtual Vector GetMassCenterLocalSpace() const = 0; @@ -865,11 +871,18 @@ public: // dumps info about the object to Msg() virtual void OutputDebugInfo() const = 0; - - virtual void SetUseAlternateGravity( bool ) = 0; - virtual void SetCollisionHints( unsigned int hint ) = 0; - virtual unsigned int GetCollisionHints( void ) const = 0; +#if OBJECT_WELDING + virtual void WeldToObject( IPhysicsObject *pParent ) = 0; + virtual void RemoveWeld( IPhysicsObject *pOther ) = 0; + virtual void RemoveAllWelds( void ) = 0; +#endif + + // EnableGravity still determines whether to apply gravity + // This flag determines which gravity constant to use for an alternate gravity effect + virtual void SetUseAlternateGravity( bool bSet ) = 0; + virtual void SetCollisionHints( uint32 collisionHints ) = 0; + virtual uint32 GetCollisionHints() const = 0; }; @@ -920,8 +933,10 @@ struct surfaceaudioparams_t struct surfacesoundnames_t { - unsigned short stepleft; - unsigned short stepright; + unsigned short walkStepLeft; + unsigned short walkStepRight; + unsigned short runStepLeft; + unsigned short runStepRight; unsigned short impactSoft; unsigned short impactHard; @@ -938,8 +953,10 @@ struct surfacesoundnames_t struct surfacesoundhandles_t { - short stepleft; - short stepright; + short walkStepLeft; + short walkStepRight; + short runStepLeft; + short runStepRight; short impactSoft; short impactHard; @@ -1092,6 +1109,7 @@ struct convertconvexparams_t bool buildOuterConvexHull; bool buildDragAxisAreas; bool buildOptimizedTraceTables; + bool checkOptimalTracing; float dragAreaEpsilon; CPhysConvex *pForcedOuterHull; @@ -1101,6 +1119,7 @@ struct convertconvexparams_t buildOuterConvexHull = false; buildDragAxisAreas = false; buildOptimizedTraceTables = false; + checkOptimalTracing = false; pForcedOuterHull = NULL; } }; diff --git a/public/vphysics_interfaceV30.h b/public/vphysics_interfaceV30.h deleted file mode 100644 index a36297b8..00000000 --- a/public/vphysics_interfaceV30.h +++ /dev/null @@ -1,1064 +0,0 @@ -//========= Copyright © 1996-2004, Valve LLC, All rights reserved. ============ -// -// Purpose: Public interfaces to vphysics DLL -// -// $NoKeywords: $ -//============================================================================= - -#ifndef VPHYSICS_INTERFACE_V30_H -#define VPHYSICS_INTERFACE_V30_H -#ifdef _WIN32 -#pragma once -#endif - -#include "interface.h" -#include "mathlib/vector.h" -#include "mathlib/vector4d.h" -#include "vcollide.h" - - -//----------------------------------------------------------------------------- -// Forward declarations -//----------------------------------------------------------------------------- -class IPhysicsObjectPairHash; -class IPhysicsConstraint; -class IPhysicsConstraintGroup; -class IPhysicsFluidController; -class IPhysicsSpring; -class IPhysicsVehicleController; -class IPhysicsCollisionSet; -class IPhysicsPlayerController; -class IPhysicsFrictionSnapshot; -struct Ray_t; -struct constraint_ragdollparams_t; -struct constraint_hingeparams_t; -struct constraint_fixedparams_t; -struct constraint_ballsocketparams_t; -struct constraint_slidingparams_t; -struct constraint_pulleyparams_t; -struct constraint_lengthparams_t; -struct constraint_groupparams_t; -struct vehicleparams_t; -struct matrix3x4_t; -struct fluidparams_t; -struct springparams_t; -struct objectparams_t; -struct debugcollide_t; -class CGameTrace; -typedef CGameTrace trace_t; -struct physics_stats_t; -struct physics_performanceparams_t; -struct physsaveparams_t; -struct physrestoreparams_t; -struct physprerestoreparams_t; - -namespace VPhysicsInterfaceV30 -{ - -//----------------------------------------------------------------------------- -// Forward declarations -//----------------------------------------------------------------------------- -class IPhysicsObject; -class IPhysicsEnvironment; -class IPhysicsSurfaceProps; -class IConvexInfo; - -enum PhysInterfaceId_t -{ - PIID_UNKNOWN, - PIID_IPHYSICSOBJECT, - PIID_IPHYSICSFLUIDCONTROLLER, - PIID_IPHYSICSSPRING, - PIID_IPHYSICSCONSTRAINTGROUP, - PIID_IPHYSICSCONSTRAINT, - PIID_IPHYSICSSHADOWCONTROLLER, - PIID_IPHYSICSPLAYERCONTROLLER, - PIID_IPHYSICSMOTIONCONTROLLER, - PIID_IPHYSICSVEHICLECONTROLLER, - PIID_IPHYSICSGAMETRACE, - - PIID_NUM_TYPES -}; - - -class ISave; -class IRestore; - - -#define VPHYSICS_DEBUG_OVERLAY_INTERFACE_VERSION_1 "VPhysicsDebugOverlay001" - -abstract_class IVPhysicsDebugOverlay -{ -public: - virtual void AddEntityTextOverlay(int ent_index, int line_offset, float duration, int r, int g, int b, int a, const char *format, ...) = 0; - virtual void AddBoxOverlay(const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, int r, int g, int b, int a, float duration) = 0; - virtual void AddTriangleOverlay(const Vector& p1, const Vector& p2, const Vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration) = 0; - virtual void AddLineOverlay(const Vector& origin, const Vector& dest, int r, int g, int b,bool noDepthTest, float duration) = 0; - virtual void AddTextOverlay(const Vector& origin, float duration, const char *format, ...) = 0; - virtual void AddTextOverlay(const Vector& origin, int line_offset, float duration, const char *format, ...) = 0; - virtual void AddScreenTextOverlay(float flXPos, float flYPos,float flDuration, int r, int g, int b, int a, const char *text) = 0; - virtual void AddSweptBoxOverlay(const Vector& start, const Vector& end, const Vector& mins, const Vector& max, const QAngle & angles, int r, int g, int b, int a, float flDuration) = 0; - virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, float r, float g, float b, float alpha, const char *format, ...) = 0; -}; - -#define VPHYSICS_INTERFACE_VERSION_30 "VPhysics030" - -abstract_class IPhysics -{ -public: - virtual IPhysicsEnvironment *CreateEnvironment( void ) = 0; - virtual void DestroyEnvironment( IPhysicsEnvironment * ) = 0; - virtual IPhysicsEnvironment *GetActiveEnvironmentByIndex( int index ) = 0; - - // Creates a fast hash of pairs of objects - // Useful for maintaining a table of object relationships like pairs that do not collide. - virtual IPhysicsObjectPairHash *CreateObjectPairHash() = 0; - virtual void DestroyObjectPairHash( IPhysicsObjectPairHash *pHash ) = 0; - - // holds a cache of these by id. So you can get by id to search for the previously created set - // UNDONE: Sets are currently limited to 32 elements. More elements will return NULL in create. - // NOTE: id is not allowed to be zero. - virtual IPhysicsCollisionSet *FindOrCreateCollisionSet( unsigned int id, int maxElementCount ) = 0; - virtual IPhysicsCollisionSet *FindCollisionSet( unsigned int id ) = 0; - virtual void DestroyAllCollisionSets() = 0; -}; - - -// CPhysConvex is a single convex solid -class CPhysConvex; -// CPhysPolysoup is an abstract triangle soup mesh -class CPhysPolysoup; -class ICollisionQuery; -class IVPhysicsKeyParser; -struct convertconvexparams_t; - -// UNDONE: Find a better place for this? Should be in collisionutils, but it's needs VPHYSICS' solver. -struct truncatedcone_t -{ - Vector origin; - Vector normal; - float h; // height of the cone (hl units) - float theta; // cone angle (degrees) -}; - - -#define VPHYSICS_COLLISION_INTERFACE_VERSION_7 "VPhysicsCollision007" - -abstract_class IPhysicsCollision -{ -public: - virtual ~IPhysicsCollision( void ) {} - - // produce a convex element from verts (convex hull around verts) - virtual CPhysConvex *ConvexFromVerts( Vector **pVerts, int vertCount ) = 0; - // produce a convex element from planes (csg of planes) - virtual CPhysConvex *ConvexFromPlanes( float *pPlanes, int planeCount, float mergeDistance ) = 0; - // calculate volume of a convex element - virtual float ConvexVolume( CPhysConvex *pConvex ) = 0; - - // Convert an array of convex elements to a compiled collision model (this deletes the convex elements) - virtual CPhysCollide *ConvertConvexToCollide( CPhysConvex **pConvex, int convexCount ) = 0; - - virtual float ConvexSurfaceArea( CPhysConvex *pConvex ) = 0; - // store game-specific data in a convex solid - virtual void SetConvexGameData( CPhysConvex *pConvex, unsigned int gameData ) = 0; - // If not converted, free the convex elements with this call - virtual void ConvexFree( CPhysConvex *pConvex ) = 0; - - // concave objects - // create a triangle soup - virtual CPhysPolysoup *PolysoupCreate( void ) = 0; - // destroy the container and memory - virtual void PolysoupDestroy( CPhysPolysoup *pSoup ) = 0; - // add a triangle to the soup - virtual void PolysoupAddTriangle( CPhysPolysoup *pSoup, const Vector &a, const Vector &b, const Vector &c, int materialIndex7bits ) = 0; - // convert the convex into a compiled collision model - virtual CPhysCollide *ConvertPolysoupToCollide( CPhysPolysoup *pSoup, bool useMOPP ) = 0; - - // Get the memory size in bytes of the collision model for serialization - virtual int CollideSize( CPhysCollide *pCollide ) = 0; - // serialize the collide to a block of memory - virtual int CollideWrite( char *pDest, CPhysCollide *pCollide ) = 0; - - // Free a collide that was created with ConvertConvexToCollide() - // UNDONE: Move this up near the other Collide routines when the version is changed - virtual void DestroyCollide( CPhysCollide *pCollide ) = 0; - // compute the volume of a collide - virtual float CollideVolume( CPhysCollide *pCollide ) = 0; - // compute surface area for tools - virtual float CollideSurfaceArea( CPhysCollide *pCollide ) = 0; - - // Get the support map for a collide in the given direction - virtual Vector CollideGetExtent( const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles, const Vector &direction ) = 0; - - // Get an AABB for an oriented collision model - virtual void CollideGetAABB( Vector &mins, Vector &maxs, const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles ) = 0; - - // Convert a bbox to a collide - virtual CPhysCollide *BBoxToCollide( const Vector &mins, const Vector &maxs ) = 0; - - - // Trace an AABB against a collide - virtual void TraceBox( const Vector &start, const Vector &end, const Vector &mins, const Vector &maxs, const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles, trace_t *ptr ) = 0; - virtual void TraceBox( const Ray_t &ray, const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles, trace_t *ptr ) = 0; - - // Trace one collide against another - virtual void TraceCollide( const Vector &start, const Vector &end, const CPhysCollide *pSweepCollide, const QAngle &sweepAngles, const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles, trace_t *ptr ) = 0; - - // loads a set of solids into a vcollide_t - virtual void VCollideLoad( vcollide_t *pOutput, int solidCount, const char *pBuffer, int size ) = 0; - // destroyts the set of solids created by VCollideLoad - virtual void VCollideUnload( vcollide_t *pVCollide ) = 0; - - // begins parsing a vcollide. NOTE: This keeps pointers to the text - // If you free the text and call members of IVPhysicsKeyParser, it will crash - virtual IVPhysicsKeyParser *VPhysicsKeyParserCreate( const char *pKeyData ) = 0; - // Free the parser created by VPhysicsKeyParserCreate - virtual void VPhysicsKeyParserDestroy( IVPhysicsKeyParser *pParser ) = 0; - - // creates a list of verts from a collision mesh - virtual int CreateDebugMesh( CPhysCollide const *pCollisionModel, Vector **outVerts ) = 0; - // destroy the list of verts created by CreateDebugMesh - virtual void DestroyDebugMesh( int vertCount, Vector *outVerts ) = 0; - - // create a queryable version of the collision model - virtual ICollisionQuery *CreateQueryModel( CPhysCollide *pCollide ) = 0; - // destroy the queryable version - virtual void DestroyQueryModel( ICollisionQuery *pQuery ) = 0; - - virtual IPhysicsCollision *ThreadContextCreate( void ) = 0; - virtual void ThreadContextDestroy( IPhysicsCollision *pThreadContex ) = 0; - - virtual unsigned int ReadStat( int statID ) = 0; - - // UNDONE: Move this up when changing the interface version - virtual void TraceBox( const Ray_t &ray, unsigned int contentsMask, IConvexInfo *pConvexInfo, const CPhysCollide *pCollide, const Vector &collideOrigin, const QAngle &collideAngles, trace_t *ptr ) = 0; - virtual void CollideGetMassCenter( CPhysCollide *pCollide, Vector *pOutMassCenter ) = 0; - virtual void CollideSetMassCenter( CPhysCollide *pCollide, const Vector &massCenter ) = 0; - - // query the collide index in the physics model for the instance - virtual int CollideIndex( const CPhysCollide *pCollide ) = 0; - - virtual CPhysCollide *ConvertConvexToCollideParams( CPhysConvex **pConvex, int convexCount, const convertconvexparams_t &convertParams ) = 0; - virtual CPhysConvex *BBoxToConvex( const Vector &mins, const Vector &maxs ) = 0; - - // get the approximate cross-sectional area projected orthographically on the bbox of the collide - // NOTE: These are fractional areas - unitless. Basically this is the fraction of the OBB on each axis that - // would be visible if the object were rendered orthographically. - // NOTE: This has been precomputed when the collide was built or this function will return 1,1,1 - virtual Vector CollideGetOrthographicAreas( const CPhysCollide *pCollide ) = 0; - - // dumps info about the collide to Msg() - virtual void OutputDebugInfo( const CPhysCollide *pCollide ) = 0; - - // relatively slow test for box vs. truncated cone - virtual bool IsBoxIntersectingCone( const Vector &boxAbsMins, const Vector &boxAbsMaxs, const truncatedcone_t &cone ) = 0; -}; - -// this can be used to post-process a collision model -abstract_class ICollisionQuery -{ -public: - virtual ~ICollisionQuery() {} - // number of convex pieces in the whole solid - virtual int ConvexCount( void ) = 0; - // triangle count for this convex piece - virtual int TriangleCount( int convexIndex ) = 0; - // get the stored game data - virtual unsigned int GetGameData( int convexIndex ) = 0; - // Gets the triangle's verts to an array - virtual void GetTriangleVerts( int convexIndex, int triangleIndex, Vector *verts ) = 0; - - // UNDONE: This doesn't work!!! - virtual void SetTriangleVerts( int convexIndex, int triangleIndex, const Vector *verts ) = 0; - - // returns the 7-bit material index - virtual int GetTriangleMaterialIndex( int convexIndex, int triangleIndex ) = 0; - // sets a 7-bit material index for this triangle - virtual void SetTriangleMaterialIndex( int convexIndex, int triangleIndex, int index7bits ) = 0; -}; - -//----------------------------------------------------------------------------- -// Purpose: Ray traces from game engine. -//----------------------------------------------------------------------------- -abstract_class IPhysicsGameTrace -{ -public: - virtual void VehicleTraceRay( const Ray_t &ray, void *pVehicle, trace_t *pTrace ) = 0; - virtual void VehicleTraceRayWithWater( const Ray_t &ray, void *pVehicle, trace_t *pTrace ) = 0; - virtual bool VehiclePointInWater( const Vector &vecPoint ) = 0; -}; - -// The caller should implement this to return contents masks per convex on a collide -abstract_class IConvexInfo -{ -public: - virtual unsigned int GetContents( int convexGameData ) = 0; -}; - -class CPhysicsEventHandler; -abstract_class IPhysicsCollisionData -{ -public: - virtual void GetSurfaceNormal( Vector &out ) = 0; // normal points toward second object (object index 1) - virtual void GetContactPoint( Vector &out ) = 0; // contact point of collision (in world space) - virtual void GetContactSpeed( Vector &out ) = 0; // speed of surface 1 relative to surface 0 (in world space) -}; - - -struct vcollisionevent_t -{ - IPhysicsObject *pObjects[2]; - int surfaceProps[2]; - bool isCollision; - bool isShadowCollision; - float deltaCollisionTime; - - float collisionSpeed; // only valid at postCollision - IPhysicsCollisionData *pInternalData; // may change pre/post collision -}; - -abstract_class IPhysicsCollisionEvent -{ -public: - // returns the two objects that collided, time between last collision of these objects - // and an opaque data block of collision information - // NOTE: PreCollision/PostCollision ALWAYS come in matched pairs!!! - virtual void PreCollision( vcollisionevent_t *pEvent ) = 0; - virtual void PostCollision( vcollisionevent_t *pEvent ) = 0; - - // This is a scrape event. The object has scraped across another object consuming the indicated energy - virtual void Friction( IPhysicsObject *pObject, float energy, int surfaceProps, int surfacePropsHit, IPhysicsCollisionData *pData ) = 0; - - virtual void StartTouch( IPhysicsObject *pObject1, IPhysicsObject *pObject2, IPhysicsCollisionData *pTouchData ) = 0; - virtual void EndTouch( IPhysicsObject *pObject1, IPhysicsObject *pObject2, IPhysicsCollisionData *pTouchData ) = 0; - - virtual void FluidStartTouch( IPhysicsObject *pObject, IPhysicsFluidController *pFluid ) = 0; - virtual void FluidEndTouch( IPhysicsObject *pObject, IPhysicsFluidController *pFluid ) = 0; - - virtual void PostSimulationFrame() = 0; - - virtual void ObjectEnterTrigger( IPhysicsObject *pTrigger, IPhysicsObject *pObject ) {} - virtual void ObjectLeaveTrigger( IPhysicsObject *pTrigger, IPhysicsObject *pObject ) {} -}; - - -abstract_class IPhysicsObjectEvent -{ -public: - // these can be used to optimize out queries on sleeping objects - // Called when an object is woken after sleeping - virtual void ObjectWake( IPhysicsObject *pObject ) = 0; - // called when an object goes to sleep (no longer simulating) - virtual void ObjectSleep( IPhysicsObject *pObject ) = 0; -}; - -class IPhysicsConstraintEvent -{ -public: - // the constraint is now inactive, the game code is required to delete it or re-activate it. - virtual void ConstraintBroken( IPhysicsConstraint * ) = 0; -}; - -struct hlshadowcontrol_params_t -{ - Vector targetPosition; - QAngle targetRotation; - float maxAngular; - float maxDampAngular; - float maxSpeed; - float maxDampSpeed; - float dampFactor; - float teleportDistance; -}; - -// UNDONE: At some point allow this to be parameterized using hlshadowcontrol_params_t. -// All of the infrastructure is in place to do that. -abstract_class IPhysicsShadowController -{ -public: - virtual ~IPhysicsShadowController( void ) {} - - virtual void Update( const Vector &position, const QAngle &angles, float timeOffset ) = 0; - virtual void MaxSpeed( float maxSpeed, float maxAngularSpeed ) = 0; - virtual void StepUp( float height ) = 0; - - // If the teleport distance is non-zero, the object will be teleported to - // the target location when the error exceeds this quantity. - virtual void SetTeleportDistance( float teleportDistance ) = 0; - virtual bool AllowsTranslation() = 0; - virtual bool AllowsRotation() = 0; - - // There are two classes of shadow objects: - // 1) Game physics controlled, shadow follows game physics (this is the default) - // 2) Physically controlled - shadow position is a target, but the game hasn't guaranteed that the space can be occupied by this object - virtual void SetPhysicallyControlled( bool isPhysicallyControlled ) = 0; - virtual bool IsPhysicallyControlled() = 0; - virtual void GetLastImpulse( Vector *pOut ) = 0; - virtual void UseShadowMaterial( bool bUseShadowMaterial ) = 0; - virtual void ObjectMaterialChanged( int materialIndex ) = 0; -}; - -class CPhysicsSimObject; -class IPhysicsMotionController; - -// Callback for simulation -class IMotionEvent -{ -public: - // These constants instruct the simulator as to how to apply the values copied to linear & angular - // GLOBAL/LOCAL refer to the coordinate system of the values, whereas acceleration/force determine whether or not - // mass is divided out (forces must be divided by mass to compute acceleration) - enum simresult_e { SIM_NOTHING = 0, SIM_LOCAL_ACCELERATION, SIM_LOCAL_FORCE, SIM_GLOBAL_ACCELERATION, SIM_GLOBAL_FORCE }; - virtual simresult_e Simulate( IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular ) = 0; -}; - - - -abstract_class IPhysicsMotionController -{ -public: - virtual ~IPhysicsMotionController( void ) {} - virtual void SetEventHandler( IMotionEvent *handler ) = 0; - virtual void AttachObject( IPhysicsObject *pObject, bool checkIfAlreadyAttached ) = 0; - virtual void DetachObject( IPhysicsObject *pObject ) = 0; - - // returns the number of objects currently attached to the controller - virtual int CountObjects( void ) = 0; - // NOTE: pObjectList is an array with at least CountObjects() allocated - virtual void GetObjects( IPhysicsObject **pObjectList ) = 0; - // detaches all attached objects - virtual void ClearObjects( void ) = 0; - - // wakes up all attached objects - virtual void WakeObjects( void ) = 0; - enum priority_t - { - LOW_PRIORITY = 0, - MEDIUM_PRIORITY = 1, - HIGH_PRIORITY = 2, - }; - virtual void SetPriority( priority_t priority ) = 0; -}; - -// ------------------- -// Collision filter function. Return 0 if objects should not be tested for collisions, nonzero otherwise -// Install with IPhysicsEnvironment::SetCollisionFilter() -// ------------------- -abstract_class IPhysicsCollisionSolver -{ -public: - virtual int ShouldCollide( IPhysicsObject *pObj0, IPhysicsObject *pObj1, void *pGameData0, void *pGameData1 ) = 0; - virtual int ShouldSolvePenetration( IPhysicsObject *pObj0, IPhysicsObject *pObj1, void *pGameData0, void *pGameData1, float dt ) = 0; - - // pObject has already done the max number of collisions this tick, should we freeze it to save CPU? - virtual bool ShouldFreezeObject( IPhysicsObject *pObject ) = 0; - - // The system has already done too many collision checks, performance will suffer. - // How many more should it do? - virtual int AdditionalCollisionChecksThisTick( int currentChecksDone ) = 0; -}; - -enum PhysicsTraceType_t -{ - VPHYSICS_TRACE_EVERYTHING = 0, - VPHYSICS_TRACE_STATIC_ONLY, - VPHYSICS_TRACE_MOVING_ONLY, - VPHYSICS_TRACE_TRIGGERS_ONLY, - VPHYSICS_TRACE_STATIC_AND_MOVING, -}; - -abstract_class IPhysicsTraceFilter -{ -public: - virtual bool ShouldHitObject( IPhysicsObject *pObject, int contentsMask ) = 0; - virtual PhysicsTraceType_t GetTraceType() const = 0; -}; - -abstract_class IPhysicsEnvironment -{ -public: - virtual ~IPhysicsEnvironment( void ) {} - - virtual void SetDebugOverlay( CreateInterfaceFn debugOverlayFactory ) = 0; - virtual IVPhysicsDebugOverlay *GetDebugOverlay( void ) = 0; - - // gravity is a 3-vector in in/s^2 - virtual void SetGravity( const Vector &gravityVector ) = 0; - virtual void GetGravity( Vector &gravityVector ) = 0; - - // air density is in kg / m^3 (water is 1000) - // This controls drag, air that is more dense has more drag. - virtual void SetAirDensity( float density ) = 0; - virtual float GetAirDensity( void ) = 0; - - // object creation - // create a polygonal object. pCollisionModel was created by the physics builder DLL in a pre-process. - virtual IPhysicsObject *CreatePolyObject( const CPhysCollide *pCollisionModel, int materialIndex, const Vector &position, const QAngle &angles, objectparams_t *pParams ) = 0; - // same as above, but this one cannot move or rotate (infinite mass/inertia) - virtual IPhysicsObject *CreatePolyObjectStatic( const CPhysCollide *pCollisionModel, int materialIndex, const Vector &position, const QAngle &angles, objectparams_t *pParams ) = 0; - // Create a perfectly spherical object - virtual IPhysicsObject *CreateSphereObject( float radius, int materialIndex, const Vector &position, const QAngle &angles, objectparams_t *pParams, bool isStatic ) = 0; - // Create a polygonal fluid body out of the specified collision model - // This object will affect any other objects that collide with the collision model - virtual IPhysicsFluidController *CreateFluidController( IPhysicsObject *pFluidObject, fluidparams_t *pParams ) = 0; - - // Create a simulated spring that connects 2 objects - virtual IPhysicsSpring *CreateSpring( IPhysicsObject *pObjectStart, IPhysicsObject *pObjectEnd, springparams_t *pParams ) = 0; - - // Create a constraint in the space of pReferenceObject which is attached by the constraint to pAttachedObject - virtual IPhysicsConstraint *CreateRagdollConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_ragdollparams_t &ragdoll ) = 0; - virtual IPhysicsConstraint *CreateHingeConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_hingeparams_t &hinge ) = 0; - virtual IPhysicsConstraint *CreateFixedConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_fixedparams_t &fixed ) = 0; - virtual IPhysicsConstraint *CreateSlidingConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_slidingparams_t &sliding ) = 0; - virtual IPhysicsConstraint *CreateBallsocketConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_ballsocketparams_t &ballsocket ) = 0; - virtual IPhysicsConstraint *CreatePulleyConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_pulleyparams_t &pulley ) = 0; - virtual IPhysicsConstraint *CreateLengthConstraint( IPhysicsObject *pReferenceObject, IPhysicsObject *pAttachedObject, IPhysicsConstraintGroup *pGroup, const constraint_lengthparams_t &length ) = 0; - - virtual IPhysicsConstraintGroup *CreateConstraintGroup( const constraint_groupparams_t &groupParams ) = 0; - - // destroy an object created with CreatePolyObject() or CreatePolyObjectStatic() - virtual void DestroyObject( IPhysicsObject * ) = 0; - virtual void DestroySpring( IPhysicsSpring * ) = 0; - // Destroy an object created with CreateFluidController() - virtual void DestroyFluidController( IPhysicsFluidController * ) = 0; - virtual void DestroyConstraint( IPhysicsConstraint * ) = 0; - virtual void DestroyConstraintGroup( IPhysicsConstraintGroup *pGroup ) = 0; - - // install a function to filter collisions/penentration - virtual void SetCollisionSolver( IPhysicsCollisionSolver *pSolver ) = 0; - - // run the simulator for deltaTime seconds - virtual void Simulate( float deltaTime ) = 0; - // true if currently running the simulator (i.e. in a callback during physenv->Simulate()) - virtual bool IsInSimulation( void ) const = 0; - - // Manage the timestep (period) of the simulator. The main functions are all integrated with - // this period as dt. - virtual float GetSimulationTimestep( void ) = 0; - virtual void SetSimulationTimestep( float timestep ) = 0; - - // returns the current simulation clock's value. This is an absolute time. - virtual float GetSimulationTime( void ) = 0; - virtual void ResetSimulationClock( void ) = 0; - - // Collision callbacks (game code collision response) - virtual void SetCollisionEventHandler( IPhysicsCollisionEvent *pCollisionEvents ) = 0; - virtual void SetObjectEventHandler( IPhysicsObjectEvent *pObjectEvents ) = 0; - virtual void SetConstraintEventHandler( IPhysicsConstraintEvent *pConstraintEvents ) = 0; - - virtual IPhysicsShadowController *CreateShadowController( IPhysicsObject *pObject, bool allowTranslation, bool allowRotation ) = 0; - virtual void DestroyShadowController( IPhysicsShadowController * ) = 0; - - virtual IPhysicsPlayerController *CreatePlayerController( IPhysicsObject *pObject ) = 0; - virtual void DestroyPlayerController( IPhysicsPlayerController * ) = 0; - - virtual IPhysicsMotionController *CreateMotionController( IMotionEvent *pHandler ) = 0; - virtual void DestroyMotionController( IPhysicsMotionController *pController ) = 0; - - virtual IPhysicsVehicleController *CreateVehicleController( IPhysicsObject *pVehicleBodyObject, const vehicleparams_t ¶ms, unsigned int nVehicleType, IPhysicsGameTrace *pGameTrace ) = 0; - virtual void DestroyVehicleController( IPhysicsVehicleController * ) = 0; - - virtual void SetQuickDelete( bool bQuick ) = 0; - - virtual int GetActiveObjectCount( void ) = 0; - virtual void GetActiveObjects( IPhysicsObject **pOutputObjectList ) = 0; - - virtual void CleanupDeleteList( void ) = 0; - virtual void EnableDeleteQueue( bool enable ) = 0; - - // Save/Restore methods - virtual bool Save( const physsaveparams_t ¶ms ) = 0; - virtual void PreRestore( const physprerestoreparams_t ¶ms ) = 0; - virtual bool Restore( const physrestoreparams_t ¶ms ) = 0; - virtual void PostRestore() = 0; - - // Debugging: - virtual bool IsCollisionModelUsed( CPhysCollide *pCollide ) = 0; - - // Physics world version of the enginetrace API: - virtual void TraceRay( const Ray_t &ray, unsigned int fMask, IPhysicsTraceFilter *pTraceFilter, trace_t *pTrace ) = 0; - virtual void SweepCollideable( const CPhysCollide *pCollide, const Vector &vecAbsStart, const Vector &vecAbsEnd, - const QAngle &vecAngles, unsigned int fMask, IPhysicsTraceFilter *pTraceFilter, trace_t *pTrace ) = 0; - - // performance tuning - virtual void GetPerformanceSettings( physics_performanceparams_t *pOutput ) = 0; - virtual void SetPerformanceSettings( const physics_performanceparams_t *pSettings ) = 0; - - // perf/cost statistics - virtual void ReadStats( physics_stats_t *pOutput ) = 0; - virtual void ClearStats() = 0; -}; - -enum callbackflags -{ - CALLBACK_GLOBAL_COLLISION = 0x0001, - CALLBACK_GLOBAL_FRICTION = 0x0002, - CALLBACK_GLOBAL_TOUCH = 0x0004, - CALLBACK_GLOBAL_TOUCH_STATIC = 0x0008, - CALLBACK_SHADOW_COLLISION = 0x0010, - CALLBACK_GLOBAL_COLLIDE_STATIC = 0x0020, - CALLBACK_IS_VEHICLE_WHEEL = 0x0040, - CALLBACK_FLUID_TOUCH = 0x0100, - CALLBACK_NEVER_DELETED = 0x0200, // HACKHACK: This means this object will never be deleted (set on the world) - CALLBACK_MARKED_FOR_DELETE = 0x0400, // This allows vphysics to skip some work for this object since it will be - // deleted later this frame. (Set automatically by destroy calls) - CALLBACK_ENABLING_COLLISION = 0x0800, // This is active during the time an object is enabling collisions - // allows us to skip collisions between "new" objects and objects marked for delete - CALLBACK_DO_FLUID_SIMULATION = 0x1000, // remove this to opt out of fluid simulations - CALLBACK_IS_PLAYER_CONTROLLER= 0x2000, // HACKHACK: Set this on players until player cotrollers are unified with shadow controllers - CALLBACK_CHECK_COLLISION_DISABLE = 0x4000, - CALLBACK_MARKED_FOR_TEST = 0x8000, // debug -- marked object is being debugged -}; - -abstract_class IPhysicsObject -{ -public: - virtual ~IPhysicsObject( void ) {} - - // returns true if this object is static/unmoveable - // NOTE: returns false for objects that are not created static, but set EnableMotion(false); - // Call IsMoveable() to find if the object is static OR has motion disabled - virtual bool IsStatic( void ) = 0; - - // "wakes up" an object - // NOTE: ALL OBJECTS ARE "Asleep" WHEN CREATED - virtual void Wake( void ) = 0; - virtual void Sleep( void ) = 0; - virtual bool IsAsleep( void ) = 0; - - // Game can store data in each object (link back to game object) - virtual void SetGameData( void *pGameData ) = 0; - virtual void *GetGameData( void ) const = 0; - // This flags word can be defined by the game as well - virtual void SetGameFlags( unsigned short userFlags ) = 0; - virtual unsigned short GetGameFlags( void ) const = 0; - virtual void SetGameIndex( unsigned short gameIndex ) = 0; - virtual unsigned short GetGameIndex( void ) const = 0; - - // setup various callbacks for this object - virtual void SetCallbackFlags( unsigned short callbackflags ) = 0; - // get the current callback state for this object - virtual unsigned short GetCallbackFlags( void ) = 0; - - // mass accessors - virtual void SetMass( float mass ) = 0; - virtual float GetMass( void ) const = 0; - // get 1/mass (it's cached) - virtual float GetInvMass( void ) const = 0; - virtual Vector GetInertia( void ) const = 0; - virtual Vector GetInvInertia( void ) const = 0; - virtual void SetInertia( const Vector &inertia ) = 0; - - virtual void SetDamping( const float *speed, const float *rot ) = 0; - virtual void GetDamping( float *speed, float *rot ) = 0; - - // material index - virtual int GetMaterialIndex() const = 0; - virtual void SetMaterialIndex( int materialIndex ) = 0; - - // Enable / disable collisions for this object - virtual void EnableCollisions( bool enable ) = 0; - // Enable / disable gravity for this object - virtual void EnableGravity( bool enable ) = 0; - // Enable / disable air friction / drag for this object - virtual void EnableDrag( bool enable ) = 0; - // Enable / disable motion (pin / unpin the object) - virtual void EnableMotion( bool enable ) = 0; - - // call this when the collision filter conditions change due to this - // object's state (e.g. changing solid type or collision group) - virtual void RecheckCollisionFilter() = 0; - - // NOTE: These are here for convenience, but you can do them yourself by using the matrix - // returned from GetPositionMatrix() - // convenient coordinate system transformations (params - dest, src) - virtual void LocalToWorld( Vector *worldPosition, const Vector &localPosition ) = 0; - virtual void WorldToLocal( Vector *localPosition, const Vector &worldPosition ) = 0; - - // transforms a vector (no translation) from object-local to world space - virtual void LocalToWorldVector( Vector *worldVector, const Vector &localVector ) = 0; - // transforms a vector (no translation) from world to object-local space - virtual void WorldToLocalVector( Vector *localVector, const Vector &worldVector ) = 0; - - // push on an object - // force vector is direction & magnitude of impulse kg in / s - virtual void ApplyForceCenter( const Vector &forceVector ) = 0; - virtual void ApplyForceOffset( const Vector &forceVector, const Vector &worldPosition ) = 0; - - // Calculates the force/torque on the center of mass for an offset force impulse (pass output to ApplyForceCenter / ApplyTorqueCenter) - virtual void CalculateForceOffset( const Vector &forceVector, const Vector &worldPosition, Vector *centerForce, AngularImpulse *centerTorque ) = 0; - // Calculates the linear/angular velocities on the center of mass for an offset force impulse (pass output to AddVelocity) - virtual void CalculateVelocityOffset( const Vector &forceVector, const Vector &worldPosition, Vector *centerVelocity, AngularImpulse *centerAngularVelocity ) = 0; - - // apply torque impulse. This will change the angular velocity on the object. - // HL Axes, kg degrees / s - virtual void ApplyTorqueCenter( const AngularImpulse &torque ) = 0; - - // NOTE: This will teleport the object - virtual void SetPosition( const Vector &worldPosition, const QAngle &angles, bool isTeleport ) = 0; - virtual void SetPositionMatrix( const matrix3x4_t&matrix, bool isTeleport ) = 0; - - virtual void GetPosition( Vector *worldPosition, QAngle *angles ) = 0; - virtual void GetPositionMatrix( matrix3x4_t *positionMatrix ) = 0; - // force the velocity to a new value - // NOTE: velocity is in worldspace, angularVelocity is relative to the object's - // local axes (just like pev->velocity, pev->avelocity) - virtual void SetVelocity( const Vector *velocity, const AngularImpulse *angularVelocity ) = 0; - - // like the above, but force the change into the simulator immediately - virtual void SetVelocityInstantaneous( const Vector *velocity, const AngularImpulse *angularVelocity ) = 0; - - // NOTE: velocity is in worldspace, angularVelocity is relative to the object's - // local axes (just like pev->velocity, pev->avelocity) - virtual void GetVelocity( Vector *velocity, AngularImpulse *angularVelocity ) = 0; - - // NOTE: These are velocities, not forces. i.e. They will have the same effect regardless of - // the object's mass or inertia - virtual void AddVelocity( const Vector *velocity, const AngularImpulse *angularVelocity ) = 0; - virtual void GetVelocityAtPoint( const Vector &worldPosition, Vector &velocity ) = 0; - - virtual float GetEnergy() = 0; - - // returns true if the object is in contact with another object - // if true, puts a point on the contact surface in contactPoint, and - // a pointer to the object in contactObject - // NOTE: You can pass NULL for either to avoid computations - // JAY: This is still an experiment - virtual bool GetContactPoint( Vector *contactPoint, IPhysicsObject **contactObject ) = 0; - - // refactor this a bit - move some of this to IPhysicsShadowController - virtual void SetShadow( float maxSpeed, float maxAngularSpeed, bool allowPhysicsMovement, bool allowPhysicsRotation ) = 0; - virtual void UpdateShadow( const Vector &targetPosition, const QAngle &targetAngles, bool tempDisableGravity, float timeOffset ) = 0; - - // returns number of ticks since last Update() call - virtual int GetShadowPosition( Vector *position, QAngle *angles ) = 0; - virtual IPhysicsShadowController *GetShadowController( void ) const = 0; - - - virtual const CPhysCollide *GetCollide( void ) const = 0; - virtual const char *GetName() = 0; - virtual void RemoveShadowController() = 0; - virtual bool IsMoveable() = 0; - - // applies the math of the shadow controller to this object. - // for use in your own controllers - // returns the new value of secondsToArrival with dt time elapsed - virtual float ComputeShadowControl( const hlshadowcontrol_params_t ¶ms, float secondsToArrival, float dt ) = 0; - - // coefficients are optional, pass either - virtual void SetDragCoefficient( float *pDrag, float *pAngularDrag ) = 0; - - // Get the radius if this is a sphere object (zero if this is a polygonal mesh) - virtual float GetSphereRadius() = 0; - - virtual float CalculateLinearDrag( const Vector &unitDirection ) const = 0; - virtual float CalculateAngularDrag( const Vector &objectSpaceRotationAxis ) const = 0; - virtual void SetBuoyancyRatio( float ratio ) = 0; // Override bouyancy - - virtual void BecomeTrigger() = 0; - virtual void RemoveTrigger() = 0; - virtual bool IsTrigger() = 0; - virtual bool IsFluid() = 0; // fluids are special triggers with fluid controllers attached, they return true to IsTrigger() as well! - - // sets the object to be hinged. Fixed it place, but able to rotate around one axis. - virtual void BecomeHinged( int localAxis ) = 0; - // resets the object to original state - virtual void RemoveHinged() = 0; - virtual bool IsHinged() = 0; - - virtual unsigned int GetContents() = 0; - virtual void SetContents( unsigned int contents ) = 0; - virtual Vector GetMassCenterLocalSpace() = 0; - - // used to iterate the contact points of an object - virtual IPhysicsFrictionSnapshot *CreateFrictionSnapshot() = 0; - virtual void DestroyFrictionSnapshot( IPhysicsFrictionSnapshot *pSnapshot ) = 0; - - // dumps info about the object to Msg() - virtual void OutputDebugInfo() = 0; - virtual void GetImplicitVelocity( Vector *velocity, AngularImpulse *angularVelocity ) = 0; - // this is a hack to recheck current contacts - // some of them may not be valid if the object's collision rules have recently changed - // UNDONE: Force this in RecheckCollisionFilter() ? - virtual void RecheckContactPoints() = 0; -}; - - -abstract_class IPhysicsSpring -{ -public: - virtual ~IPhysicsSpring( void ) {} - virtual void GetEndpoints( Vector *worldPositionStart, Vector *worldPositionEnd ) = 0; - virtual void SetSpringConstant( float flSpringContant) = 0; - virtual void SetSpringDamping( float flSpringDamping) = 0; - virtual void SetSpringLength( float flSpringLenght) = 0; - - // Get the starting object - virtual IPhysicsObject *GetStartObject( void ) = 0; - - // Get the end object - virtual IPhysicsObject *GetEndObject( void ) = 0; -}; - - -//----------------------------------------------------------------------------- -// Purpose: These properties are defined per-material. This is accessible at -// each triangle in a collision mesh -//----------------------------------------------------------------------------- -struct surfacephysicsparams_t -{ -// vphysics physical properties - float friction; - float elasticity; // collision elasticity - used to compute coefficient of restitution - float density; // physical density (in kg / m^3) - float thickness; // material thickness if not solid (sheet materials) in inches - float dampening; -}; - -struct surfaceaudioparams_t -{ -// sounds / audio data - float reflectivity; // like elasticity, but how much sound should be reflected by this surface - float hardnessFactor; // like elasticity, but only affects impact sound choices - float roughnessFactor; // like friction, but only affects scrape sound choices - -// audio thresholds - float roughThreshold; // surface roughness > this causes "rough" scrapes, < this causes "smooth" scrapes - float hardThreshold; // surface hardness > this causes "hard" impacts, < this causes "soft" impacts - float hardVelocityThreshold; // collision velocity > this causes "hard" impacts, < this causes "soft" impacts - // NOTE: Hard impacts must meet both hardnessFactor AND velocity thresholds -}; - -struct surfacesoundnames_t -{ - unsigned short stepleft; - unsigned short stepright; - - unsigned short impactSoft; - unsigned short impactHard; - - unsigned short scrapeSmooth; - unsigned short scrapeRough; - - unsigned short bulletImpact; - unsigned short rolling; - - unsigned short breakSound; - unsigned short strainSound; -}; - -struct surfacegameprops_t -{ -// game movement data - float maxSpeedFactor; // Modulates player max speed when walking on this surface - float jumpFactor; // Indicates how much higher the player should jump when on the surface -// Game-specific data - unsigned short material; - // Indicates whether or not the player is on a ladder. - unsigned char climbable; - unsigned char pad; -}; - -//----------------------------------------------------------------------------- -// Purpose: Each different material has an entry like this -//----------------------------------------------------------------------------- -struct surfacedata_t -{ - surfacephysicsparams_t physics; // physics parameters - surfaceaudioparams_t audio; // audio parameters - surfacesoundnames_t sounds; // names of linked sounds - surfacegameprops_t game; // Game data / properties - - -}; - -#define VPHYSICS_SURFACEPROPS_INTERFACE_VERSION_1 "VPhysicsSurfaceProps001" -abstract_class IPhysicsSurfaceProps -{ -public: - virtual ~IPhysicsSurfaceProps( void ) {} - - // parses a text file containing surface prop keys - virtual int ParseSurfaceData( const char *pFilename, const char *pTextfile ) = 0; - // current number of entries in the database - virtual int SurfacePropCount( void ) = 0; - - virtual int GetSurfaceIndex( const char *pSurfacePropName ) = 0; - virtual void GetPhysicsProperties( int surfaceDataIndex, float *density, float *thickness, float *friction, float *elasticity ) = 0; - - virtual surfacedata_t *GetSurfaceData( int surfaceDataIndex ) = 0; - virtual const char *GetString( unsigned short stringTableIndex ) = 0; - - - virtual const char *GetPropName( int surfaceDataIndex ) = 0; - - // sets the global index table for world materials - virtual void SetWorldMaterialIndexTable( int *pMapArray, int mapSize ) = 0; - - // NOTE: Same as GetPhysicsProperties, but maybe more convenient - virtual void GetPhysicsParameters( int surfaceDataIndex, surfacephysicsparams_t *pParamsOut ) = 0; -}; - -abstract_class IPhysicsFluidController -{ -public: - virtual ~IPhysicsFluidController( void ) {} - - virtual void SetGameData( void *pGameData ) = 0; - virtual void *GetGameData( void ) const = 0; - - virtual void GetSurfacePlane( Vector *pNormal, float *pDist ) = 0; - virtual float GetDensity() = 0; - virtual void WakeAllSleepingObjects() = 0; - virtual int GetContents() const = 0; -}; - - -//----------------------------------------------------------------------------- -// Purpose: parameter block for creating fluid dynamic motion -// UNDONE: Expose additional fluid model paramters? -//----------------------------------------------------------------------------- -struct fluidparams_t -{ - Vector4D surfacePlane; // x,y,z normal, dist (plane constant) fluid surface - Vector currentVelocity; // velocity of the current in inches/second - float damping; // damping factor for buoyancy (tweak) - float torqueFactor; - float viscosityFactor; - void *pGameData; - bool useAerodynamics;// true if this controller should calculate surface pressure - int contents; - - fluidparams_t() {} - fluidparams_t( fluidparams_t const& src ) - { - Vector4DCopy( src.surfacePlane, surfacePlane ); - VectorCopy( src.currentVelocity, currentVelocity ); - damping = src.damping; - torqueFactor = src.torqueFactor; - viscosityFactor = src.viscosityFactor; - contents = src.contents; - } -}; - -//----------------------------------------------------------------------------- -// Purpose: parameter block for creating linear springs -// UNDONE: Expose additional spring model paramters? -//----------------------------------------------------------------------------- -struct springparams_t -{ - springparams_t() - { - memset( this, 0, sizeof(*this) ); - } - float constant; // spring constant - float naturalLength;// relaxed length - float damping; // damping factor - float relativeDamping; // relative damping (damping proportional to the change in the relative position of the objects) - Vector startPosition; - Vector endPosition; - bool useLocalPositions; // start & end Position are in local space to start and end objects if this is true - bool onlyStretch; // only apply forces when the length is greater than the natural length -}; - -//----------------------------------------------------------------------------- -// Purpose: parameter block for creating polygonal objects -//----------------------------------------------------------------------------- -struct objectparams_t -{ - Vector *massCenterOverride; - float mass; - float inertia; - float damping; - float rotdamping; - float rotInertiaLimit; - const char *pName; // used only for debugging - void *pGameData; - float volume; - float dragCoefficient; - bool enableCollisions; -}; - -struct convertconvexparams_t -{ - bool buildOuterConvexHull; - bool buildDragAxisAreas; - bool buildOptimizedTraceTables; - float dragAreaEpsilon; - CPhysConvex *pForcedOuterHull; - - void Defaults() - { - dragAreaEpsilon = 0.25f; // 0.5in x 0.5in square - buildOuterConvexHull = false; - buildDragAxisAreas = false; - buildOptimizedTraceTables = false; - pForcedOuterHull = NULL; - } -}; - -//----------------------------------------------------------------------------- -// Physics interface IDs -// -// Note that right now the order of the enum also defines the order of save/load - - -//----------------------------------------------------------------------------- -// Purpose: parameter blocks for save and load operations -//----------------------------------------------------------------------------- -struct physsaveparams_t -{ - ISave *pSave; - void *pObject; - PhysInterfaceId_t type; -}; - -struct physrestoreparams_t -{ - IRestore *pRestore; - void **ppObject; - PhysInterfaceId_t type; - void *pGameData; - const char *pName; // used only for debugging - const CPhysCollide *pCollisionModel; - IPhysicsEnvironment *pEnvironment; - IPhysicsGameTrace *pGameTrace; -}; - -struct physrecreateparams_t -{ - void *pOldObject; - void *pNewObject; -}; - -struct physprerestoreparams_t -{ - int recreatedObjectCount; - physrecreateparams_t recreatedObjectList[1]; -}; - - -//------------------------------------- - -#define DEFINE_PIID( type, enumval ) \ - template <> inline PhysInterfaceId_t GetPhysIID( type ** ) { return enumval; } - -template inline PhysInterfaceId_t GetPhysIID(PHYSPTR **); // will get link error if no match - -DEFINE_PIID( IPhysicsObject, PIID_IPHYSICSOBJECT ); -DEFINE_PIID( IPhysicsFluidController, PIID_IPHYSICSFLUIDCONTROLLER ); -DEFINE_PIID( IPhysicsSpring, PIID_IPHYSICSSPRING ); -DEFINE_PIID( IPhysicsConstraintGroup, PIID_IPHYSICSCONSTRAINTGROUP ); -DEFINE_PIID( IPhysicsConstraint, PIID_IPHYSICSCONSTRAINT ); -DEFINE_PIID( IPhysicsShadowController, PIID_IPHYSICSSHADOWCONTROLLER ); -DEFINE_PIID( IPhysicsPlayerController, PIID_IPHYSICSPLAYERCONTROLLER ); -DEFINE_PIID( IPhysicsMotionController, PIID_IPHYSICSMOTIONCONTROLLER ); -DEFINE_PIID( IPhysicsVehicleController, PIID_IPHYSICSVEHICLECONTROLLER ); -DEFINE_PIID( IPhysicsGameTrace, PIID_IPHYSICSGAMETRACE ); - -//----------------------------------------------------------------------------- - -} // end namespace VPhysicsInterfaceV30 - -#endif // VPHYSICS_INTERFACE_V30_H