Vehicle class

This type of game entity implements a special type of locomotion, the so called Vehicle Model. The class uses basic physical metrics in order to implement a realistic movement.

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

Inheritance

Constructors

Vehicle()
Constructs a new vehicle.

Properties

acceleration Vector3
final
active bool
getter/setter pairinherited
boundingRadius double
getter/setter pairinherited
canActivateTrigger bool
getter/setter pairinherited
children List<GameEntity>
finalinherited
displacement Vector3
finalinherited
forward Vector3
finalinherited
hashCode int
The hash code for this object.
no setterinherited
manager EntityManager?
getter/setter pairinherited
mass double
getter/setter pair
maxForce double
getter/setter pair
maxSpeed double
getter/setter pairinherited
maxTurnRate double
getter/setter pairinherited
name String
getter/setter pairinherited
neighborhoodRadius double
getter/setter pairinherited
neighbors List<GameEntity>
finalinherited
parent GameEntity?
getter/setter pairinherited
position Vector3
finalinherited
positionWorld Vector3
finalinherited
quaternionWorld Quaternion
finalinherited
renderComponent ↔ dynamic
getter/setter pairinherited
renderComponentCallback Function?
getter/setter pairinherited
rotation Quaternion
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale Vector3
finalinherited
smoother Smoother?
getter/setter pair
started bool
getter/setter pairinherited
steering SteeringManager
getter/setter pair
steeringForce Vector3
final
target Vector3
finalinherited
targetDirection Vector3
finalinherited
targetRotation Quaternion
finalinherited
up Vector3
finalinherited
updateNeighborhood bool
getter/setter pairinherited
updateOrientation bool
getter/setter pairinherited
uuid String?
Unique ID, primarily used in context of serialization/deserialization.
no setterinherited
velocity Vector3
getter/setter pairinherited
velocitySmooth Vector3
final
vision Vision?
getter/setter pairinherited

Methods

add(GameEntity entity) GameEntity
Adds a game entity as a child to this game entity.
inherited
entitiesToIds(dynamic array) → dynamic
inherited
fromJSON(Map<String, dynamic> json) Vehicle
Restores this instance from the given JSON object.
override
getDirection(Vector3 result) Vector3
Computes the current direction (forward) vector of this game entity and stores the result in the given vector.
inherited
getSpeed() double
Returns the current speed of this game entity.
inherited
getSpeedSquared() double
Returns the current speed in squared space of this game entity.
inherited
getWorldDirection(Vector3 result) Vector3
Computes the current direction (forward) vector of this game entity in world space and stores the result in the given vector.
inherited
getWorldPosition(Vector3 result) Vector3
Computes the current position of this game entity in world space and stores the result in the given vector.
inherited
handleMessage(Telegram telegram) bool
Holds the implementation for the message handling of this game entity.
inherited
lineOfSightTest(Ray ray, Vector3 intersectionPoint) Vector3?
Holds the implementation for the line of sight test of this game entity. This method is used by {@link Vision#visible} in order to determine whether this game entity blocks the given line of sight or not. Implement this method when your game entity acts as an obstacle.
inherited
lookAt(Vector3 target) GameEntity
Directly rotates the entity so it faces the given target position.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(GameEntity entity) GameEntity
Removes a game entity as a child from this game entity.
inherited
resolveReferences(Map<String, GameEntity> entities) Vehicle
Restores UUIDs with references to GameEntity objects.
override
rotateTo(Vector3 target, double delta, [double? tolerance]) bool
Given a target position, this method rotates the entity by an amount not greater than {@link GameEntity#maxTurnRate} until it directly faces the target.
inherited
sendMessage(GameEntity receiver, String message, [double delay = 0, Map<String, dynamic>? data]) GameEntity
Sends a message with the given data to the specified receiver.
inherited
setRenderComponent([dynamic renderComponent, Function? callback]) GameEntity
Sets a renderable component of a 3D engine with a sync callback for this game entity.
inherited
start() GameEntity
Executed when this game entity is updated for the first time by its {@link EntityManager}.
inherited
toJSON() Map<String, dynamic>
Transforms this instance into a JSON object.
override
toString() String
A string representation of this object.
inherited
update(double delta) Vehicle
This method is responsible for updating the position based on the force produced by the internal steering manager.
override
updateWorldMatrix() GameEntity
inherited
worldMatrix() Matrix4
A transformation matrix representing the world space of this game entity.
inherited

Operators

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