Record Class ModelElement.Mesh

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelElement.Mesh
Record Components:
uuid - the UUID of the mesh
origin - the pivot point (origin) of the mesh
rotation - the rotation of the mesh
vertices - a map of vertex identifiers to their 3D positions
faces - a map of face identifiers to their face data
_visibility - the visibility state (null means visible)
All Implemented Interfaces:
ModelElement
Enclosing interface:
ModelElement

public static record ModelElement.Mesh(@NotNull String uuid, @Nullable Float3 origin, @Nullable Float3 rotation, @NotNull Map<String,Float3> vertices, @NotNull Map<String, ModelElement.Mesh.Face> faces, @Nullable Boolean _visibility) extends Record implements ModelElement
Represents a mesh element, allowing for complex geometry beyond simple cubes.
Since:
3.0.0
  • Constructor Details

    • Mesh

      public Mesh(@NotNull @NotNull String uuid, @Nullable @Nullable Float3 origin, @Nullable @Nullable Float3 rotation, @NotNull @NotNull Map<String,Float3> vertices, @NotNull @NotNull Map<String, ModelElement.Mesh.Face> faces, @Nullable @Nullable Boolean _visibility)
      Creates an instance of a Mesh record class.
      Parameters:
      uuid - the value for the uuid record component
      origin - the value for the origin record component
      rotation - the value for the rotation record component
      vertices - the value for the vertices record component
      faces - the value for the faces record component
      _visibility - the value for the _visibility record component
  • Method Details

    • origin

      @NotNull public @NotNull Float3 origin()
      Returns the pivot point (origin) of the mesh.
      Returns:
      the origin vector, or Float3.ZERO if not specified
      Since:
      3.0.0
    • rotation

      @NotNull public @NotNull Float3 rotation()
      Returns the rotation of the mesh.
      Returns:
      the rotation vector, or Float3.ZERO if not specified
      Since:
      3.0.0
    • type

      @NotNull public @NotNull String type()
      Returns the type identifier of this element.
      Specified by:
      type in interface ModelElement
      Returns:
      ModelElement.MESH
      Since:
      3.0.0
    • visibility

      public boolean visibility()
    • toBlueprint

      @NotNull public @NotNull BlueprintElement toBlueprint()
      Description copied from interface: ModelElement
      Converts this raw element into a processed BlueprintElement.
      Specified by:
      toBlueprint in interface ModelElement
      Returns:
      the blueprint element
    • 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.
    • uuid

      @NotNull public @NotNull String uuid()
      Returns the value of the uuid record component.
      Specified by:
      uuid in interface ModelElement
      Returns:
      the value of the uuid record component
    • vertices

      @NotNull public @NotNull Map<String,Float3> vertices()
      Returns the value of the vertices record component.
      Returns:
      the value of the vertices record component
    • faces

      @NotNull public @NotNull Map<String, ModelElement.Mesh.Face> faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component
    • _visibility

      @SerializedName("visibility") @Nullable public @Nullable Boolean _visibility()
      Returns the value of the _visibility record component.
      Returns:
      the value of the _visibility record component