IVehicle

From Valve Developer Community
Jump to: navigation, search

This interface class is defined in src\game_shared\IVehicle.h. This class is the interface from which vehicles are derived. It is used by the player to access vehicles.

class IVehicle
{
public:
	// Get and set the current driver. Use PassengerRole_t enum in shareddefs.h for adding passengers
	virtual CBasePlayer*	GetPassenger( int nRole = VEHICLE_DRIVER ) = 0;
	virtual int				GetPassengerRole( CBasePlayer *pPassenger ) = 0;
	
	// Where is the passenger seeing from?
	virtual void			GetVehicleViewPosition( int nRole, Vector *pOrigin, QAngle *pAngles ) = 0;

	// Does the player use his normal weapons while in this mode?
	virtual bool			IsPassengerUsingStandardWeapons( int nRole = VEHICLE_DRIVER ) = 0;

	// Process movement
	virtual void			SetupMove( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ) = 0;
	virtual void			ProcessMovement( CBasePlayer *pPlayer, CMoveData *pMoveData ) = 0;
	virtual void			FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move ) = 0;

	// Process input
	virtual void			ItemPostFrame( CBasePlayer *pPlayer ) = 0;
}