Class ObjGeometry

java.lang.Object
net.neoforged.neoforge.client.model.obj.ObjGeometry
All Implemented Interfaces:
net.minecraft.client.resources.model.UnbakedGeometry, UnbakedGeometryExtension, ExtendedUnbakedGeometry

public class ObjGeometry extends Object implements ExtendedUnbakedGeometry
  • Field Details

    • COLOR_WHITE

      private static final org.joml.Vector4f COLOR_WHITE
    • DEFAULT_COORDS

      private static final net.minecraft.world.phys.Vec2[] DEFAULT_COORDS
    • parts

      private final com.google.common.collect.Multimap<String,ObjGeometry.ModelGroup> parts
    • positions

      private final List<org.joml.Vector3f> positions
    • texCoords

      private final List<net.minecraft.world.phys.Vec2> texCoords
    • normals

      private final List<org.joml.Vector3f> normals
    • colors

      private final List<org.joml.Vector4f> colors
    • automaticCulling

      public final boolean automaticCulling
    • shadeQuads

      public final boolean shadeQuads
    • flipV

      public final boolean flipV
    • emissiveAmbient

      public final boolean emissiveAmbient
    • mtlOverride

      @Nullable public final @Nullable String mtlOverride
    • modelLocation

      public final net.minecraft.resources.ResourceLocation modelLocation
  • Constructor Details

  • Method Details

    • parse

      public static ObjGeometry parse(ObjTokenizer tokenizer, ObjGeometry.Settings settings) throws IOException
      Throws:
      IOException
    • parseVector4To3

      private static org.joml.Vector3f parseVector4To3(String[] line)
    • parseVector2

      private static net.minecraft.world.phys.Vec2 parseVector2(String[] line)
    • parseVector3

      private static org.joml.Vector3f parseVector3(String[] line)
    • parseVector4

      static org.joml.Vector4f parseVector4(String[] line)
    • bake

      public net.minecraft.client.resources.model.QuadCollection bake(net.minecraft.client.renderer.block.model.TextureSlots textureSlots, net.minecraft.client.resources.model.ModelBaker baker, net.minecraft.client.resources.model.ModelState state, net.minecraft.client.resources.model.ModelDebugName debugName, net.minecraft.util.context.ContextMap additionalProperties)
      Description copied from interface: UnbakedGeometryExtension
      Version of UnbakedGeometry.bake(TextureSlots, ModelBaker, ModelState, ModelDebugName) that also receives additional properties sourced from UnbakedModelExtension.fillAdditionalProperties(net.minecraft.util.context.ContextMap.Builder).
      Specified by:
      bake in interface ExtendedUnbakedGeometry
      Specified by:
      bake in interface UnbakedGeometryExtension
    • makeQuad

      private org.apache.commons.lang3.tuple.Pair<net.minecraft.client.renderer.block.model.BakedQuad,net.minecraft.core.Direction> makeQuad(int[][] indices, int tintIndex, org.joml.Vector4f colorTint, org.joml.Vector4f ambientColor, net.minecraft.client.renderer.texture.TextureAtlasSprite texture, com.mojang.math.Transformation transform)