Record Class BlueprintElement.Cube
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintElement.Cube
- Record Components:
name- the name of the cubefrom- the starting coordinate (min corner)to- the ending coordinate (max corner)inflate- the inflation valuerotation- the rotation of the cubeorigin- the pivot point of the cubefaces- the UV mapping for the faceslightEmission- the light emission level (1-15 or null if 0)visibility- whether the cube is visible
- All Implemented Interfaces:
BlueprintElement
- Enclosing interface:
BlueprintElement
public static record BlueprintElement.Cube(@NotNull String name, @NotNull Float3 from, @NotNull Float3 to, float inflate, @NotNull Float3 rotation, @NotNull Float3 origin, @Nullable ModelFace faces, @Nullable Integer lightEmission, boolean visibility)
extends Record
implements BlueprintElement
Represents a cube element, the basic building block of a model.
- Since:
- 1.15.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface kr.toxicity.model.api.data.blueprint.BlueprintElement
BlueprintElement.Bone, BlueprintElement.Camera, BlueprintElement.Cube, BlueprintElement.Group, BlueprintElement.Locator, BlueprintElement.NullObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable ModelFacefaces()Returns the value of thefacesrecord component.@NotNull Float3from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.booleanChecks if this cube has any textures defined.floatinflate()Returns the value of theinflaterecord component.@Nullable IntegerReturns the value of thelightEmissionrecord component.floatCalculates the maximum distance from the origin to any corner of the cube.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull Float3origin()Returns the value of theoriginrecord component.@NotNull Float3rotation()Returns the value of therotationrecord component.@NotNull Float3to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thevisibilityrecord component.
-
Constructor Details
-
Cube
public Cube(@NotNull @NotNull String name, @NotNull @NotNull Float3 from, @NotNull @NotNull Float3 to, float inflate, @NotNull @NotNull Float3 rotation, @NotNull @NotNull Float3 origin, @Nullable @Nullable ModelFace faces, @Nullable @Nullable Integer lightEmission, boolean visibility) Creates an instance of aCuberecord class.- Parameters:
name- the value for thenamerecord componentfrom- the value for thefromrecord componentto- the value for thetorecord componentinflate- the value for theinflaterecord componentrotation- the value for therotationrecord componentorigin- the value for theoriginrecord componentfaces- the value for thefacesrecord componentlightEmission- the value for thelightEmissionrecord componentvisibility- the value for thevisibilityrecord component
-
-
Method Details
-
max
Calculates the maximum distance from the origin to any corner of the cube.- Parameters:
origin- the reference origin- Returns:
- the maximum length
- Since:
- 1.15.2
-
hasTexture
public boolean hasTexture()Checks if this cube has any textures defined.- Returns:
- true if it has textures, false otherwise
- Since:
- 1.15.2
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
inflate
public float inflate()Returns the value of theinflaterecord component.- Returns:
- the value of the
inflaterecord component
-
rotation
Returns the value of therotationrecord component.- Specified by:
rotationin interfaceBlueprintElement- Returns:
- the value of the
rotationrecord component
-
origin
Returns the value of theoriginrecord component.- Returns:
- the value of the
originrecord component
-
faces
Returns the value of thefacesrecord component.- Returns:
- the value of the
facesrecord component
-
lightEmission
Returns the value of thelightEmissionrecord component.- Returns:
- the value of the
lightEmissionrecord component
-
visibility
public boolean visibility()Returns the value of thevisibilityrecord component.- Specified by:
visibilityin interfaceBlueprintElement- Returns:
- the value of the
visibilityrecord component
-