Contents
Record Class ObjParser.ObjMesh
java.lang.Object
java.lang.Record
com.hypixel.hytale.builtin.buildertools.objimport.ObjParser.ObjMesh
- Record Components:
vertices- list of vertex positions [x, y, z]uvCoordinates- list of UV texture coordinates [u, v]faces- list of triangulated face vertex indicesfaceUvIndices- UV indices for each face (parallel to faces, may contain nulls)faceMaterials- material name for each face (may be null per face)mtlLib- path to the material library file (may be null)
- Enclosing class:
ObjParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefaceMaterialsrecord component.List<int[]> faces()Returns the value of thefacesrecord component.List<int[]> Returns the value of thefaceUvIndicesrecord component.float[]floatfinal inthashCode()Returns a hash code value for this object.booleanbooleanmtlLib()Returns the value of themtlLibrecord component.final StringtoString()Returns a string representation of this record class.voidTransforms vertices in-place to convert from X-up coordinate system to Y-up.voidTransforms vertices in-place to convert from Z-up coordinate system to Y-up.List<float[]> Returns the value of theuvCoordinatesrecord component.List<float[]> vertices()Returns the value of theverticesrecord component.
-
Constructor Details
-
ObjMesh
public ObjMesh(List<float[]> vertices, List<float[]> uvCoordinates, List<int[]> faces, List<int[]> faceUvIndices, List<String> faceMaterials, @Nullable String mtlLib) Creates an instance of aObjMeshrecord class.- Parameters:
vertices- the value for theverticesrecord componentuvCoordinates- the value for theuvCoordinatesrecord componentfaces- the value for thefacesrecord componentfaceUvIndices- the value for thefaceUvIndicesrecord componentfaceMaterials- the value for thefaceMaterialsrecord componentmtlLib- the value for themtlLibrecord component
-
-
Method Details
-
getBounds
public float[] getBounds()- Returns:
- the bounding box as {minX, minY, minZ, maxX, maxY, maxZ}
-
getHeight
public float getHeight()- Returns:
- the height of the mesh (Y extent)
-
hasMaterials
public boolean hasMaterials()- Returns:
- true if the mesh has material information
-
hasUvCoordinates
public boolean hasUvCoordinates()- Returns:
- true if the mesh has UV coordinates
-
transformZUpToYUp
public void transformZUpToYUp()Transforms vertices in-place to convert from Z-up coordinate system to Y-up. Use for models exported from Blender or 3ds Max. -
transformXUpToYUp
public void transformXUpToYUp()Transforms vertices in-place to convert from X-up coordinate system to Y-up. -
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
vertices
-
uvCoordinates
Returns the value of theuvCoordinatesrecord component.- Returns:
- the value of the
uvCoordinatesrecord component
-
faces
-
faceUvIndices
Returns the value of thefaceUvIndicesrecord component.- Returns:
- the value of the
faceUvIndicesrecord component
-
faceMaterials
Returns the value of thefaceMaterialsrecord component.- Returns:
- the value of the
faceMaterialsrecord component
-
mtlLib
-