IVehicle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 22: Line 22:
  }
  }
==See Also==
==See Also==
* {{doxygen|_i_vehicle_8h-source.html|IVehicle.h on HL2 SDK Doxygen}}
* {{doxygen|_i_vehicle_8h-source.html IVehicle.h on HL2 SDK Doxygen}}
[[Category:Interfaces]]
[[Category:Interfaces]]

Revision as of 06:19, 2 August 2006

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

See Also