class CarSource
Car › Transport › Pawn › EntityAI › Entity › ObjectTyped › Object › IEntity › Managed
All members, including inherited
Native class for cars - handles physics simulation
Methods 69
protected override event typename GetOwnerStateType()protected override event typename GetMoveType()proto native float GetSpeedometer()Returns the current speed of the vehicle in km/h.
float GetSpeedometerAbsolute()Returns the current speed of the vehicle in km/h. Value is absolute
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7)override Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7)Show 2 more
, IsAreaAtDoorFree(), and Shape.SetMatrix()protected bool DetectFlippedUsingWheels(VehicleFlippedContext ctx, bool disallowSide)Show 2 more
, WheelHasContact(), and vector.Upproto native float GetSteering()Returns the current steering value in range <-1, 1>.
Sets the future steering value.
proto native float GetThrottle()Returns the actual throttle value in range <0, 1>.
proto native void SetThrottle(float value)Sets the future throttle value.
proto native int GetClutch()Returns the value of how much the clutch is disengaged.
proto native void SetClutch(float value)Sets the future clutch value.
proto native float GetBrake()Returns the current brake value in range <0, 1>.
Sets the future brake value
proto native float GetHandbrake()Returns the current handbrake value in range <0, 1>.
proto native void SetHandbrake(float value)Sets the future handbrake value
proto native void SetBrakesActivateWithoutDriver(bool activate = true)Sets if brakes should activate without a driver present
proto native float EngineGetRPMMin()Returns engine's min operating rpm
proto native float EngineGetRPMIdle()Returns engine's idle rpm before engine stalls.
proto native float EngineGetRPMMax()Returns engine's max rpm before engine blows up.
proto native float EngineGetRPMRedline()Returns engine's maximal working rpm without damaging the engine.
Show 1 more
, CarScript.OnInput()proto native float EngineGetRPM()Returns engine's rpm value.
proto native bool EngineIsOn()Returns true when engine is running, false otherwise.
Show 14 more
, CarScript.EEItemDetached(), CarScript.EOnPostSimulate(), CarScript.GetDebugText(), CarScript.OnInput(), CarScript.UpdateBattery(), CarScript.UpdateLightsClient(), CarScript.UpdateLightsServer(), CivilianSedan.CanReleaseAttachment(), Environment.DetermineHeatcomfortBehavior(), Hatchback_02.CanReleaseAttachment(), Offroad_02.CanReleaseAttachment(), OffroadHatchback.CanReleaseAttachment(), Sedan_02.CanReleaseAttachment(), and Truck_01_Base.CanReleaseAttachment()proto native void EngineStop()Stops the engine.
proto native vector GetEnginePos()Get actual position of engine (model space)
proto native void SetEnginePos(vector pos)Override the position of engine (model space)
proto native int GetCurrentGear()Returns the index of the current gear, -1 if there is no engine.
proto native int GetGear()Returns the index of the future gear, -1 if there is no engine.
Show 2 more
, CarScript.UpdateLightsClient(), and CarScript.UpdateLightsServer()proto native int GetNeutralGear()Returns the index of the neutral gear.
proto native void ShiftUp()Shifts the future gear up, triggering gearbox simulation.
proto native void ShiftTo(int gear)Shifts the future gear to selected gear, triggering gearbox simulation.
proto native void ShiftDown()Shifts the future gear down, triggering gearbox simulation.
proto native CarGearboxType GearboxGetType()Returns gearbox type. See CarGearboxType enum for more info.
proto native CarAutomaticGearboxMode GearboxGetMode()Returns gearbox mode. This is useful when car has automatic gearbox.
proto native bool WheelIsAnyLocked()Returns true if any of the wheels are locked in terms of its movement.
Returns the raw angular velocity of the wheel, unstable value
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns true if given wheel is making any contact
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns the position of contact in world space, only valid if there was an actual contact
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns the normal of contact in world space, only valid if there was an actual contact
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns the direction pointing forwards that the wheel is facing
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
proto native SurfaceInfo WheelGetSurface(int wheelIdx)Returns the surface that the wheel is nearby
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
proto native CarWheelWaterState WheelGetWaterState(int wheelIdx)Returns the state that the wheel is in with water
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns the entity attached that represents the wheel
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
Returns true if given wheel is locked in terms of its movement.
- in
wheelIdx - index of the wheel, they are counted from left-front to rear-right
proto native int WheelCount()How many wheel can be attached to a car (hubs only)
proto native int WheelCountPresent()Number of actually attached wheels (hubs only)
Returns tank capacity for the specified vehicle's fluid.
fluid- the specified fluid type
Show 3 more
, CAContinuousFillOil.Setup(), CarScript.EEOnCECreate(), and CarScript.OnAction()Returns fraction value (in range <0, 1>) of the current state of the specified vehicle's fluid.
- in
fluid - the specified fluid type
Show 10 more
, ActionFillOil.ActionCondition(), CAContinuousFillBrakes.Setup(), CAContinuousFillCoolant.Setup(), CAContinuousFillFuel.Setup(), CAContinuousFillOil.Setup(), CarHud.RefreshVehicleHud(), CarRadiator.EEKilled(), CarScript.CheckOperationalRequirements(), CarScript.EOnPostSimulate(), and CarScript.OnEngineStop()Removes from the specified fluid the specified amount.
proto native void LeakAll(CarFluid fluid)Removes all the specified fluid from vehicle.
Adds to the specified fluid the specified amount.
bool OnBeforeEngineStart()Is called every time the game wants to start the engine.
Returns: true if the engine can start, false otherwise.
void OnEngineStart()Is called every time the engine starts.
void OnEngineStop()Is called every time the engine stops.
Is called every time when the simulation changed gear.
- in
newGear - new gear level
- in
oldGear - previous gear level before gear shift
Is called every time when the specified vehicle's fluid level changes. This callback is called on owner only.
- in
fluid - fluid identifier, \see CarFluid
- in
newValue - new fluid level
- in
oldValue - previous fluid level before change
float OnSound(CarSoundCtrl ctrl, float oldValue)Is called every sound simulation step. In this callback, user can modify behaviour of sound controllers.
- in
ctrl - sound controller identifier, \see CarSoundCtrl
- in
oldValue - already computed value by the game code
Returns: new value of the specified sound controller.
proto native void ForcePosition(vector pos)proto native void ForceDirection(vector dir)proto native CarController GetController()proto native float GetThrustTurbo()proto native float GetThrustGentle()proto native float GetThrust()proto native void SetClutchState(bool in)proto native int GetGearsCount()