Record Class BlueprintElement.Mesh

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintElement.Mesh
Record Components:
origin - the pivot point of the mesh
rotation - the rotation of the mesh
faces - the list of faces forming the mesh
visibility - whether the mesh is visible
All Implemented Interfaces:
BlueprintElement
Enclosing interface:
BlueprintElement

public static record BlueprintElement.Mesh(@NotNull Float3 origin, @NotNull Float3 rotation, @NotNull List<BlueprintElement.Mesh.Face> faces, boolean visibility) extends Record implements BlueprintElement
Represents a mesh element, allowing for complex geometry beyond simple cubes.
Since:
3.0.0
  • Constructor Details

    • Mesh

      public Mesh(@NotNull @NotNull Float3 origin, @NotNull @NotNull Float3 rotation, @NotNull @NotNull List<BlueprintElement.Mesh.Face> faces, boolean visibility)
      Creates an instance of a Mesh record class.
      Parameters:
      origin - the value for the origin record component
      rotation - the value for the rotation record component
      faces - the value for the faces record component
      visibility - the value for the visibility record component
  • Method Details

    • toShape

      @NotNull public @NotNull @Unmodifiable List<io.github.toxicity188.javamesh.MeshShape> toShape(@NotNull @NotNull Float3 parentOrigin)
      Converts this mesh into a list of MeshShape for rendering.
      Parameters:
      parentOrigin - the origin of the parent bone
      Returns:
      an unmodifiable list of mesh shapes
      Since:
      3.0.0
    • 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.
    • origin

      @NotNull public @NotNull Float3 origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • rotation

      @NotNull public @NotNull Float3 rotation()
      Returns the value of the rotation record component.
      Specified by:
      rotation in interface BlueprintElement
      Returns:
      the value of the rotation record component
    • faces

      @NotNull public @NotNull List<BlueprintElement.Mesh.Face> faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component
    • visibility

      public boolean visibility()
      Returns the value of the visibility record component.
      Specified by:
      visibility in interface BlueprintElement
      Returns:
      the value of the visibility record component