Record Class CachedMesh

java.lang.Object
java.lang.Record
dev.gothickit.zenkit.msh.CachedMesh
All Implemented Interfaces:
CacheableObject<CachedMesh>, Mesh

public record CachedMesh(@NotNull Calendar sourceDate, @NotNull String name, @NotNull AxisAlignedBoundingBox boundingBox, @NotNull OrientedBoundingBox orientedBoundingBox, @NotNull List<@NotNull Material> materials, @NotNull Vec3f @NotNull [] positions, @NotNull Vertex @NotNull [] vertices, @NotNull List<@NotNull LightMap> lightMaps, @NotNull List<@NotNull Polygon> polygons) extends Record implements Mesh
  • Constructor Details

    • CachedMesh

      public CachedMesh(@NotNull @NotNull Calendar sourceDate, @NotNull @NotNull String name, @NotNull @NotNull AxisAlignedBoundingBox boundingBox, @NotNull @NotNull OrientedBoundingBox orientedBoundingBox, @NotNull @NotNull List<@NotNull Material> materials, @NotNull @NotNull Vec3f @NotNull [] positions, @NotNull @NotNull Vertex @NotNull [] vertices, @NotNull @NotNull List<@NotNull LightMap> lightMaps, @NotNull @NotNull List<@NotNull Polygon> polygons)
      Creates an instance of a CachedMesh record class.
      Parameters:
      sourceDate - the value for the sourceDate record component
      name - the value for the name record component
      boundingBox - the value for the boundingBox record component
      orientedBoundingBox - the value for the orientedBoundingBox record component
      materials - the value for the materials record component
      positions - the value for the positions record component
      vertices - the value for the vertices record component
      lightMaps - the value for the lightMaps record component
      polygons - the value for the polygons record component
  • Method Details

    • materialCount

      public long materialCount()
      Specified by:
      materialCount in interface Mesh
    • material

      @Nullable public @Nullable Material material(long i)
      Specified by:
      material in interface Mesh
    • lightMapCount

      public long lightMapCount()
      Specified by:
      lightMapCount in interface Mesh
    • lightMap

      @Nullable public @Nullable LightMap lightMap(long i)
      Specified by:
      lightMap in interface Mesh
    • polygonCount

      public long polygonCount()
      Specified by:
      polygonCount in interface Mesh
    • polygon

      @Nullable public @Nullable Polygon polygon(long i)
      Specified by:
      polygon in interface Mesh
    • cache

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

      public boolean isCached()
      Specified by:
      isCached in interface CacheableObject<CachedMesh>
    • 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.
    • sourceDate

      @NotNull public @NotNull Calendar sourceDate()
      Returns the value of the sourceDate record component.
      Specified by:
      sourceDate in interface Mesh
      Returns:
      the value of the sourceDate record component
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Specified by:
      name in interface Mesh
      Returns:
      the value of the name record component
    • boundingBox

      @NotNull public @NotNull AxisAlignedBoundingBox boundingBox()
      Returns the value of the boundingBox record component.
      Specified by:
      boundingBox in interface Mesh
      Returns:
      the value of the boundingBox record component
    • orientedBoundingBox

      @NotNull public @NotNull OrientedBoundingBox orientedBoundingBox()
      Returns the value of the orientedBoundingBox record component.
      Specified by:
      orientedBoundingBox in interface Mesh
      Returns:
      the value of the orientedBoundingBox record component
    • materials

      @NotNull public @NotNull List<@NotNull Material> materials()
      Returns the value of the materials record component.
      Specified by:
      materials in interface Mesh
      Returns:
      the value of the materials record component
    • positions

      @NotNull public @NotNull Vec3f @NotNull [] positions()
      Returns the value of the positions record component.
      Specified by:
      positions in interface Mesh
      Returns:
      the value of the positions record component
    • vertices

      @NotNull public @NotNull Vertex @NotNull [] vertices()
      Returns the value of the vertices record component.
      Specified by:
      vertices in interface Mesh
      Returns:
      the value of the vertices record component
    • lightMaps

      @NotNull public @NotNull List<@NotNull LightMap> lightMaps()
      Returns the value of the lightMaps record component.
      Specified by:
      lightMaps in interface Mesh
      Returns:
      the value of the lightMaps record component
    • polygons

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