Package codechicken.lib.render.model
Class OBJParser
java.lang.Object
codechicken.lib.render.model.OBJParser
Created by covers1624 on 11/4/22.
-
Constructor Summary
ConstructorsConstructorDescriptionOBJParser(net.minecraft.resources.ResourceLocation location) Create a new instance of an OBJParser for a nice builder-like structure. -
Method Summary
Modifier and TypeMethodDescriptioncoordSystem(@Nullable Transformation coordSystem) Set the coordinate system transformation to apply during parsing.Sets the parser to ignore MTL definitions and usages within the OBJ.parse()Actually perform the parsing.parse(net.minecraft.server.packs.resources.ResourceProvider provider, net.minecraft.resources.ResourceLocation loc, com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, @Nullable Transformation coordSystem, boolean ignoreMtl) Parse an OBJ model into a named map ofCCModels.provider(net.minecraft.server.packs.resources.ResourceProvider provider) Set theResourceProviderused to locate assets.quads()Overload ofvertexMode(VertexFormat.Mode)passingVertexFormat.Mode.QUADS.swapYZ()Overload ofcoordSystem(Transformation)specifying theSwapYZcoordinate system transformation.vertexMode(com.mojang.blaze3d.vertex.VertexFormat.Mode mode) Set theVertexFormat.Modeto parse the OBJ model into.
-
Constructor Details
-
OBJParser
public OBJParser(net.minecraft.resources.ResourceLocation location) Create a new instance of an OBJParser for a nice builder-like structure.- Parameters:
location- TheResourceLocationof the OBJ.
-
-
Method Details
-
provider
Set theResourceProviderused to locate assets.- Parameters:
provider- TheResourceProvider.- Returns:
- The same parser.
-
vertexMode
Set theVertexFormat.Modeto parse the OBJ model into.- Parameters:
mode- The mode.- Returns:
- The same parser.
-
quads
Overload ofvertexMode(VertexFormat.Mode)passingVertexFormat.Mode.QUADS.- Returns:
- The same parser.
-
coordSystem
Set the coordinate system transformation to apply during parsing.- Parameters:
coordSystem- The coordinate transform.- Returns:
- The same parser.
-
swapYZ
Overload ofcoordSystem(Transformation)specifying theSwapYZcoordinate system transformation.- Returns:
- The same parser.
-
ignoreMtl
Sets the parser to ignore MTL definitions and usages within the OBJ.- Returns:
- The same parser.
-
parse
Actually perform the parsing.- Returns:
- The parsed models.
-
parse
public static Map<String,CCModel> parse(net.minecraft.server.packs.resources.ResourceProvider provider, net.minecraft.resources.ResourceLocation loc, com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, @Nullable @Nullable Transformation coordSystem, boolean ignoreMtl) Parse an OBJ model into a named map ofCCModels.- Parameters:
provider- TheResourceProviderto locate assets.loc- TheResourceLocationof the OBJ model.vertexMode- TheVertexFormat.Modeto parse the model into.coordSystem- The coordinate system transformation to apply during parsing.ignoreMtl- If MTL files should be ignored.- Returns:
- The parsed models.
-