Interface IPositionSet

All Known Implementing Classes:
EntityPositionProvider, PositionSetProvider

public interface IPositionSet
A position provider that can expose more than one matched element. The primary (e.g. the prioritiser's pick) is at index 0. Single-element providers report a size of 1. This lets actions such as ForEach iterate every match a sensor produced rather than only the primary returned by IPositionProvider.getTarget().
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    getOrientation(int index, Rotation3f out)
    Writes the orientation of element index into out, when that element carries one.
    boolean
    getPosition(int index, org.joml.Vector3d out)
    Writes the position of element index into out.
    getTarget(int index)
     
    int
     
  • Method Details

    • size

      int size()
      Returns:
      the number of elements in the set (0 when empty).
    • getTarget

      @Nullable Ref<EntityStore> getTarget(int index)
      Returns:
      the entity associated with element index, or null when the element is a bare position with no entity (e.g. a computed point), when index is out of range, or when the entity is no longer valid.
    • getPosition

      boolean getPosition(int index, org.joml.Vector3d out)
      Writes the position of element index into out.
      Returns:
      true if a position was written. false if index is out of range.
    • getOrientation

      default boolean getOrientation(int index, Rotation3f out)
      Writes the orientation of element index into out, when that element carries one.
      Returns:
      true if an orientation was written, false otherwise (in which case out is left untouched).