Class EntityHit

java.lang.Object
com.hypixel.hytale.server.npc.movement.controllers.EntityHit

public final class EntityHit extends Object
Snapshot of an entity hit during the rail step.

Instances are pooled by RailStepResult and reused across ticks. The contained vectors are stable references owned by this instance; callers must copy them if they need to retain the data past the next RailStepResult.reset().

No surface normal is reported; callers can use the rail step's translation direction as the approximate contact direction and sourcePosition as the exact hit point on the target's AABB.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Reference to the hit entity (player or NPC).
    boolean
    true when the hit entity is a player.
    final org.joml.Vector3d
    Source (charging) entity position at impact, i.e.
    double
    Scale along the requested translation in [0, 1].
    final org.joml.Vector3d
    Hit entity's transform position snapshotted at scan time.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assign(Ref<EntityStore> entity, boolean isPlayer, org.joml.Vector3dc sourcePosition, org.joml.Vector3dc targetPosition, double t)
     

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entity

      @Nullable public Ref<EntityStore> entity
      Reference to the hit entity (player or NPC).
    • isPlayer

      public boolean isPlayer
      true when the hit entity is a player.
    • sourcePosition

      @Nonnull public final org.joml.Vector3d sourcePosition
      Source (charging) entity position at impact, i.e. pos + t * translation.
    • targetPosition

      @Nonnull public final org.joml.Vector3d targetPosition
      Hit entity's transform position snapshotted at scan time.
    • t

      public double t
      Scale along the requested translation in [0, 1].
  • Constructor Details

    • EntityHit

      public EntityHit()
  • Method Details

    • assign

      public void assign(@Nonnull Ref<EntityStore> entity, boolean isPlayer, @Nonnull org.joml.Vector3dc sourcePosition, @Nonnull org.joml.Vector3dc targetPosition, double t)