Highroad Engine v1.3
|
Car controller class. Manages inputs from InputManager and driving evaluation You can customize the car properties for different types of cars More...
Public Types | |
enum | Gears { forward , reverse } |
Gears enum. Car can be forward driving or backward driving (reverse) More... | |
Public Attributes | |
float | MaximumVelocity = 20f |
the car's maximum speed More... | |
float | Acceleration = 100f |
the engine's force More... | |
float | BrakeForce = 10f |
the intensity of the brakes More... | |
float | OffroadFactor = 2f |
the penalty applied when going offroad More... | |
Vector3 | CenterOfMass = new Vector3(0,-1,0) |
float | CarGroundDistance = 0.1f |
Public Attributes inherited from MoreMountains.HighroadEngine.BaseController | |
float | BoostForce = 1f |
the force applied when the vehicle is in a boost zone More... | |
float | RigidBodyDragInLoop = 1f |
The temporary value of rigidbody.drag when the vehicle is inside a loop zone. This allows for better movement inside the loop. More... | |
float | SteeringSpeed = 100f |
the speed at which the car steers More... | |
bool | AutoForward = false |
Set this to true if you want the vehicle to accelerate forever. More... | |
Protected Member Functions | |
override void | Awake () |
Physics initialization More... | |
virtual void | Update () |
Update More... | |
virtual void | ShowDebugInformation () |
Shows the debug information. Optionnal. Can be used during tests to show vehicle values More... | |
virtual void | UpdateGroundSituation () |
Updates the ground situation for this car. More... | |
virtual void | FixedUpdate () |
Fixed update. We apply physics and input evaluation. More... | |
virtual void | Accelerate () |
Manages the acceleration of the car (forward or reverse) More... | |
virtual void | Brake () |
Brake force More... | |
virtual void | Steer () |
Steer evaluation. We get steering value and apply rotation accordingly More... | |
Protected Member Functions inherited from MoreMountains.HighroadEngine.BaseController | |
virtual void | Start () |
Initializes checkpoints More... | |
Protected Attributes | |
Vector3 | _currentVelocity |
Current car velocity. More... | |
float | _distanceToTheGroundRaycastLength = 50f |
Vector3 | _gravity = new Vector3(0,-30,0) |
Protected Attributes inherited from MoreMountains.HighroadEngine.BaseController | |
Rigidbody | _rigidbody |
Collider | _collider |
RaceManager | _raceManager |
Transform[] | _checkpoints |
int | _currentWaypoint = 0 |
int | _lastWaypointCrossed = -1 |
float | _defaultDrag |
int | _controllerId = -1 |
int | _finisherPosition = 0 |
αΊ€hen > 0, vehicle has finished the race. This is it final rank. More... | |
float | _currentGasPedalAmount |
Static Protected Attributes | |
const float | _smallValue = 0.01f |
const float | _minimalGasPedalValue = 20f |
Properties | |
Gears | CurrentGear [getprotected set] |
The current gear value. More... | |
virtual float | DistanceToTheGround [getset] |
Gets or sets the distance to the ground. More... | |
virtual GameObject | GroundGameObject [getset] |
Gets or sets the ground game object. More... | |
virtual bool | IsOffRoad [get] |
Gets a value indicating whether this car is off road. More... | |
virtual float | NormalizedSpeed [get] |
Gets the normalized speed. More... | |
Properties inherited from MoreMountains.HighroadEngine.BaseController | |
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... | |
Additional Inherited Members | |
Public Member Functions inherited from MoreMountains.HighroadEngine.BaseController | |
virtual bool | HasJustFinished (int finalRankPosition) |
Gets a value indicating whether this vehicle has just finished the race. This property will return true only once. More... | |
virtual void | MainActionPressed () |
Button Main Action is being pressed More... | |
virtual void | MainActionDown () |
Button Main Action is pressed down More... | |
virtual void | MainActionReleased () |
Button Main Action is released More... | |
virtual void | AltActionPressed () |
Button Alt Action is being pressed More... | |
virtual void | AltActionDown () |
Button Alt Action is pressed down More... | |
virtual void | AltActionReleased () |
Button Alt Action is released More... | |
virtual void | RespawnActionPressed () |
Button Respawn Action is being pressed More... | |
virtual void | RespawnActionDown () |
Button Respawn Action is pressed down More... | |
virtual void | RespawnActionReleased () |
Button Respawn Action is released More... | |
virtual void | LeftPressed () |
Button Left is being pressed More... | |
virtual void | RightPressed () |
Button Right is being pressed More... | |
virtual void | UpPressed () |
Button Up is being pressed More... | |
virtual void | DownPressed () |
Button Down is being pressed More... | |
virtual void | MobileJoystickPosition (Vector2 value) |
Update of the mobile joystick position More... | |
virtual void | HorizontalPosition (float value) |
Update of the horizontal value (from -1 to 1) More... | |
virtual void | VerticalPosition (float value) |
Update of the vertical value (from -1 to 1) More... | |
virtual void | LeftReleased () |
Button Left is released More... | |
virtual void | RightReleased () |
Button Right is released More... | |
virtual void | UpReleased () |
Button Up is released More... | |
virtual void | DownReleased () |
Button Down is released More... | |
virtual void | Respawn () |
This method triggers the respawn of the vehicle to its last checkpoint More... | |
virtual void | OnTriggerEnter (Collider other) |
Describes what happens when the object starts colliding with something Used for checkpoint interaction More... | |
virtual void | OnTriggerStay (Collider other) |
Describes what happens when something is colliding with our object Used to apply a boost force to the vehicle while staying in a boost zone. More... | |
virtual void | OnTriggerExit (Collider other) |
Describes what happens when the collision ends Removes "boost" state when the vehicle exits a boost zone More... | |
virtual void | EnableControls (int controllerId) |
Enables the controls. More... | |
virtual void | DisableControls () |
Disables the controls. More... | |
Protected Types inherited from MoreMountains.HighroadEngine.BaseController | |
enum | Zones { SpeedBoost , JumpBoost , LoopZone } |
Car controller class. Manages inputs from InputManager and driving evaluation You can customize the car properties for different types of cars
|
protectedvirtual |
Manages the acceleration of the car (forward or reverse)
|
protectedvirtual |
Physics initialization
Reimplemented from MoreMountains.HighroadEngine.BaseController.
|
protectedvirtual |
Brake force
|
protectedvirtual |
Fixed update. We apply physics and input evaluation.
|
protectedvirtual |
Shows the debug information. Optionnal. Can be used during tests to show vehicle values
|
protectedvirtual |
Steer evaluation. We get steering value and apply rotation accordingly
|
protectedvirtual |
Update
|
protectedvirtual |
Updates the ground situation for this car.
|
protected |
Current car velocity.
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
float MoreMountains.HighroadEngine.CarController.Acceleration = 100f |
the engine's force
float MoreMountains.HighroadEngine.CarController.BrakeForce = 10f |
the intensity of the brakes
float MoreMountains.HighroadEngine.CarController.CarGroundDistance = 0.1f |
Vector3 MoreMountains.HighroadEngine.CarController.CenterOfMass = new Vector3(0,-1,0) |
float MoreMountains.HighroadEngine.CarController.MaximumVelocity = 20f |
the car's maximum speed
float MoreMountains.HighroadEngine.CarController.OffroadFactor = 2f |
the penalty applied when going offroad
|
getprotected set |
The current gear value.
|
getsetprotected |
Gets or sets the distance to the ground.
The distance to the ground.
|
getsetprotected |
Gets or sets the ground game object.
The ground game object.
|
get |
Gets a value indicating whether this car is off road.
true
if this instance is off road; otherwise, false
.
|
get |
Gets the normalized speed.
The normalized speed.