OnPathBehavior class

This steering behavior produces a force that keeps a vehicle close to its path. It is intended to use it in combination with {@link FollowPathBehavior} in order to realize a more strict path following.

@author {@link https://github.com/Mugen87|Mugen87}

Inheritance

Constructors

OnPathBehavior([Path? path, double radius = 0.1, double predictionFactor = 1])
Constructs a on path behavior.

Properties

active ↔ bool
getter/setter pairinherited
closestNormalPoint → Vector3
final
hashCode → int
The hash code for this object.
no setterinherited
lineSegment → LineSegment
final
normalPoint → Vector3
final
path ↔ Path
getter/setter pairoverride
predictedPosition → Vector3
final
predictionFactor ↔ double
getter/setter pair
radius ↔ double
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
target ↔ Vector3
getter/setter pairinherited
translation → Vector3
final
weight ↔ double
getter/setter pairinherited

Methods

calculate(Vehicle vehicle, Vector3 force, [double? delta]) → Vector3
Calculates the steering force for a single simulation step.
override
fromJSON(Map<String, dynamic> json) → OnPathBehavior
Restores this instance from the given JSON object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveReferences(Map<String, GameEntity> entities) → SteeringBehavior?
Restores UUIDs with references to GameEntity objects.
inherited
toJSON() → Map<String, dynamic>
Transforms this instance into a JSON object.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited