public class BodyMotionFind extends BodyMotionFindWithTarget
Class BodyMotionFind. Provides bodymotionfind functionality for the Hytale server.
java.lang.Object > BodyMotionFindWithTarget > BodyMotionFind
Field Summary
effectiveDistanceSquared
protected
double
effectiveDistanceSquared
Field effectiveDistanceSquared.
heightDifference
final
double[]
heightDifference
Field heightDifference.
transformComponent
final
TransformComponent
transformComponent
Field transformComponent.
position
final
Vector3d
position
Field position.
targetPosition
final
Vector3d
targetPosition
Field targetPosition.
motionController
final
MotionController
motionController
Field motionController.
desiredAltitudeWeight
final
double
desiredAltitudeWeight
Field desiredAltitudeWeight.
differenceY
final
double
differenceY
Field differenceY.
aStarWithTarget
final
AStarWithTarget
aStarWithTarget
Field aStarWithTarget.
bodyRotation
final
Vector3f
bodyRotation
Field bodyRotation.
direction
final
Vector3d
direction
Field direction.
Method Detail
BodyMotionFind
public
public
BodyMotionFind
(@Nonnull final BuilderBodyMotionFind builderMotionFind, @Nonnull final BuilderSupport support)
Method BodyMotionFind.
- Parameters:
@Nonnull final BuilderBodyMotionFindbuilderMotionFind@Nonnull final BuilderSupportsupport
canSwitchToSteering
protected
boolean
canSwitchToSteering
(@Nonnull final Ref ref, @Nonnull final MotionController motionController, @Nonnull final ComponentAccessor componentAccessor)
Method canSwitchToSteering.
- Parameters:
@Nonnull final Refref@Nonnull final MotionControllermotionController@Nonnull final ComponentAccessorcomponentAccessor
shouldSkipSteering
protected
boolean
shouldSkipSteering
(@Nonnull final Ref ref, @Nonnull final MotionController activeMotionController, @Nonnull final Vector3d position, @Nonnull final ComponentAccessor componentAccessor)
Method shouldSkipSteering.
- Parameters:
@Nonnull final Refref@Nonnull final MotionControlleractiveMotionController@Nonnull final Vector3dposition@Nonnull final ComponentAccessorcomponentAccessor
computeSteering
protected
boolean
computeSteering
(@Nonnull final Ref ref, @Nonnull final Role role, @Nonnull final Vector3d position, @Nonnull final Steering desiredSteering, @Nonnull final ComponentAccessor componentAccessor)
Method computeSteering.
- Parameters:
@Nonnull final Refref@Nonnull final Rolerole@Nonnull final Vector3dposition@Nonnull final SteeringdesiredSteering@Nonnull final ComponentAccessorcomponentAccessor
canComputeMotion
public
boolean
canComputeMotion
(@Nonnull final Ref ref, @Nonnull final Role role, @Nullable final InfoProvider infoProvider, @Nonnull final ComponentAccessor componentAccessor)
Method canComputeMotion.
- Parameters:
@Nonnull final Refref@Nonnull final Rolerole@Nullable final InfoProviderinfoProvider@Nonnull final ComponentAccessorcomponentAccessor
isGoalReached
protected
boolean
isGoalReached
(@Nonnull final Ref ref, @Nonnull final MotionController motionController, @Nonnull final Vector3d position, @Nonnull final Vector3d targetPosition, @Nonnull final ComponentAccessor componentAccessor)
Method isGoalReached.
- Parameters:
@Nonnull final Refref@Nonnull final MotionControllermotionController@Nonnull final Vector3dposition@Nonnull final Vector3dtargetPosition@Nonnull final ComponentAccessorcomponentAccessor
estimateToGoal
public
float
estimateToGoal
(@Nonnull final AStarBase aStarBase, @Nonnull final Vector3d fromPosition, final MotionController motionController)
Method estimateToGoal.
- Parameters:
@Nonnull final AStarBaseaStarBase@Nonnull final Vector3dfromPositionfinal MotionControllermotionController
findBestPath
Method findBestPath.
- Parameters:
@Nonnull final AStarBaseaStarBasefinal MotionControllercontroller
onThrottling
protected
void
onThrottling
(final MotionController motionController, @Nonnull final Ref ref, @Nonnull final Steering steering, @Nonnull final ComponentAccessor componentAccessor)
Method onThrottling.
- Parameters:
final MotionControllermotionController@Nonnull final Refref@Nonnull final Steeringsteering@Nonnull final ComponentAccessorcomponentAccessor
onDeferring
protected
void
onDeferring
(final MotionController motionController, @Nonnull final Ref ref, @Nonnull final Steering steering, @Nonnull final ComponentAccessor componentAccessor)
Method onDeferring.
- Parameters:
final MotionControllermotionController@Nonnull final Refref@Nonnull final Steeringsteering@Nonnull final ComponentAccessorcomponentAccessor
lookAtTarget
protected
void
lookAtTarget
(@Nonnull final Ref ref, @Nonnull final Steering steering, @Nonnull final ComponentAccessor componentAccessor)
Method lookAtTarget.
- Parameters:
@Nonnull final Refref@Nonnull final Steeringsteering@Nonnull final ComponentAccessorcomponentAccessor
canReachTarget
protected
boolean
canReachTarget
(@Nonnull final Ref ref, @Nonnull final MotionController motionController, @Nonnull final Vector3d position, @Nonnull final Vector3d targetPosition, @Nonnull final ComponentAccessor componentAccessor)
Method canReachTarget.
- Parameters:
@Nonnull final Refref@Nonnull final MotionControllermotionController@Nonnull final Vector3dposition@Nonnull final Vector3dtargetPosition@Nonnull final ComponentAccessorcomponentAccessor
isBoundingBoxesOverlapping
protected
boolean
isBoundingBoxesOverlapping
(@Nonnull final Vector3d position, @Nonnull final Vector3d endPosition)
Method isBoundingBoxesOverlapping.
- Parameters:
@Nonnull final Vector3dposition@Nonnull final Vector3dendPosition
containsPosition
public
return
containsPosition
(position.x, this.selfBoundingBox.min.x - this.targetBoundingBox.max.x, this.selfBoundingBox.max.x - this.targetBoundingBox.min.x, endPosition.x)
Method containsPosition.
- Parameters:
position.xposition.xthis.selfBoundingBox.min.x -this.targetBoundingBox.max.xthis.selfBoundingBox.max.x -this.targetBoundingBox.min.xendPosition.xendPosition.x