Difference between revisions of "IVehicle"

From Valve Developer Community
Jump to: navigation, search
m (SPAM revert)
m (Removed "localhost" Doxygen link)
 
Line 22: Line 22:
 
  virtual void [[ItemPostFrame]]( CBasePlayer *pPlayer ) = 0;
 
  virtual void [[ItemPostFrame]]( CBasePlayer *pPlayer ) = 0;
 
  }
 
  }
 
== See also ==
 
* {{doxygen|_i_vehicle_8h-source.html IVehicle.h on HL2 SDK Doxygen}}
 
  
 
[[Category:Interfaces]]
 
[[Category:Interfaces]]

Latest revision as of 20:21, 30 June 2008

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;
}