MotionControllerFly

public class MotionControllerFly extends MotionControllerBase

Class MotionControllerFly. Provides motioncontrollerfly functionality for the Hytale server.

java.lang.Object > MotionControllerBase > MotionControllerFly

Field Summary

lastVerticalPositionX

protected int lastVerticalPositionX

Field lastVerticalPositionX.

lastVerticalPositionZ

protected int lastVerticalPositionZ

Field lastVerticalPositionZ.

lastSpeed

protected double lastSpeed

Field lastSpeed.

lastRoll

protected float lastRoll

Field lastRoll.

currentRelativeSpeed

protected double currentRelativeSpeed

Field currentRelativeSpeed.

minSpeedAfterForceSquared

protected double minSpeedAfterForceSquared

Field minSpeedAfterForceSquared.

desiredAltitudeOverride

protected double[] desiredAltitudeOverride

Field desiredAltitudeOverride.

maxFallSpeed

final double maxFallSpeed

Field maxFallSpeed.

onGround

final boolean onGround

Field onGround.

yaw

final float yaw

Field yaw.

pitch

final float pitch

Field pitch.

dirX

final double dirX

Field dirX.

dirZ

final double dirZ

Field dirZ.

dotXZ

final double dotXZ

Field dotXZ.

maxRotationAngle

final float maxRotationAngle

Field maxRotationAngle.

newYaw

final float newYaw

Field newYaw.

newPitch

final float newPitch

Field newPitch.

speedLimit

final double speedLimit

Field speedLimit.

minSpeed

final double minSpeed

Field minSpeed.

maxSpeed

final double maxSpeed

Field maxSpeed.

mX

final double mX

Field mX.

mZ

final double mZ

Field mZ.

mL

final double mL

Field mL.

rollTurnCosine

final float rollTurnCosine

Field rollTurnCosine.

maxRollTurnAngle

final float maxRollTurnAngle

Field maxRollTurnAngle.

maxRollTurnCosine

final float maxRollTurnCosine

Field maxRollTurnCosine.

rollTurnStrength

final float rollTurnStrength

Field rollTurnStrength.

speedFactor

final double speedFactor

Field speedFactor.

desiredRoll

final float desiredRoll

Field desiredRoll.

dampedRoll

final float dampedRoll

Field dampedRoll.

deltaRoll

final float deltaRoll

Field deltaRoll.

constrainedRoll

final float constrainedRoll

Field constrainedRoll.

diffSpeed

final double diffSpeed

Field diffSpeed.

entry

final AppliedVelocity entry

Field entry.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

position

final Vector3d position

Field position.

ix

final int ix

Field ix.

iz

final int iz

Field iz.

y

final double y

Field y.

world

final World world

Field world.

chunkStore

final ChunkStore chunkStore

Field chunkStore.

chunkIndex

final long chunkIndex

Field chunkIndex.

chunkRef

final Ref chunkRef

Field chunkRef.

chunkStoreAccessor

final Store chunkStoreAccessor

Field chunkStoreAccessor.

chunkColumnComponent

final ChunkColumn chunkColumnComponent

Field chunkColumnComponent.

blockChunkComponent

final BlockChunk blockChunkComponent

Field blockChunkComponent.

iy

final int iy

Field iy.

below

final double below

Field below.

above

final double above

Field above.

probeOnly

final boolean probeOnly

Field probeOnly.

saveSegments

final boolean saveSegments

Field saveSegments.

canAct

final boolean canAct

Field canAct.

debugPrefix

final String debugPrefix

Field debugPrefix.

collision

final BlockCollisionData collision

Field collision.

adjust

final double adjust

Field adjust.

distance

final double distance

Field distance.

scale

final double scale

Field scale.

sinePitch

final double sinePitch

Field sinePitch.

cosinePitch

final double cosinePitch

Field cosinePitch.

c

final double c

Field c.

s

final double s

Field s.

Method Detail

MotionControllerFly

public public MotionControllerFly (@Nonnull final BuilderSupport builderSupport, @Nonnull final BuilderMotionControllerFly builder)

Method MotionControllerFly.

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

getType

public String getType ()

Method getType.

computeMove

protected double computeMove (@Nonnull final Ref ref, @Nonnull final Role role, @Nonnull final Steering steering, final double dt, @Nonnull final Vector3d translation, @Nonnull final ComponentAccessor componentAccessor)

Method computeMove.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
@Nonnull final Steering steering
final double dt
@Nonnull final Vector3d translation
@Nonnull final ComponentAccessor componentAccessor

IllegalArgumentException

public new IllegalArgumentException (String.valueOf(translation)

Method IllegalArgumentException.

Parameters:
String.valueOf(translation String.valueOf(translation

setDirectionFromTranslation

private void setDirectionFromTranslation (@Nonnull final Steering steering, @Nonnull final Vector3d translation)

Method setDirectionFromTranslation.

Parameters:
@Nonnull final Steering steering
@Nonnull final Vector3d translation

probeMove

public double probeMove (@Nonnull final Ref ref, @Nonnull final ProbeMoveData probeMoveData, @Nonnull final ComponentAccessor componentAccessor)

Method probeMove.

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

isFastMotionKind

public boolean isFastMotionKind (final double speed)

Method isFastMotionKind.

Parameters:
final double speed

getDesiredVerticalRange

public MotionController.VerticalRange getDesiredVerticalRange (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)

Method getDesiredVerticalRange.

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

getWanderVerticalMovementRatio

public double getWanderVerticalMovementRatio ()

Method getWanderVerticalMovementRatio.

doMove

protected double doMove (@Nonnull final Ref ref, @Nonnull final Vector3d position, @Nonnull final Vector3d translation, @Nonnull final PositionProbeAir moveProbe, @Nullable final ProbeMoveData probeMoveData, @Nonnull final ComponentAccessor componentAccessor)

Method doMove.

Parameters:
@Nonnull final Ref ref
@Nonnull final Vector3d position
@Nonnull final Vector3d translation
@Nonnull final PositionProbeAir moveProbe
@Nullable final ProbeMoveData probeMoveData
@Nonnull final ComponentAccessor componentAccessor

if

public else if (saveSegments)

Method if.

Parameters:
saveSegments saveSegments

executeMove

protected double executeMove (@Nonnull final Ref ref, @Nonnull final Role role, double dt, @Nonnull final Vector3d translation, @Nonnull final ComponentAccessor componentAccessor)

Method executeMove.

Parameters:
@Nonnull final Ref ref
@Nonnull final Role role
double dt
@Nonnull final Vector3d translation
@Nonnull final ComponentAccessor componentAccessor

constrainRotations

public void constrainRotations (final Role role, final TransformComponent transform)

Method constrainRotations.

Parameters:
final Role role
final TransformComponent transform

getCurrentMaxBodyRotationSpeed

public double getCurrentMaxBodyRotationSpeed ()

Method getCurrentMaxBodyRotationSpeed.

dampForceVelocity

protected void dampForceVelocity (@Nonnull final Vector3d forceVelocity, final double forceVelocityDamping, final double interval, final ComponentAccessor componentAccessor)

Method dampForceVelocity.

Parameters:
@Nonnull final Vector3d forceVelocity
final double forceVelocityDamping
final double interval
final ComponentAccessor componentAccessor

shouldDampenAppliedVelocitiesY

protected boolean shouldDampenAppliedVelocitiesY ()

Method shouldDampenAppliedVelocitiesY.

shouldAlwaysUseGroundResistance

protected boolean shouldAlwaysUseGroundResistance ()

Method shouldAlwaysUseGroundResistance.

spawned

public void spawned ()

Method spawned.

canAct

public boolean canAct (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)

Method canAct.

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

inAir

public boolean inAir ()

Method inAir.

onGround

public boolean onGround ()

Method onGround.

inWater

public boolean inWater ()

Method inWater.

getCurrentSpeed

public double getCurrentSpeed ()

Method getCurrentSpeed.

getCurrentTurnRadius

public double getCurrentTurnRadius ()

Method getCurrentTurnRadius.

getMaxClimbAngle

public float getMaxClimbAngle ()

Method getMaxClimbAngle.

getMaxSinkAngle

public float getMaxSinkAngle ()

Method getMaxSinkAngle.

getMaximumSpeed

public double getMaximumSpeed ()

Method getMaximumSpeed.

is2D

public boolean is2D ()

Method is2D.

canRestAtPlace

public boolean canRestAtPlace ()

Method canRestAtPlace.

getDesiredAltitudeWeight

public double getDesiredAltitudeWeight ()

Method getDesiredAltitudeWeight.

getHeightOverGround

public double getHeightOverGround ()

Method getHeightOverGround.

isHorizontalIdle

public boolean isHorizontalIdle (final double speed)

Method isHorizontalIdle.

Parameters:
final double speed

estimateVelocity

public boolean estimateVelocity (final Steering steering, @Nonnull final Vector3d velocityOut)

Method estimateVelocity.

Parameters:
final Steering steering
@Nonnull final Vector3d velocityOut

clearOverrides

public void clearOverrides ()

Method clearOverrides.

setDesiredAltitudeOverride

public void setDesiredAltitudeOverride (final double[] desiredAltitudeOverride)

Method setDesiredAltitudeOverride.

Parameters:
final double[] desiredAltitudeOverride

takeOff

public void takeOff (@Nonnull final Ref ref, final double speed, @Nonnull final ComponentAccessor componentAccessor)

Method takeOff.

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

getMinSpeedAfterForceSquared

public double getMinSpeedAfterForceSquared ()

Method getMinSpeedAfterForceSquared.

getDampingDeceleration

public double getDampingDeceleration ()

Method getDampingDeceleration.

computeMaxSpeedFromPitch

protected double computeMaxSpeedFromPitch (final double pitch)

Method computeMaxSpeedFromPitch.

Parameters:
final double pitch