You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.8 KiB
55 lines
1.8 KiB
//========= Copyright © 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
|