Class ObjModel
java.lang.Object
net.minecraftforge.client.model.geometry.SimpleUnbakedGeometry<ObjModel>
net.minecraftforge.client.model.obj.ObjModel
- All Implemented Interfaces:
IUnbakedGeometry<ObjModel>
A model loaded from an OBJ file.
Supports positions, texture coordinates, normals and colors. The material library
has support for numerous features, including support for ResourceLocation
textures (non-standard).
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
private class
class
static final record
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
private static final Vector4f
private static final Vec2[]
final boolean
final boolean
private static final org.apache.logging.log4j.Logger
final ResourceLocation
final @Nullable String
private final Map<String,
ObjModel.ModelGroup> final boolean
-
Constructor Summary
ModifierConstructorDescriptionprivate
ObjModel
(ObjModel.ModelSettings settings, Map<String, String> deprecationWarnings) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addQuads
(IGeometryBakingContext owner, IModelBuilder<?> modelBuilder, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelTransform, ResourceLocation modelLocation) bakeRenderable
(IGeometryBakingContext configuration) Returns a set of all the components whose visibility may be configured viaIGeometryBakingContext
.getMaterials
(IGeometryBakingContext context, Function<ResourceLocation, UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors) makeQuad
(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, Transformation transform) static ObjModel
parse
(ObjTokenizer tokenizer, ObjModel.ModelSettings settings) (package private) static ObjModel
parse
(ObjTokenizer tokenizer, ObjModel.ModelSettings settings, Map<String, String> deprecationWarnings) private static Vec2
parseVector2
(String[] line) private static Vector3f
parseVector3
(String[] line) (package private) static Vector4f
parseVector4
(String[] line) private static Vector3f
parseVector4To3
(String[] line) Methods inherited from class net.minecraftforge.client.model.geometry.SimpleUnbakedGeometry
bake
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
COLOR_WHITE
-
DEFAULT_COORDS
-
parts
-
rootComponentNames
-
allComponentNames
-
positions
-
texCoords
-
normals
-
colors
-
automaticCulling
public final boolean automaticCulling -
shadeQuads
public final boolean shadeQuads -
flipV
public final boolean flipV -
emissiveAmbient
public final boolean emissiveAmbient -
mtlOverride
-
modelLocation
-
deprecationWarnings
-
-
Constructor Details
-
ObjModel
-
-
Method Details
-
parse
public static ObjModel parse(ObjTokenizer tokenizer, ObjModel.ModelSettings settings) throws IOException - Throws:
IOException
-
parse
static ObjModel parse(ObjTokenizer tokenizer, ObjModel.ModelSettings settings, Map<String, String> deprecationWarnings) throws IOException- Throws:
IOException
-
parseVector4To3
-
parseVector2
-
parseVector3
-
parseVector4
-
addQuads
protected void addQuads(IGeometryBakingContext owner, IModelBuilder<?> modelBuilder, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelTransform, ResourceLocation modelLocation) - Specified by:
addQuads
in classSimpleUnbakedGeometry<ObjModel>
-
getMaterials
public Collection<Material> getMaterials(IGeometryBakingContext context, Function<ResourceLocation, UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors) - Specified by:
getMaterials
in interfaceIUnbakedGeometry<ObjModel>
- Specified by:
getMaterials
in classSimpleUnbakedGeometry<ObjModel>
-
getRootComponentNames
-
getConfigurableComponentNames
Description copied from interface:IUnbakedGeometry
Returns a set of all the components whose visibility may be configured viaIGeometryBakingContext
.- Returns:
- a set of all the components whose visibility may be configured via
IGeometryBakingContext
-
makeQuad
private org.apache.commons.lang3.tuple.Pair<BakedQuad,Direction> makeQuad(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, Transformation transform) -
bakeRenderable
-