public class MotionControllerWalk extends MotionControllerBase
Class MotionControllerWalk. Provides motioncontrollerwalk functionality for the Hytale server.
java.lang.Object > MotionControllerBase > MotionControllerWalk
Field Summary
onGround
Field onGround.
inWater
Field inWater.
horizontalSpeedMultiplier
Field horizontalSpeedMultiplier.
fallStartHeight
Field fallStartHeight.
fallSpeed
Field fallSpeed.
currentRelativeSpeed
Field currentRelativeSpeed.
isFullyRotated
Field isFullyRotated.
belowBlockType
Field belowBlockType.
belowBlockTypeId
Field belowBlockTypeId.
footingBlocks
Field footingBlocks.
footingFillers
Field footingFillers.
footingRotations
Field footingRotations.
footingBlocksValid
Field footingBlocksValid.
breathingDepth
Field breathingDepth.
constraintDepth
Field constraintDepth.
climbUpDistance
Field climbUpDistance.
currentJumpHeight
Field currentJumpHeight.
jumpDropHeight
Field jumpDropHeight.
jumpBlockHeight
Field jumpBlockHeight.
predictedFallHeight
Field predictedFallHeight.
currentClimbForwardDistance
Field currentClimbForwardDistance.
maxClimbForwardDistance
Field maxClimbForwardDistance.
totalDropDistance
Field totalDropDistance.
climbSpeed
Field climbSpeed.
jumping
Field jumping.
position
Field position.
transformComponent
Field transformComponent.
npcComponent
Field npcComponent.
dropDist
Field dropDist.
position2
Field position2.
scale
Field scale.
derivate
Field derivate.
position3
Field position3.
isRunning
Field isRunning.
motionKind
Field motionKind.
eyeHeight
Field eyeHeight.
max
Field max.
size
Field size.
rotation
Field rotation.
world
Field world.
wasOnGround
Field wasOnGround.
bottomY
Field bottomY.
xPos
Field xPos.
zPos
Field zPos.
minBlockX
Field minBlockX.
maxBlockX
Field maxBlockX.
minBlockZ
Field minBlockZ.
maxBlockZ
Field maxBlockZ.
minChunkX
Field minChunkX.
maxChunkX
Field maxChunkX.
minChunkZ
Field minChunkZ.
maxChunkZ
Field maxChunkZ.
chunk
Field chunk.
minX
Field minX.
maxX
Field maxX.
minZ
Field minZ.
maxZ
Field maxZ.
chunkSection
Field chunkSection.
block
Field block.
boxBlockIntersectionEvaluator
Field boxBlockIntersectionEvaluator.
chunkMinBlockX
Field chunkMinBlockX.
chunkMinBlockZ
Field chunkMinBlockZ.
minX2
Field minX2.
maxX2
Field maxX2.
minZ2
Field minZ2.
maxZ2
Field maxZ2.
filler
Field filler.
blockId
Field blockId.
blockType
Field blockType.
material
Field material.
boundingBoxes
Field boundingBoxes.
rotatedBoxes
Field rotatedBoxes.
x3
Field x3.
y2
Field y2.
z3
Field z3.
chunkRef
Field chunkRef.
chunkStore
Field chunkStore.
worldChunkComponent
Field worldChunkComponent.
fxIndex
Field fxIndex.
fx
Field fx.
positionDataComponent
Field positionDataComponent.
chunkStore2
Field chunkStore2.
blockChunkComponent
Field blockChunkComponent.
originalY
Field originalY.
retCode
Field retCode.
chunkIndex
Field chunkIndex.
blockChunk
Field blockChunk.
x
Field x.
z
Field z.
isFiller
Field isFiller.
boxesAsset
Field boxesAsset.
yBottom
Field yBottom.
rotation2
Field rotation2.
filler2
Field filler2.
blockId2
Field blockId2.
blockType2
Field blockType2.
rotatedBoxes2
Field rotatedBoxes2.
top2
Field top2.
direction
Field direction.
maxVerticalSpeed
Field maxVerticalSpeed.
maxHorizontalSpeed
Field maxHorizontalSpeed.
isDead
Field isDead.
velocityComponent
Field velocityComponent.
velocity
Field velocity.
entry
Field entry.
headingX
Field headingX.
headingZ
Field headingZ.
length2
Field length2.
speed
Field speed.
maxDistance
Field maxDistance.
jumpDiff
Field jumpDiff.
heightAboveBlock
Field heightAboveBlock.
prevDistance
Field prevDistance.
remaining
Field remaining.
newRemaining
Field newRemaining.
maxForwardDistance
Field maxForwardDistance.
scaledDiff
Field scaledDiff.
canAct
Field canAct.
epsilon
Field epsilon.
maxRotation
Field maxRotation.
turnAngle
Field turnAngle.
velocityComponent2
Field velocityComponent2.
velocity2
Field velocity2.
prevFallSpeed
Field prevFallSpeed.
deltaFallSpeed
Field deltaFallSpeed.
maxSpeed
Field maxSpeed.
maxDistance2
Field maxDistance2.
lenSquared
Field lenSquared.
len
Field len.
hitbox
Field hitbox.
invertedGravityModifier
Field invertedGravityModifier.
terminalVelocity
Field terminalVelocity.
gravityStep
Field gravityStep.
avoidingBlockDamage
Field avoidingBlockDamage.
relaxMoveConstraints
Field relaxMoveConstraints.
oldState
Field oldState.
shortMove
Field shortMove.
needsRotation
Field needsRotation.
remainingTranslation
Field remainingTranslation.
t
Field t.
fallHeight
Field fallHeight.
c
Field c.
saveSegments
Field saveSegments.
probeMovement
Field probeMovement.
probePosition
Field probePosition.
initialPosition
Field initialPosition.
targetPosition
Field targetPosition.
directionComponentSelector
Field directionComponentSelector.
collisionModule
Field collisionModule.
stopOnDamageBlocks
Field stopOnDamageBlocks.
relaxedMoveConstraints
Field relaxedMoveConstraints.
endSlide
Field endSlide.
distance
Field distance.
climbHeight
Field climbHeight.
distance2
Field distance2.
epsilonAngle
Field epsilonAngle.
descendToDrop
Field descendToDrop.
moveLength
Field moveLength.
reduction
Field reduction.
b
Field b.
maxRotationSpeed
Field maxRotationSpeed.
arrivalTime
Field arrivalTime.
desiredHeading
Field desiredHeading.
newDistance
Field newDistance.
forwardScale
Field forwardScale.
newForwardDistance
Field newForwardDistance.
compensation
Field compensation.
canJump
Field canJump.
targetJumpHeight
Field targetJumpHeight.
high
Field high.
baseClimbUpDistance
Field baseClimbUpDistance.
forwardMax
Field forwardMax.
worldNormal
Field worldNormal.
saveComputeOverlaps
Field saveComputeOverlaps.
worldAntiNormal
Field worldAntiNormal.
bottom
Field bottom.
collisionStart
Field collisionStart.
collision
Field collision.
packed
Field packed.
fluidId
Field fluidId.
Method Detail
MotionControllerWalk
public
MotionControllerWalk
(@Nonnull final BuilderMotionControllerWalk builder, @Nonnull final BuilderSupport builderSupport)
Method MotionControllerWalk.
- Parameters:
@Nonnull final BuilderMotionControllerWalkbuilder@Nonnull final BuilderSupportbuilderSupport
getType
String
getType
()
Method getType.
spawned
void
spawned
()
Method spawned.
getWanderVerticalMovementRatio
double
getWanderVerticalMovementRatio
()
Method getWanderVerticalMovementRatio.
getDesiredVerticalRange
MotionController.VerticalRange
getDesiredVerticalRange
(@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)
Method getDesiredVerticalRange.
- Parameters:
@Nonnull final Refref@Nonnull final ComponentAccessorcomponentAccessor
adjustReadPosition
Method adjustReadPosition.
- Parameters:
final Refreffinal ComponentAccessorcomponentAccessor
adjustWritePosition
void
adjustWritePosition
(final Ref ref, final double dt, @Nonnull final ComponentAccessor componentAccessor)
Method adjustWritePosition.
- Parameters:
final Refreffinal doubledt@Nonnull final ComponentAccessorcomponentAccessor
if
else
if
(this.switchedToMotionKind(MotionKind.ASCENDING)
Method if.
- Parameters:
this.switchedToMotionKind(MotionKind.ASCENDINGthis.switchedToMotionKind(MotionKind.ASCENDING
updateAscendingStates
void
updateAscendingStates
(@Nonnull final Ref ref, @Nonnull final MovementStates movementStates, final boolean fastMotionKind, final boolean horizontalIdleKind, @Nonnull final ComponentAccessor componentAccessor)
Method updateAscendingStates.
- Parameters:
@Nonnull final Refref@Nonnull final MovementStatesmovementStatesfinal booleanfastMotionKindfinal booleanhorizontalIdleKind@Nonnull final ComponentAccessorcomponentAccessor
updateDescendingStates
void
updateDescendingStates
(@Nonnull final Ref ref, @Nonnull final MovementStates movementStates, final boolean fastMotionKind, final boolean hovering, @Nonnull final ComponentAccessor componentAccessor)
Method updateDescendingStates.
- Parameters:
@Nonnull final Refref@Nonnull final MovementStatesmovementStatesfinal booleanfastMotionKindfinal booleanhovering@Nonnull final ComponentAccessorcomponentAccessor
isFastMotionKind
boolean
isFastMotionKind
(final double speed)
Method isFastMotionKind.
- Parameters:
final doublespeed
isInProgress
boolean
isInProgress
()
Method isInProgress.
canAct
Method canAct.
- Parameters:
@Nonnull final Refref@Nonnull final ComponentAccessorcomponentAccessor
updateModelParameters
void
updateModelParameters
(final Ref ref, final Model model, @Nonnull final Box boundingBox, final ComponentAccessor componentAccessor)
Method updateModelParameters.
- Parameters:
final Refreffinal Modelmodel@Nonnull final BoxboundingBoxfinal ComponentAccessorcomponentAccessor
constrainRotations
Method constrainRotations.
- Parameters:
final Rolerole@Nonnull final TransformComponenttransform
forceVelocity
void
forceVelocity
(@Nonnull final Vector3d velocity, final VelocityConfig velocityConfig, final boolean ignoreDamping)
Method forceVelocity.
- Parameters:
@Nonnull final Vector3dvelocityfinal VelocityConfigvelocityConfigfinal booleanignoreDamping
inAir
boolean
inAir
()
Method inAir.
onGround
boolean
onGround
()
Method onGround.
standingOnBlockOfType
boolean
standingOnBlockOfType
(final int blockSet)
Method standingOnBlockOfType.
- Parameters:
final intblockSet
inWater
boolean
inWater
()
Method inWater.
touchesWater
boolean
touchesWater
(final boolean defaultValue, @Nonnull final ComponentAccessor componentAccessor)
Method touchesWater.
- Parameters:
final booleandefaultValue@Nonnull final ComponentAccessorcomponentAccessor
getCurrentSpeed
double
getCurrentSpeed
()
Method getCurrentSpeed.
getCurrentTurnRadius
double
getCurrentTurnRadius
()
Method getCurrentTurnRadius.
getMaxClimbAngle
float
getMaxClimbAngle
()
Method getMaxClimbAngle.
getMaxSinkAngle
float
getMaxSinkAngle
()
Method getMaxSinkAngle.
getMaximumSpeed
double
getMaximumSpeed
()
Method getMaximumSpeed.
is2D
boolean
is2D
()
Method is2D.
canRestAtPlace
boolean
canRestAtPlace
()
Method canRestAtPlace.
getDesiredAltitudeWeight
double
getDesiredAltitudeWeight
()
Method getDesiredAltitudeWeight.
getHeightOverGround
double
getHeightOverGround
()
Method getHeightOverGround.
estimateVelocity
boolean
estimateVelocity
(@Nonnull final Steering steering, @Nonnull final Vector3d velocityOut)
Method estimateVelocity.
- Parameters:
@Nonnull final Steeringsteering@Nonnull final Vector3dvelocityOut
postReadPosition
void
postReadPosition
(@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)
Method postReadPosition.
- Parameters:
@Nonnull final Refref@Nonnull final ComponentAccessorcomponentAccessor
translateToAccessiblePosition
boolean
translateToAccessiblePosition
(@Nonnull final Vector3d position, @Nullable final Box boundingBox, double minYValue, double maxYValue, final ComponentAccessor componentAccessor)
Method translateToAccessiblePosition.
- Parameters:
@Nonnull final Vector3dposition@Nullable final BoxboundingBoxdoubleminYValuedoublemaxYValuefinal ComponentAccessorcomponentAccessor
computeMove
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 Refref@Nonnull final Rolerole@Nonnull final Steeringsteeringfinal doubledt@Nonnull final Vector3dtranslation@Nonnull final ComponentAccessorcomponentAccessor
computeNewFallSpeed
double
computeNewFallSpeed
(final double dt, double fallSpeed)
Method computeNewFallSpeed.
- Parameters:
final doubledtdoublefallSpeed
executeMove
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 Refref@Nonnull final Roleroledoubledt@Nonnull final Vector3dtranslation@Nonnull final ComponentAccessorcomponentAccessor
newpos
s
newpos
(succ|fail)
Method newpos.
- Parameters:
succ|failsucc|fail
probeMove
double
probeMove
(@Nonnull final Ref ref, @Nonnull final ProbeMoveData probeMoveData, @Nonnull final ComponentAccessor componentAccessor)
Method probeMove.
- Parameters:
@Nonnull final Refref@Nonnull final ProbeMoveDataprobeMoveData@Nonnull final ComponentAccessorcomponentAccessor
postExecuteMove
void
postExecuteMove
()
Method postExecuteMove.
getCurrentMaxBodyRotationSpeed
double
getCurrentMaxBodyRotationSpeed
()
Method getCurrentMaxBodyRotationSpeed.
computeHeading
float
computeHeading
(final float desiredAngle, final double relativeTurnSpeed, float heading, final double dt, final boolean updateFullyRotated, final boolean stopIfTurnedTooFar)
Method computeHeading.
- Parameters:
final floatdesiredAnglefinal doublerelativeTurnSpeedfloatheadingfinal doubledtfinal booleanupdateFullyRotatedfinal booleanstopIfTurnedTooFar
initiateDescend
boolean
initiateDescend
(@Nonnull final Vector3d translation, final boolean wasOnGround, final String logName, @Nonnull final ComponentAccessor componentAccessor)
Method initiateDescend.
- Parameters:
@Nonnull final Vector3dtranslationfinal booleanwasOnGroundfinal StringlogName@Nonnull final ComponentAccessorcomponentAccessor
updateMovementVector
double
updateMovementVector
(@Nonnull final Vector3d probePosition, @Nonnull final Vector3d probeMovement, @Nonnull final Vector3d targetPosition, @Nonnull final Vector3d directionComponentSelector)
Method updateMovementVector.
- Parameters:
@Nonnull final Vector3dprobePosition@Nonnull final Vector3dprobeMovement@Nonnull final Vector3dtargetPosition@Nonnull final Vector3ddirectionComponentSelector
discardIgnorableSlideCollisions
BlockCollisionData
discardIgnorableSlideCollisions
(@Nonnull final CollisionResult collisionResult, @Nullable BlockCollisionData startCollision, final boolean acknowledgeDamage)
Method discardIgnorableSlideCollisions.
- Parameters:
@Nonnull final CollisionResultcollisionResult@Nullable BlockCollisionDatastartCollisionfinal booleanacknowledgeDamage
getFirstCollision
BlockCollisionData
getFirstCollision
(@Nonnull final CollisionResult collisionResult, final boolean acknowledgeDamage)
Method getFirstCollision.
- Parameters:
@Nonnull final CollisionResultcollisionResultfinal booleanacknowledgeDamage
bisect
double
bisect
(@Nonnull final Vector3d validPosition, @Nonnull final Vector3d invalidPosition, @Nonnull final Vector3d result, @Nonnull final ComponentAccessor componentAccessor)
Method bisect.
- Parameters:
@Nonnull final Vector3dvalidPosition@Nonnull final Vector3dinvalidPosition@Nonnull final Vector3dresult@Nonnull final ComponentAccessorcomponentAccessor
shortenMovement
double
shortenMovement
(@Nonnull final Vector3d start, @Nonnull final Vector3d end, @Nonnull final Vector3d result)
Method shortenMovement.
- Parameters:
@Nonnull final Vector3dstart@Nonnull final Vector3dend@Nonnull final Vector3dresult
validateTranslation
Method validateTranslation.
- Parameters:
@Nonnull final Vector3dtranslationfinal Stringkind
validateSpeeds
void
validateSpeeds
(@Nonnull final Ref ref, @Nonnull final String kind, @Nonnull final ComponentAccessor componentAccessor)
Method validateSpeeds.
- Parameters:
@Nonnull final Refref@Nonnull final Stringkind@Nonnull final ComponentAccessorcomponentAccessor
lockOrientation
void
lockOrientation
(@Nonnull final Steering steering, @Nonnull final Vector3d translation, final float heading)
Method lockOrientation.
- Parameters:
@Nonnull final Steeringsteering@Nonnull final Vector3dtranslationfinal floatheading
computeBlendHeading
float
computeBlendHeading
(final float heading, final float moveHeading, final double dt, final double speedEstimate, final double relativeTurnSpeed)
Method computeBlendHeading.
- Parameters:
final floatheadingfinal floatmoveHeadingfinal doubledtfinal doublespeedEstimatefinal doublerelativeTurnSpeed
computeBlendTurnAngle
float
computeBlendTurnAngle
(final float heading, final float moveHeading)
Method computeBlendTurnAngle.
- Parameters:
final floatheadingfinal floatmoveHeading
computeClimbMove
double
computeClimbMove
(@Nonnull final Vector3d climbDirection, double climbDistance, double distance, @Nonnull final Vector3d translation)
Method computeClimbMove.
- Parameters:
@Nonnull final Vector3dclimbDirectiondoubleclimbDistancedoubledistance@Nonnull final Vector3dtranslation
computeDescendDirection
Method computeDescendDirection.
- Parameters:
@Nonnull final Vector3dtranslation
computeClimbSpeed
double
computeClimbSpeed
(final double walkSpeed)
Method computeClimbSpeed.
- Parameters:
final doublewalkSpeed
tryClimb
boolean
tryClimb
(@Nonnull final Vector3d translation, final boolean avoidingBlockDamage, final boolean relaxMoveConstraints, @Nonnull final ComponentAccessor componentAccessor)
Method tryClimb.
- Parameters:
@Nonnull final Vector3dtranslationfinal booleanavoidingBlockDamagefinal booleanrelaxMoveConstraints@Nonnull final ComponentAccessorcomponentAccessor
computeClimbHeight
double
computeClimbHeight
(@Nonnull final Vector3d position, @Nonnull final Vector3d direction, double height, final double forward, @Nullable final Vector3d targetPosition, @Nonnull final Vector2d results, final boolean acknowledgeDamage, boolean relaxMoveConstraints, @Nonnull final ComponentAccessor componentAccessor)
Method computeClimbHeight.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final Vector3ddirectiondoubleheightfinal doubleforward@Nullable final Vector3dtargetPosition@Nonnull final Vector2dresultsfinal booleanacknowledgeDamagebooleanrelaxMoveConstraints@Nonnull final ComponentAccessorcomponentAccessor
isDropBlocked
boolean
isDropBlocked
(@Nonnull final Vector3d position, final double maxDropHeight, final boolean updatePosition, final boolean acknowledgeDamage, boolean relaxedMoveConstraints, @Nonnull final ComponentAccessor componentAccessor)
Method isDropBlocked.
- Parameters:
@Nonnull final Vector3dpositionfinal doublemaxDropHeightfinal booleanupdatePositionfinal booleanacknowledgeDamagebooleanrelaxedMoveConstraints@Nonnull final ComponentAccessorcomponentAccessor
dropDistance
double
dropDistance
(@Nonnull final Vector3d position, final double maxTestDistance, @Nonnull final ComponentAccessor componentAccessor)
Method dropDistance.
- Parameters:
@Nonnull final Vector3dpositionfinal doublemaxTestDistance@Nonnull final ComponentAccessorcomponentAccessor
findDropBlockCollision
BlockCollisionData
findDropBlockCollision
(@Nonnull final Vector3d position, final double maxTestDistance, @Nonnull final ComponentAccessor componentAccessor)
Method findDropBlockCollision.
- Parameters:
@Nonnull final Vector3dpositionfinal doublemaxTestDistance@Nonnull final ComponentAccessorcomponentAccessor
isClimbable
boolean
isClimbable
(@Nonnull final BlockType blockType, @Nonnull final Fluid fluid, final boolean avoidDamageBlocks)
Method isClimbable.
- Parameters:
@Nonnull final BlockTypeblockType@Nonnull final Fluidfluidfinal booleanavoidDamageBlocks
isValidWalkPosition
boolean
isValidWalkPosition
(@Nonnull final Ref chunkRef, @Nonnull final ComponentAccessor chunkStore, final double x, final double y, final double z, final boolean acknowledgeDamage, final boolean relaxedMoveConstraints)
Method isValidWalkPosition.
- Parameters:
@Nonnull final RefchunkRef@Nonnull final ComponentAccessorchunkStorefinal doublexfinal doubleyfinal doublezfinal booleanacknowledgeDamagefinal booleanrelaxedMoveConstraints
maxMoveFactor
double
maxMoveFactor
(@Nonnull final Vector3d position, @Nonnull final Vector3d velocity, final boolean acknowledgeDamage, @Nonnull final ComponentAccessor componentAccessor)
Method maxMoveFactor.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final Vector3dvelocityfinal booleanacknowledgeDamage@Nonnull final ComponentAccessorcomponentAccessor
AscentAnimationType
private
AscentAnimationType
(final String description)
Method AscentAnimationType.
- Parameters:
final Stringdescription
get
String
get
()
Method get.
DescentAnimationType
private
DescentAnimationType
(final String description)
Method DescentAnimationType.
- Parameters:
final Stringdescription