Record Class WorldHitResult

java.lang.Object
java.lang.Record
com.render.api.world.WorldHitResult

public record WorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex) extends Record
Result of scene picking against a retained object or instance.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex)
    Creates an instance of a WorldHitResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the distance record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the instanceHandle record component.
    net.minecraft.world.phys.Vec3
    Returns the value of the normal record component.
    Returns the value of the object record component.
    long
    Returns the value of the pickId record component.
    net.minecraft.world.phys.Vec3
    Returns the value of the position record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the triangleIndex record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WorldHitResult

      public WorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex)
      Creates an instance of a WorldHitResult record class.
      Parameters:
      object - the value for the object record component
      pickId - the value for the pickId record component
      instanceHandle - the value for the instanceHandle record component
      position - the value for the position record component
      normal - the value for the normal record component
      distance - the value for the distance record component
      triangleIndex - the value for the triangleIndex record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • object

      public WorldObject<?> object()
      Returns the value of the object record component.
      Returns:
      the value of the object record component
    • pickId

      public long pickId()
      Returns the value of the pickId record component.
      Returns:
      the value of the pickId record component
    • instanceHandle

      public long instanceHandle()
      Returns the value of the instanceHandle record component.
      Returns:
      the value of the instanceHandle record component
    • position

      public net.minecraft.world.phys.Vec3 position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • normal

      public net.minecraft.world.phys.Vec3 normal()
      Returns the value of the normal record component.
      Returns:
      the value of the normal record component
    • distance

      public double distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • triangleIndex

      public int triangleIndex()
      Returns the value of the triangleIndex record component.
      Returns:
      the value of the triangleIndex record component