csgo-2018-source/public/vphysics/player_controller.h

56 lines
1.8 KiB
C
Raw Permalink Normal View History

2021-07-24 21:11:47 -07:00
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef PLAYER_CONTROLLER_H
#define PLAYER_CONTROLLER_H
#ifdef _WIN32
#pragma once
#endif
class IPhysicsPlayerControllerEvent
{
public:
virtual int ShouldMoveTo( IPhysicsObject *pObject, const Vector &position ) = 0;
};
enum PlayerContactState_t
{
PLAYER_CONTACT_PHYSICS = 1,
PLAYER_CONTACT_GAMEOBJECT = 2,
};
class IPhysicsPlayerController
{
public:
virtual ~IPhysicsPlayerController( void ) {}
virtual void Update( const Vector &position, const Vector &velocity, float secondsToArrival, bool onground, IPhysicsObject *ground ) = 0;
virtual void SetEventHandler( IPhysicsPlayerControllerEvent *handler ) = 0;
virtual bool IsInContact( void ) = 0;
virtual void MaxSpeed( const Vector &maxVelocity ) = 0;
// allows game code to change collision models
virtual void SetObject( IPhysicsObject *pObject ) = 0;
// UNDONE: Refactor this and shadow controllers into a single class/interface through IPhysicsObject
virtual int GetShadowPosition( Vector *position, QAngle *angles ) = 0;
virtual void StepUp( float height ) = 0;
virtual void Jump() = 0;
virtual void GetShadowVelocity( Vector *velocity ) = 0;
virtual IPhysicsObject *GetObject() = 0;
virtual void GetLastImpulse( Vector *pOut ) = 0;
virtual void SetPushMassLimit( float maxPushMass ) = 0;
virtual void SetPushSpeedLimit( float maxPushSpeed ) = 0;
virtual float GetPushMassLimit() = 0;
virtual float GetPushSpeedLimit() = 0;
virtual bool WasFrozen() = 0;
// returns bitfield e.g. 0 (no contacts), 1 (has physics contact), 2 (contact matching nGameFlags), 3 (both 1 & 2)
virtual uint32 GetContactState( uint16 nGameFlags ) = 0;
};
#endif // PLAYER_CONTROLLER_H