BodyMotionMaintainDistance

public class BodyMotionMaintainDistance extends BodyMotionBase

Class BodyMotionMaintainDistance. Provides bodymotionmaintaindistance functionality for the Hytale server.

java.lang.Object > BodyMotionBase > BodyMotionMaintainDistance

Field Summary

targetDistanceSquared

protected double targetDistanceSquared

Field targetDistanceSquared.

approaching

protected boolean approaching

Field approaching.

movingAway

protected boolean movingAway

Field movingAway.

strafingDirection

protected int strafingDirection

Field strafingDirection.

strafingDelay

protected double strafingDelay

Field strafingDelay.

pauseStrafing

protected boolean pauseStrafing

Field pauseStrafing.

cachedMinRangeProvider

protected DoubleParameterProvider cachedMinRangeProvider

Field cachedMinRangeProvider.

cachedMaxRangeProvider

protected DoubleParameterProvider cachedMaxRangeProvider

Field cachedMaxRangeProvider.

cachedPositioningAngleProvider

protected DoubleParameterProvider cachedPositioningAngleProvider

Field cachedPositioningAngleProvider.

initialised

protected boolean initialised

Field initialised.

min

final double min

Field min.

max

final double max

Field max.

value

final double value

Field value.

before

final double before

Field before.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

positionProvider

final IPositionProvider positionProvider

Field positionProvider.

selfPosition

final Vector3d selfPosition

Field selfPosition.

distanceSquared

final double distanceSquared

Field distanceSquared.

targetDistance

final double targetDistance

Field targetDistance.

activeMotionController

final MotionController activeMotionController

Field activeMotionController.

x

final double x

Field x.

z

final double z

Field z.

motionController

final MotionController motionController

Field motionController.

targetRef

final Ref targetRef

Field targetRef.

targetTransformComponent

final TransformComponent targetTransformComponent

Field targetTransformComponent.

selfYaw

final float selfYaw

Field selfYaw.

difference

final float difference

Field difference.

translation

final Vector3d translation

Field translation.

newX

final double newX

Field newX.

newZ

final double newZ

Field newZ.

Method Detail

BodyMotionMaintainDistance

public public BodyMotionMaintainDistance (@Nonnull final BuilderBodyMotionMaintainDistance builder, @Nonnull final BuilderSupport support)

Method BodyMotionMaintainDistance.

Parameters:
@Nonnull final BuilderBodyMotionMaintainDistance builder
@Nonnull final BuilderSupport support

computeSteering

public boolean computeSteering (@Nonnull final Ref ref, @Nonnull final Role support, @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 support
@Nullable final InfoProvider sensorInfo
final double dt
@Nonnull final Steering desiredSteering
@Nonnull final ComponentAccessor componentAccessor

if

public else if (distanceSquared < this.thresholdDistanceRangeSquared[0] || (this.movingAway && distanceSquared < this.targetDistanceSquared)

Method if.

Parameters:
distanceSquared < this.thresholdDistanceRangeSquared[0] || (this.movingAway && distanceSquared < this.targetDistanceSquared

tickStrafingDelay

protected boolean tickStrafingDelay (final double dt)

Method tickStrafingDelay.

Parameters:
final double dt

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