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 TypeClassDescriptionclass
private class
class
static final record
Nested classes/interfaces inherited from interface net.minecraft.client.resources.model.ResolvableModel
ResolvableModel.Resolver
Nested classes/interfaces inherited from interface net.minecraft.client.resources.model.UnbakedModel
UnbakedModel.GuiLight
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
private static final org.joml.Vector4f
private final List
<org.joml.Vector4f> private static final Vec2[]
final boolean
final boolean
final ResourceLocation
final @Nullable String
private final List
<org.joml.Vector3f> private final com.google.common.collect.Multimap
<String, ObjModel.ModelGroup> private final List
<org.joml.Vector3f> final boolean
Fields inherited from class net.neoforged.neoforge.client.model.AbstractUnbakedModel
parameters
Fields 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) bake
override with additional context.makeQuad
(int[][] indices, int tintIndex, org.joml.Vector4f colorTint, org.joml.Vector4f ambientColor, TextureAtlasSprite texture, Transformation transform) static ObjModel
parse
(ObjTokenizer tokenizer, ObjModel.ModelSettings settings) private static Vec2
parseVector2
(String[] line) private static org.joml.Vector3f
parseVector3
(String[] line) (package private) static org.joml.Vector4f
parseVector4
(String[] line) private static org.joml.Vector3f
parseVector4To3
(String[] line) Methods inherited from class net.neoforged.neoforge.client.model.AbstractUnbakedModel
fillAdditionalProperties, getAmbientOcclusion, getGuiLight, getParent, getTextureSlots, getTransforms, resolveDependencies
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.model.ExtendedUnbakedModel
bake
-
Field Details
-
COLOR_WHITE
private static final org.joml.Vector4f 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, org.joml.Vector4f colorTint, org.joml.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:IUnbakedModelExtension
bake
override with additional context. Consider inheriting fromExtendedUnbakedModel
which overrides the vanillabake
method.- Parameters:
additionalProperties
- additional properties provided by NeoForge or mods
-