Class OBJModel
- java.lang.Object
-
- net.minecraftforge.client.model.obj.OBJModel
-
- All Implemented Interfaces:
IModelGeometry<OBJModel>
,IMultipartModelGeometry<OBJModel>
,ISimpleModelGeometry<OBJModel>
public class OBJModel extends java.lang.Object implements IMultipartModelGeometry<OBJModel>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
OBJModel.ModelGroup
private class
OBJModel.ModelMesh
class
OBJModel.ModelObject
static class
OBJModel.ModelSettings
-
Field Summary
Fields Modifier and Type Field Description boolean
ambientToFullbright
private static Vector4f
COLOR_WHITE
private java.util.List<Vector4f>
colors
private static Vector2f[]
DEFAULT_COORDS
boolean
detectCullableFaces
boolean
diffuseLighting
boolean
flipV
java.lang.String
materialLibraryOverrideLocation
ResourceLocation
modelLocation
private java.util.List<Vector3f>
normals
private java.util.Map<java.lang.String,OBJModel.ModelGroup>
parts
private java.util.List<Vector3f>
positions
private java.util.List<Vector2f>
texCoords
-
Constructor Summary
Constructors Constructor Description OBJModel(LineReader reader, OBJModel.ModelSettings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<? extends IModelGeometryPart>
getPart(java.lang.String name)
java.util.Collection<? extends IModelGeometryPart>
getParts()
private org.apache.commons.lang3.tuple.Pair<BakedQuad,Direction>
makeQuad(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, TransformationMatrix transform)
static Vector2f
parseVector2(java.lang.String[] line)
static Vector3f
parseVector3(java.lang.String[] line)
static Vector4f
parseVector4(java.lang.String[] line)
static Vector3f
parseVector4To3(java.lang.String[] line)
private void
putVertexData(IVertexConsumer consumer, Vector4f position0, Vector2f texCoord0, Vector3f normal0, Vector4f color0, Vector2f uv2, TextureAtlasSprite texture)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.client.model.geometry.IMultipartModelGeometry
addQuads, getTextures
-
Methods inherited from interface net.minecraftforge.client.model.geometry.ISimpleModelGeometry
bake
-
-
-
-
Field Detail
-
COLOR_WHITE
private static Vector4f COLOR_WHITE
-
DEFAULT_COORDS
private static Vector2f[] DEFAULT_COORDS
-
parts
private final java.util.Map<java.lang.String,OBJModel.ModelGroup> parts
-
positions
private final java.util.List<Vector3f> positions
-
texCoords
private final java.util.List<Vector2f> texCoords
-
normals
private final java.util.List<Vector3f> normals
-
colors
private final java.util.List<Vector4f> colors
-
detectCullableFaces
public final boolean detectCullableFaces
-
diffuseLighting
public final boolean diffuseLighting
-
flipV
public final boolean flipV
-
ambientToFullbright
public final boolean ambientToFullbright
-
modelLocation
public final ResourceLocation modelLocation
-
materialLibraryOverrideLocation
@Nullable public final java.lang.String materialLibraryOverrideLocation
-
-
Constructor Detail
-
OBJModel
OBJModel(LineReader reader, OBJModel.ModelSettings settings) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
parseVector4To3
public static Vector3f parseVector4To3(java.lang.String[] line)
-
parseVector2
public static Vector2f parseVector2(java.lang.String[] line)
-
parseVector3
public static Vector3f parseVector3(java.lang.String[] line)
-
parseVector4
public static Vector4f parseVector4(java.lang.String[] line)
-
getParts
public java.util.Collection<? extends IModelGeometryPart> getParts()
- Specified by:
getParts
in interfaceIModelGeometry<OBJModel>
- Specified by:
getParts
in interfaceIMultipartModelGeometry<OBJModel>
-
getPart
public java.util.Optional<? extends IModelGeometryPart> getPart(java.lang.String name)
- Specified by:
getPart
in interfaceIModelGeometry<OBJModel>
- Specified by:
getPart
in interfaceIMultipartModelGeometry<OBJModel>
-
makeQuad
private org.apache.commons.lang3.tuple.Pair<BakedQuad,Direction> makeQuad(int[][] indices, int tintIndex, Vector4f colorTint, Vector4f ambientColor, TextureAtlasSprite texture, TransformationMatrix transform)
-
putVertexData
private void putVertexData(IVertexConsumer consumer, Vector4f position0, Vector2f texCoord0, Vector3f normal0, Vector4f color0, Vector2f uv2, TextureAtlasSprite texture)
-
-