IVehicle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(spam)
m (Removed "localhost" Doxygen link)
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This interface class is defined in <code>src\game_shared\IVehicle.h</code>. This class is the interface from which vehicles are derived. It is used by the player to access vehicles.
This interface class is defined in <code>src\game_shared\IVehicle.h</code>. This class is the interface from which vehicles are derived. It is used by the player to access vehicles.
  class IVehicle
  class IVehicle
  {
  {
Line 21: 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 13: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;
}