MotionControllerDive

public class MotionControllerDive extends MotionControllerBase

Class MotionControllerDive. Provides motioncontrollerdive functionality for the Hytale server.

java.lang.Object > MotionControllerBase > MotionControllerDive

Field Summary

swimDepth

protected double swimDepth

Field swimDepth.

climbSpeed

protected double climbSpeed

Field climbSpeed.

currentRelativeSpeed

protected double currentRelativeSpeed

Field currentRelativeSpeed.

collisionWithSolid

protected boolean collisionWithSolid

Field collisionWithSolid.

minSpeedAfterForceSquared

final double minSpeedAfterForceSquared

Field minSpeedAfterForceSquared.

waterLevel

final double waterLevel

Field waterLevel.

groundY

final double groundY

Field groundY.

lowY

final double lowY

Field lowY.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

y

final double y

Field y.

dir

final Vector3d dir

Field dir.

maxVerticalSpeed

final double maxVerticalSpeed

Field maxVerticalSpeed.

hSpeed

final double hSpeed

Field hSpeed.

vSpeed

final double vSpeed

Field vSpeed.

maxRotation

final float maxRotation

Field maxRotation.

isMoving

final boolean isMoving

Field isMoving.

maxSpeed

final double maxSpeed

Field maxSpeed.

onGround

final boolean onGround

Field onGround.

velocityComponent

final Velocity velocityComponent

Field velocityComponent.

entry

final AppliedVelocity entry

Field entry.

epsilonAngle

final float epsilonAngle

Field epsilonAngle.

canAct

final boolean canAct

Field canAct.

collision

final BlockCollisionData collision

Field collision.

saveSegments

final boolean saveSegments

Field saveSegments.

probePosition

final Vector3d probePosition

Field probePosition.

probeMovement

final Vector3d probeMovement

Field probeMovement.

collisionModule

final CollisionModule collisionModule

Field collisionModule.

maxDistance

final double maxDistance

Field maxDistance.

collisionStart

final double collisionStart

Field collisionStart.

Method Detail

MotionControllerDive

public public MotionControllerDive (@Nonnull final BuilderSupport builderSupport, @Nonnull final BuilderMotionControllerDive builder)

Method MotionControllerDive.

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

activate

public void activate ()

Method activate.

getWanderVerticalMovementRatio

public double getWanderVerticalMovementRatio ()

Method getWanderVerticalMovementRatio.

getDesiredVerticalRange

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

Method getDesiredVerticalRange.

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

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

shouldDampenAppliedVelocitiesY

protected boolean shouldDampenAppliedVelocitiesY ()

Method shouldDampenAppliedVelocitiesY.

shouldAlwaysUseGroundResistance

protected boolean shouldAlwaysUseGroundResistance ()

Method shouldAlwaysUseGroundResistance.

computeTranslation

private void computeTranslation (@Nonnull final Vector3d translation, final double dt, final float heading, final double moveSpeed, final double climbSpeed)

Method computeTranslation.

Parameters:
@Nonnull final Vector3d translation
final double dt
final float heading
final double moveSpeed
final double climbSpeed

isNearZero

private boolean isNearZero (final float angle)

Method isNearZero.

Parameters:
final float angle

setMotionKind

public void setMotionKind (MotionKind motionKind)

Method setMotionKind.

Parameters:
MotionKind motionKind

executeMove

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

Method executeMove.

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

if

public else if (this.debugModeMove)

Method if.

Parameters:
this.debugModeMove this.debugModeMove

constrainRotations

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

Method constrainRotations.

Parameters:
final Role role
@Nonnull final TransformComponent transform

getCurrentMaxBodyRotationSpeed

public double getCurrentMaxBodyRotationSpeed ()

Method getCurrentMaxBodyRotationSpeed.

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.

inWater

public boolean inWater ()

Method inWater.

onGround

public boolean onGround ()

Method onGround.

getType

public String getType ()

Method getType.

bisect

public double bisect (@Nonnull final Ref ref, @Nonnull final Vector3d validPosition, final double validDistance, @Nonnull final Vector3d invalidPosition, final double invalidDistance, @Nonnull final Vector3d result, @Nonnull final ComponentAccessor componentAccessor)

Method bisect.

Parameters:
@Nonnull final Ref ref
@Nonnull final Vector3d validPosition
final double validDistance
@Nonnull final Vector3d invalidPosition
final double invalidDistance
@Nonnull final Vector3d result
@Nonnull final ComponentAccessor componentAccessor

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

spawned

public void spawned ()

Method spawned.

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.

isFastMotionKind

public boolean isFastMotionKind (final double speed)

Method isFastMotionKind.

Parameters:
final double speed

is2D

public boolean is2D ()

Method is2D.

canRestAtPlace

public boolean canRestAtPlace ()

Method canRestAtPlace.

getDesiredAltitudeWeight

public double getDesiredAltitudeWeight ()

Method getDesiredAltitudeWeight.

getHeightOverGround

public double getHeightOverGround ()

Method getHeightOverGround.

estimateVelocity

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

Method estimateVelocity.

Parameters:
final Steering steering
@Nonnull final Vector3d velocityOut

updateModelParameters

public void updateModelParameters (final Ref ref, final Model model, @Nonnull final Box boundingBox, final ComponentAccessor componentAccessor)

Method updateModelParameters.

Parameters:
final Ref ref
final Model model
@Nonnull final Box boundingBox
final ComponentAccessor componentAccessor

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

relativeSwimDepthToBoundingBox

static double relativeSwimDepthToBoundingBox (final double swimDepth, @Nullable final Box boundingBox, final float eyeHeight)

Method relativeSwimDepthToBoundingBox.

Parameters:
final double swimDepth
@Nullable final Box boundingBox
final float eyeHeight

relativeSwimDepthToHeight

static double relativeSwimDepthToHeight (final double swimDepth, @Nullable final Box boundingBox, final float eyeHeight)

Method relativeSwimDepthToHeight.

Parameters:
final double swimDepth
@Nullable final Box boundingBox
final float eyeHeight

getDampingDeceleration

public double getDampingDeceleration ()

Method getDampingDeceleration.