BodyMotionWanderBase

abstract class BodyMotionWanderBase extends BodyMotionBase

Class BodyMotionWanderBase. Provides bodymotionwanderbase functionality for the Hytale server.

java.lang.Object > BodyMotionBase > BodyMotionWanderBase

Field Summary

debugSteer

protected boolean debugSteer

Field debugSteer.

state

protected State state

Field state.

angleOffset

protected float angleOffset

Field angleOffset.

probeDY

protected double probeDY

Field probeDY.

maxDistanceAbove

protected double maxDistanceAbove

Field maxDistanceAbove.

maxDistanceBelow

protected double maxDistanceBelow

Field maxDistanceBelow.

walkTime

protected double walkTime

Field walkTime.

walkHeading

protected float walkHeading

Field walkHeading.

walkDistance

protected double walkDistance

Field walkDistance.

directionIndex

protected int directionIndex

Field directionIndex.

desiredWalkDistance

protected double desiredWalkDistance

Field desiredWalkDistance.

avoidingBlockDamage

final boolean avoidingBlockDamage

Field avoidingBlockDamage.

relaxedMoveConstraints

final boolean relaxedMoveConstraints

Field relaxedMoveConstraints.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

activeMotionController

final MotionController activeMotionController

Field activeMotionController.

headline

final String headline

Field headline.

currentHorizontalSpeedMultiplier

final float currentHorizontalSpeedMultiplier

Field currentHorizontalSpeedMultiplier.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

bodyRotation

final Vector3f bodyRotation

Field bodyRotation.

stopDistance

final double stopDistance

Field stopDistance.

slowdownDistance

final double slowdownDistance

Field slowdownDistance.

heading

final float heading

Field heading.

turnAngle

final double turnAngle

Field turnAngle.

d

final double d

Field d.

random

final ThreadLocalRandom random

Field random.

d2

final double d2

Field d2.

r

final double r

Field r.

scale

final double scale

Field scale.

wanderVerticalMovementRatio

final double wanderVerticalMovementRatio

Field wanderVerticalMovementRatio.

verticalRange

final MotionController.VerticalRange verticalRange

Field verticalRange.

desiredAltitudeWeight

final double desiredAltitudeWeight

Field desiredAltitudeWeight.

y

final double y

Field y.

negativeMaxVerticalDistance

final double negativeMaxVerticalDistance

Field negativeMaxVerticalDistance.

direction

final int direction

Field direction.

motionController

final MotionController motionController

Field motionController.

constrainDistance

final double constrainDistance

Field constrainDistance.

moveDistance

final double moveDistance

Field moveDistance.

Method Detail

BodyMotionWanderBase

public public BodyMotionWanderBase (@Nonnull final BuilderBodyMotionWanderBase builder, @Nonnull final BuilderSupport builderSupport)

Method BodyMotionWanderBase.

Parameters:
@Nonnull final BuilderBodyMotionWanderBase builder
@Nonnull final BuilderSupport builderSupport

activate

public void activate (@Nonnull final Ref ref, @Nonnull final Role role, @Nonnull final ComponentAccessor componentAccessor)

Method activate.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
@Nonnull final ComponentAccessor componentAccessor

deactivate

public void deactivate (@Nonnull final Ref ref, @Nonnull final Role role, @Nonnull final ComponentAccessor componentAccessor)

Method deactivate.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
@Nonnull final ComponentAccessor componentAccessor

motionControllerChanged

public void motionControllerChanged (@Nullable final Ref ref, @Nonnull final NPCEntity npcComponent, @Nonnull final MotionController motionController, @Nullable final ComponentAccessor componentAccessor)

Method motionControllerChanged.

Parameters:
@Nullable final Ref ref
@Nonnull final NPCEntity npcComponent
@Nonnull final MotionController motionController
@Nullable final ComponentAccessor componentAccessor

computeSteering

public boolean computeSteering (@Nonnull final Ref ref, @Nonnull final Role role, @Nullable final InfoProvider sensorInfo, final double dt, @Nonnull final Steering desiredSteering, @Nonnull final ComponentAccessor componentAccessor)

Method computeSteering.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
@Nullable final InfoProvider sensorInfo
final double dt
@Nonnull final Steering desiredSteering
@Nonnull final ComponentAccessor componentAccessor

Nameplate

public new Nameplate (headline)

Method Nameplate.

Parameters:
headline headline

if

public else if (!this.probeDirection(ref, this.directionIndex, role, componentAccessor)

Method if.

Parameters:
!this.probeDirection(ref !this.probeDirection(ref
this.directionIndex this.directionIndex
role role
componentAccessor componentAccessor

findBestDirection

protected boolean findBestDirection (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)

Method findBestDirection.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentAccessor componentAccessor

restartSearch

protected void restartSearch (@Nullable final Ref ref, @Nonnull final NPCEntity npcComponent, @Nonnull final MotionController activeMotionController, @Nullable final ComponentAccessor componentAccessor)

Method restartSearch.

Parameters:
@Nullable final Ref ref
@Nonnull final NPCEntity npcComponent
@Nonnull final MotionController activeMotionController
@Nullable final ComponentAccessor componentAccessor

computeHeightRange

protected void computeHeightRange (@Nonnull final Ref ref, @Nonnull final MotionController motionController, @Nonnull final ComponentAccessor componentAccessor)

Method computeHeightRange.

Parameters:
@Nonnull final Ref ref
@Nonnull final MotionController motionController
@Nonnull final ComponentAccessor componentAccessor

probeDirection

protected boolean probeDirection (@Nonnull final Ref ref, final int dirIndex, @Nonnull final Role role, @Nonnull final ComponentAccessor componentAccessor)

Method probeDirection.

Parameters:
@Nonnull final Ref ref
final int dirIndex
@Nonnull final Role role
@Nonnull final ComponentAccessor componentAccessor

computeTargetPosition

private void computeTargetPosition (@Nonnull final Ref ref, final float heading, final double distance, @Nonnull final ComponentAccessor componentAccessor)

Method computeTargetPosition.

Parameters:
@Nonnull final Ref ref
final float heading
final double distance
@Nonnull final ComponentAccessor componentAccessor

toAngle

protected float toAngle (@Nonnull final Ref ref, final int direction, @Nonnull final ComponentAccessor componentAccessor)

Method toAngle.

Parameters:
@Nonnull final Ref ref
final int direction
@Nonnull final ComponentAccessor componentAccessor

addPreOrderedDirection

private int addPreOrderedDirection (final int direction, int count)

Method addPreOrderedDirection.

Parameters:
final int direction
int count