Class ObjModel
java.lang.Object
net.neoforged.neoforge.client.model.AbstractUnbakedModel
net.neoforged.neoforge.client.model.obj.ObjModel
- All Implemented Interfaces:
ResolvableModel,UnbakedModel,IUnbakedModelExtension,ExtendedUnbakedModel
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
Nested ClassesModifier and TypeClassDescriptionclassprivate classclassstatic final recordNested classes/interfaces inherited from interface net.minecraft.client.resources.model.ResolvableModel
ResolvableModel.ResolverNested classes/interfaces inherited from interface net.minecraft.client.resources.model.UnbakedModel
UnbakedModel.GuiLight -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanprivate static final Vector4fprivate static final Vec2[]final booleanfinal booleanfinal ResourceLocationfinal @Nullable Stringprivate final Multimap<String, ObjModel.ModelGroup> final booleanFields inherited from class net.neoforged.neoforge.client.model.AbstractUnbakedModel
parametersFields inherited from interface net.minecraft.client.resources.model.UnbakedModel
DEFAULT_AMBIENT_OCCLUSION, DEFAULT_GUI_LIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbake(TextureSlots slots, ModelBaker baker, ModelState state, boolean useAmbientOcclusion, boolean usesBlockLight, ItemTransforms transforms, ContextMap additionalProperties) bakeoverride with additional context.makeQuad(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, Transformation transform) static ObjModelparse(ObjTokenizer tokenizer, ObjModel.ModelSettings settings) private static Vec2parseVector2(String[] line) private static Vector3fparseVector3(String[] line) (package private) static Vector4fparseVector4(String[] line) private static Vector3fparseVector4To3(String[] line) Methods inherited from class net.neoforged.neoforge.client.model.AbstractUnbakedModel
fillAdditionalProperties, getAmbientOcclusion, getGuiLight, getParent, getTextureSlots, getTransforms, resolveDependenciesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.model.ExtendedUnbakedModel
bake
-
Field Details
-
COLOR_WHITE
-
DEFAULT_COORDS
-
parts
-
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
-
-
Constructor Details
-
ObjModel
-
-
Method Details
-
parse
public static ObjModel parse(ObjTokenizer tokenizer, ObjModel.ModelSettings settings) throws IOException - Throws:
IOException
-
parseVector4To3
-
parseVector2
-
parseVector3
-
parseVector4
-
makeQuad
private org.apache.commons.lang3.tuple.Pair<BakedQuad,Direction> makeQuad(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, Transformation transform) -
bake
public BakedModel bake(TextureSlots slots, ModelBaker baker, ModelState state, boolean useAmbientOcclusion, boolean usesBlockLight, ItemTransforms transforms, ContextMap additionalProperties) Description copied from interface:IUnbakedModelExtensionbakeoverride with additional context. Consider inheriting fromExtendedUnbakedModelwhich overrides the vanillabakemethod.- Parameters:
additionalProperties- additional properties provided by NeoForge or mods
-