Record Class CachedOrientedBoundingBox

java.lang.Object
java.lang.Record
dev.gothickit.zenkit.CachedOrientedBoundingBox
All Implemented Interfaces:
CacheableObject<CachedOrientedBoundingBox>, OrientedBoundingBox

public record CachedOrientedBoundingBox(@NotNull Vec3f center, @NotNull Vec3f @NotNull [] axes, @NotNull Vec3f halfWidth, @NotNull List<OrientedBoundingBox> children) extends Record implements OrientedBoundingBox
  • Constructor Details

    • CachedOrientedBoundingBox

      public CachedOrientedBoundingBox(@NotNull @NotNull Vec3f center, @NotNull @NotNull Vec3f @NotNull [] axes, @NotNull @NotNull Vec3f halfWidth, @NotNull @NotNull List<OrientedBoundingBox> children)
      Creates an instance of a CachedOrientedBoundingBox record class.
      Parameters:
      center - the value for the center record component
      axes - the value for the axes record component
      halfWidth - the value for the halfWidth record component
      children - the value for the children record component
  • Method Details

    • childCount

      public long childCount()
      Specified by:
      childCount in interface OrientedBoundingBox
    • child

      @Nullable public @Nullable OrientedBoundingBox child(long i)
      Specified by:
      child in interface OrientedBoundingBox
    • cache

      @NotNull public @NotNull CachedOrientedBoundingBox cache()
      Specified by:
      cache in interface CacheableObject<CachedOrientedBoundingBox>
    • isCached

      public boolean isCached()
      Specified by:
      isCached in interface CacheableObject<CachedOrientedBoundingBox>
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • center

      @NotNull public @NotNull Vec3f center()
      Returns the value of the center record component.
      Specified by:
      center in interface OrientedBoundingBox
      Returns:
      the value of the center record component
    • axes

      @NotNull public @NotNull Vec3f @NotNull [] axes()
      Returns the value of the axes record component.
      Specified by:
      axes in interface OrientedBoundingBox
      Returns:
      the value of the axes record component
    • halfWidth

      @NotNull public @NotNull Vec3f halfWidth()
      Returns the value of the halfWidth record component.
      Specified by:
      halfWidth in interface OrientedBoundingBox
      Returns:
      the value of the halfWidth record component
    • children

      @NotNull public @NotNull List<OrientedBoundingBox> children()
      Returns the value of the children record component.
      Specified by:
      children in interface OrientedBoundingBox
      Returns:
      the value of the children record component