Solid Controller class, that handles vehicles with suspension This allows for a more dynamic behaviour of the vehicles and allows for bumpy roads, slopes or even loops This controller also offers easier extendability thanks to the SolidBehaviourExtender. If you want to create a vehicle using this controller, you'll need to setup its suspension correctly, and pay attention to the weight repartition. For that, you can simply duplicate one of the demo vehicles, or have a look at the documentation that explains how to setup a vehicle, step by step.
More...
|
| Gears | CurrentGear [getprotected set] |
| | The current gear value. More...
|
| |
| Vector3 | CurrentEngineForceValue [getprotected set] |
| | Current engine force value used by wheels. More...
|
| |
| virtual bool | IsOffRoad [get] |
| | Gets a value indicating whether this car is offroad. More...
|
| |
| virtual float | NormalizedSpeed [get] |
| | Gets the normalized speed. More...
|
| |
| virtual bool | Forward [get] |
| | Returns true if vehicle is going forward More...
|
| |
| virtual bool | Braking [get] |
| | Returns true if vehicle is braking More...
|
| |
| virtual float | HorizontalAngle [get] |
| | Returns the current angle of the car to the horizon. Used, for example, to disable AI's direction when the vehicle goes over a certain angle. allows for easier loop handling More...
|
| |
| virtual float | ForwardNormalizedSpeed [get] |
| | Gets the forward normalized speed. Used to evaluate the engine's power More...
|
| |
| virtual float | SlideSpeed [getprotected set] |
| | The current lateral speed value of the vehicle. More...
|
| |
| int | CurrentLap [getprotected set] |
| | Returns the current lap. More...
|
| |
| float | CurrentSteeringAmount [getset] |
| | Gets or sets the current steering amount from -1 (full left) to 1 (full right). 0 when none. More...
|
| |
| float? | CurrentGasPedalAmount [getset] |
| | Gets or sets the current gas pedal amount. 1 for full acceleration. -1 for full brake or reverse. 0 for nothing. More...
|
| |
| virtual bool | IsPlaying [getprotected set] |
| | Gets or sets a value indicating whether this user is playing. More...
|
| |
| virtual bool | IsGrounded [getprotected set] |
| | Gets or sets a value indicating whether this instance is grounded. More...
|
| |
| virtual bool | IsOnSpeedBoost [getprotected set] |
| | Gets or sets a value indicating whether this instance is on speed boost. More...
|
| |
| virtual float | Speed [get] |
| | Gets the vehicle speed. More...
|
| |
| virtual int | Score [get] |
| | Gets the player score. More...
|
| |
| virtual float | DistanceToNextWaypoint [get] |
| | Gets the distance to the next waypoint. More...
|
| |
| int | FinalRank [get] |
| | Gets the final rank. 0 if vehicle has not ended. More...
|
| |
Solid Controller class, that handles vehicles with suspension This allows for a more dynamic behaviour of the vehicles and allows for bumpy roads, slopes or even loops This controller also offers easier extendability thanks to the SolidBehaviourExtender. If you want to create a vehicle using this controller, you'll need to setup its suspension correctly, and pay attention to the weight repartition. For that, you can simply duplicate one of the demo vehicles, or have a look at the documentation that explains how to setup a vehicle, step by step.
◆ Gears
Gears enum. Car can be forward driving or backward driving (reverse)
| Enumerator |
|---|
| forward | |
| reverse | |
◆ Awake()
| override void MoreMountains.HighroadEngine.SolidController.Awake |
( |
| ) |
|
|
protectedvirtual |
◆ FixedUpdate()
| virtual void MoreMountains.HighroadEngine.SolidController.FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
Fixed update. We apply physics and input evaluation.
◆ OnCollisionEnter()
| virtual void MoreMountains.HighroadEngine.SolidController.OnCollisionEnter |
( |
Collision |
other | ) |
|
|
protectedvirtual |
Raises the collision enter event.
- Parameters
-
◆ OnDrawGizmos()
| virtual void MoreMountains.HighroadEngine.SolidController.OnDrawGizmos |
( |
| ) |
|
|
protectedvirtual |
◆ Respawn()
| override void MoreMountains.HighroadEngine.SolidController.Respawn |
( |
| ) |
|
|
virtual |
◆ Start()
| override void MoreMountains.HighroadEngine.SolidController.Start |
( |
| ) |
|
|
protectedvirtual |
◆ Update()
| virtual void MoreMountains.HighroadEngine.SolidController.Update |
( |
| ) |
|
|
protectedvirtual |
◆ UpdateAirRotation()
| virtual void MoreMountains.HighroadEngine.SolidController.UpdateAirRotation |
( |
| ) |
|
|
protectedvirtual |
Handles rotation of the vehicle in the air
◆ UpdateEngineForceValue()
| virtual void MoreMountains.HighroadEngine.SolidController.UpdateEngineForceValue |
( |
| ) |
|
|
protectedvirtual |
Computes the engine's power. This value can be used by a wheel to apply force if conditions are met
◆ UpdateGroundSituation()
| virtual void MoreMountains.HighroadEngine.SolidController.UpdateGroundSituation |
( |
| ) |
|
|
protectedvirtual |
Updates the ground situation for this car.
◆ UpdateSlideForce()
| virtual void MoreMountains.HighroadEngine.SolidController.UpdateSlideForce |
( |
| ) |
|
|
protectedvirtual |
Applies slide force to the vehicle
◆ UpdateTorqueRotation()
| virtual void MoreMountains.HighroadEngine.SolidController.UpdateTorqueRotation |
( |
| ) |
|
|
protectedvirtual |
Applies a torque force to the vehicle when the user wants to turn
◆ _damperForce
| float MoreMountains.HighroadEngine.SolidController._damperForce = 0f |
|
protected |
◆ _groundGameObject
| GameObject MoreMountains.HighroadEngine.SolidController._groundGameObject |
|
protected |
◆ _hit
| RaycastHit MoreMountains.HighroadEngine.SolidController._hit |
|
protected |
◆ _noLayerMask
| LayerMask MoreMountains.HighroadEngine.SolidController._noLayerMask = ~0 |
|
protected |
◆ _springForce
| float MoreMountains.HighroadEngine.SolidController._springForce = 0f |
|
protected |
◆ _startPosition
| Vector3 MoreMountains.HighroadEngine.SolidController._startPosition |
|
protected |
◆ _startRotation
| Quaternion MoreMountains.HighroadEngine.SolidController._startRotation |
|
protected |
◆ BackwardForceCurve
| AnimationCurve MoreMountains.HighroadEngine.SolidController.BackwardForceCurve |
Rotation force when going backward.
◆ CarGrip
| float MoreMountains.HighroadEngine.SolidController.CarGrip = 10f |
the wheel's grip force. The higher the value, the less the car will slide when turning
◆ CenterOfMass
| Vector3 MoreMountains.HighroadEngine.SolidController.CenterOfMass = new Vector3(0, -1, 0) |
Point of gravity of the car is set below. This helps the Unity Physics with car stability.
◆ DamperConstant
| float MoreMountains.HighroadEngine.SolidController.DamperConstant = 2000f |
◆ EngineForce
| float MoreMountains.HighroadEngine.SolidController.EngineForce = 1000 |
◆ ForwardForceHeight
| float MoreMountains.HighroadEngine.SolidController.ForwardForceHeight = 1f |
The height at which forward force will be applied.
◆ FullThrottleVelocity
| float MoreMountains.HighroadEngine.SolidController.FullThrottleVelocity = 30 |
The speed above which the vehicle is considered as going full throttle. The vehicle's speed can be higher than that.
◆ GripSpeedFactor
| float MoreMountains.HighroadEngine.SolidController.GripSpeedFactor = 0.02f |
Grip factor multiplier. The higher that value, the more this vehicle will stick to the road, even at high speeds.
◆ GroundDistance
| float MoreMountains.HighroadEngine.SolidController.GroundDistance = 1f |
The distance to the ground at which we consider the car is grounded.
◆ MaxGripValue
| int MoreMountains.HighroadEngine.SolidController.MaxGripValue = 100 |
The vehicle's maximum grip value.
◆ MinimalTurningSpeed
| float MoreMountains.HighroadEngine.SolidController.MinimalTurningSpeed = 1f |
The minimum required speed for the vehicle to turn.
◆ OffroadPenaltyFactor
| float MoreMountains.HighroadEngine.SolidController.OffroadPenaltyFactor = 2f |
the penalty applied when going offroad
◆ OnCollisionEnterWithOther
| UnityAction<Collision> MoreMountains.HighroadEngine.SolidController.OnCollisionEnterWithOther |
An event triggered when the vehicle collides with something.
◆ OnRespawn
| UnityAction MoreMountains.HighroadEngine.SolidController.OnRespawn |
An event triggered when the vehicle is respawned.
◆ RadiusWheel
| float MoreMountains.HighroadEngine.SolidController.RadiusWheel = 0.5f |
◆ RestLength
| float MoreMountains.HighroadEngine.SolidController.RestLength = 0.5f |
The length of the suspension spring when resting.
◆ SpringConstant
| float MoreMountains.HighroadEngine.SolidController.SpringConstant = 20000f |
◆ SpringTorqueForce
| float MoreMountains.HighroadEngine.SolidController.SpringTorqueForce = 1000f |
The horizontal rotation force that will angle the car left or right to simulate spring compression when turning.
◆ TorqueCurve
| AnimationCurve MoreMountains.HighroadEngine.SolidController.TorqueCurve |
Additional torque force based on speed.
◆ Braking
| virtual bool MoreMountains.HighroadEngine.SolidController.Braking |
|
get |
Returns true if vehicle is braking
true if braking; otherwise, false.
◆ CurrentEngineForceValue
| Vector3 MoreMountains.HighroadEngine.SolidController.CurrentEngineForceValue |
|
getprotected set |
Current engine force value used by wheels.
◆ CurrentGear
| Gears MoreMountains.HighroadEngine.SolidController.CurrentGear |
|
getprotected set |
◆ Forward
| virtual bool MoreMountains.HighroadEngine.SolidController.Forward |
|
get |
Returns true if vehicle is going forward
true if forward; otherwise, false.
◆ ForwardNormalizedSpeed
| virtual float MoreMountains.HighroadEngine.SolidController.ForwardNormalizedSpeed |
|
get |
Gets the forward normalized speed. Used to evaluate the engine's power
The forward normalized speed.
◆ HorizontalAngle
| virtual float MoreMountains.HighroadEngine.SolidController.HorizontalAngle |
|
get |
Returns the current angle of the car to the horizon. Used, for example, to disable AI's direction when the vehicle goes over a certain angle. allows for easier loop handling
The horizontal angle.
◆ IsOffRoad
| virtual bool MoreMountains.HighroadEngine.SolidController.IsOffRoad |
|
get |
Gets a value indicating whether this car is offroad.
◆ NormalizedSpeed
| virtual float MoreMountains.HighroadEngine.SolidController.NormalizedSpeed |
|
get |
Gets the normalized speed.
The normalized speed.
◆ SlideSpeed
| virtual float MoreMountains.HighroadEngine.SolidController.SlideSpeed |
|
getprotected set |
The current lateral speed value of the vehicle.
The documentation for this class was generated from the following file:
- E:/Github/Store/HighroadEngine/Assets/HighroadEngine/Common/Scripts/Vehicles/Solid/SolidController.cs