Mind class final

Everything a brain is allowed to know, and the few things it may do.

Handed in rather than reached for: a brain holding a reference to the collision world could sweep, raycast and spawn, and then every brain anybody writes is entitled to the whole engine. This is the surface a decision actually needs.

Constructors

Mind(ActorSystem system)

Properties

actor ↔ Actor
Whose decision this is.
getter/setter pair
distance → double
How far away the focus is.
no setter
dt ↔ double
Seconds this step.
getter/setter pair
focus → Vector3
What every actor in the world is currently paying attention to.
no setter
focusBody → Collider?
The body at focus, when there is one. For ignoring it in a raycast, and for telling whether a shot hit it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
heading → Vector3
Which way the last steer asked to go, for turning to face it. Around a corner that is not the way to the focus, and an actor that stares through the wall while sliding sideways is the tell of a flow field.
no setter
hurtBy ↔ Object?
Whoever dealt the damage, during Brain.onHurt and nowhere else.
getter/setter pair
random → Random
Randomness that a snapshot can carry. See GameRandom.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
system → ActorSystem
final
toFocus → Vector3
From the actor to the focus. Live, and not to be kept.
no setter

Methods

canSee() → bool
Whether there is a clear line from this actor's eye to the focus.
canSeePoint(Vector3 point) → bool
Whether there is a clear line from this actor's eye to point.
halt() → void
Stop.
jump() → void
Ask to jump. Refused in mid-air, as it is for the player.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
steer(Vector3 direction) → void
Walk this way, on the ground. Length is speed: a half-length vector is a request to walk at half pace.
steerTowards(Vector3 point) → void
Walk towards a point that is not the focus. Straight, sliding off walls.
steerTowardsFocus() → void
Walk towards the focus, round corners if the level has a navigation grid and straight at it if it has not.
toString() → String
A string representation of this object.
inherited
turnTowards(double x, double z) → void
Turn to face a direction on the ground, at the actor's turn rate.

Operators

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