Manages the driving with a simple AI : the AI follows each AIWaypoint in their order.
More...
Manages the driving with a simple AI : the AI follows each AIWaypoint in their order.
This engine is generic and can be used on different types of vehicles as long as they implement BaseController with Steer and GasPedal.
◆ CalculateValues()
virtual void MoreMountains.HighroadEngine.VehicleAI.CalculateValues |
( |
| ) |
|
|
protectedvirtual |
Applies controls to move vehicle towards the waypoint
◆ EvaluateDirection()
virtual void MoreMountains.HighroadEngine.VehicleAI.EvaluateDirection |
( |
| ) |
|
|
protectedvirtual |
Determine direction towards the waypoint
◆ EvaluateNextWaypoint()
virtual void MoreMountains.HighroadEngine.VehicleAI.EvaluateNextWaypoint |
( |
| ) |
|
|
protectedvirtual |
we determine if the current waypoint is still correct
◆ IsStuck()
virtual bool MoreMountains.HighroadEngine.VehicleAI.IsStuck |
( |
| ) |
|
|
protectedvirtual |
If car stays in the same place for too long, we respawn to the last checkpoint
◆ LateUpdate()
virtual void MoreMountains.HighroadEngine.VehicleAI.LateUpdate |
( |
| ) |
|
|
virtual |
At LateUpdate, we apply ou AI logic
◆ OnDrawGizmos()
virtual void MoreMountains.HighroadEngine.VehicleAI.OnDrawGizmos |
( |
| ) |
|
|
virtual |
On DrawGizmos, we draw a line between the vehicle and its target
◆ PlaneDistanceToWaypoints()
virtual float MoreMountains.HighroadEngine.VehicleAI.PlaneDistanceToWaypoints |
( |
| ) |
|
|
protectedvirtual |
Returns the Plane distance between the next waypoint and the vehicle
- Returns
- The distance to the next waypoint.
◆ ResetAIWaypointToClosest()
virtual void MoreMountains.HighroadEngine.VehicleAI.ResetAIWaypointToClosest |
( |
| ) |
|
|
protectedvirtual |
Reset next AI waypoint to closest
◆ Start()
virtual void MoreMountains.HighroadEngine.VehicleAI.Start |
( |
| ) |
|
|
virtual |
◆ _acceleration
float MoreMountains.HighroadEngine.VehicleAI._acceleration = 0f |
|
protected |
◆ _AIWaypoints
List<Vector3> MoreMountains.HighroadEngine.VehicleAI._AIWaypoints |
|
protected |
◆ _controller
◆ _currentWaypoint
int MoreMountains.HighroadEngine.VehicleAI._currentWaypoint |
|
protected |
◆ _direction
float MoreMountains.HighroadEngine.VehicleAI._direction = 0f |
|
protected |
◆ _largeAngleDistance
const float MoreMountains.HighroadEngine.VehicleAI._largeAngleDistance = 90f |
|
staticprotected |
◆ _lastPosition
Vector3 MoreMountains.HighroadEngine.VehicleAI._lastPosition |
|
protected |
◆ _maximalDistanceStuck
const float MoreMountains.HighroadEngine.VehicleAI._maximalDistanceStuck = 0.5f |
|
staticprotected |
◆ _minimalSpeedForBrakes
const float MoreMountains.HighroadEngine.VehicleAI._minimalSpeedForBrakes = 0.5f |
|
staticprotected |
◆ _newDirection
int MoreMountains.HighroadEngine.VehicleAI._newDirection |
|
protected |
◆ _raceManager
RaceManager MoreMountains.HighroadEngine.VehicleAI._raceManager |
|
protected |
◆ _smallAngleDistance
const float MoreMountains.HighroadEngine.VehicleAI._smallAngleDistance = 5f |
|
staticprotected |
◆ _solidController
◆ _stuckTime
float MoreMountains.HighroadEngine.VehicleAI._stuckTime = 0f |
|
protected |
◆ _targetAngleAbsolute
float MoreMountains.HighroadEngine.VehicleAI._targetAngleAbsolute |
|
protected |
◆ _targetWaypoint
Vector3 MoreMountains.HighroadEngine.VehicleAI._targetWaypoint |
|
protected |
◆ Active
bool MoreMountains.HighroadEngine.VehicleAI.Active |
If Active, AI controls the vehicle.
◆ FullThrottle
float MoreMountains.HighroadEngine.VehicleAI.FullThrottle = 1f |
the maximum Gas Pedal Amount
◆ MinimalDistanceToNextWaypoint
int MoreMountains.HighroadEngine.VehicleAI.MinimalDistanceToNextWaypoint = 10 |
when this distance is reached, AI goes to next waypoint
◆ OverrideSteringSpeed
bool MoreMountains.HighroadEngine.VehicleAI.OverrideSteringSpeed = false |
◆ SmallThrottle
float MoreMountains.HighroadEngine.VehicleAI.SmallThrottle = 0.3f |
the minimum Gas Pedal Amount
◆ SteeringSpeed
int MoreMountains.HighroadEngine.VehicleAI.SteeringSpeed = 300 |
◆ TimeBeforeStuck
float MoreMountains.HighroadEngine.VehicleAI.TimeBeforeStuck = 5f |
The time in seconds before the car is reset to the last checkpoint it's met. If the value is zero, the car will remain where it is.
The documentation for this class was generated from the following file:
- E:/Github/Store/HighroadEngine/Assets/HighroadEngine/Common/Scripts/Vehicles/VehicleAI.cs