Class IndexedModel

java.lang.Object
team.lodestar.lodestone.systems.model.obj.IndexedModel
All Implemented Interfaces:
IRenderableModel
Direct Known Subclasses:
ObjModel

public abstract class IndexedModel extends Object implements IRenderableModel
  • Field Details

    • vertices

      protected List<Vertex> vertices
    • meshes

      protected List<IndexedMesh> meshes
    • bakedIndices

      protected List<Integer> bakedIndices
    • earlyModifiers

      public List<ModelModifier> earlyModifiers
    • modifiers

      protected List<ModelModifier> modifiers
    • modelId

      protected net.minecraft.resources.ResourceLocation modelId
    • modelBuffer

      protected com.mojang.blaze3d.vertex.VertexBuffer modelBuffer
    • meshData

      protected com.mojang.blaze3d.vertex.MeshData meshData
  • Constructor Details

    • IndexedModel

      public IndexedModel(net.minecraft.resources.ResourceLocation modelId)
  • Method Details

    • applyModifiers

      public void applyModifiers()
    • getVertices

      public List<Vertex> getVertices()
    • getMeshes

      public List<IndexedMesh> getMeshes()
    • setMeshes

      public void setMeshes(List<IndexedMesh> meshes)
    • getBakedIndices

      public List<Integer> getBakedIndices()
    • bakeIndices

      public void bakeIndices(com.mojang.blaze3d.vertex.VertexFormat.Mode mode, boolean triangulate)
    • getModelLocation

      public net.minecraft.resources.ResourceLocation getModelLocation()
      Description copied from interface: IRenderableModel
      Gets the model's ResourceLocation
      Specified by:
      getModelLocation in interface IRenderableModel
      Returns:
      The model's ResourceLocation
    • render

      public void render(com.mojang.blaze3d.vertex.PoseStack poseStack, com.mojang.blaze3d.vertex.VertexConsumer vertexConsumer, net.minecraft.client.renderer.RenderType renderType)
      Description copied from interface: IRenderableModel
      Renders the model using the provided PoseStack and VertexConsumer
      Specified by:
      render in interface IRenderableModel
    • createMesh

      public com.mojang.blaze3d.vertex.MeshData createMesh(com.mojang.blaze3d.vertex.PoseStack poseStack, com.mojang.blaze3d.vertex.VertexFormat vertexFormat, com.mojang.blaze3d.vertex.VertexFormat.Mode mode)
      Description copied from interface: IRenderableModel
      Creates a MeshData object for the model typically used in instanced rendering.
      Specified by:
      createMesh in interface IRenderableModel
      Parameters:
      poseStack - The PoseStack to use
      vertexFormat - The VertexFormat to use
      mode - The VertexFormat.Mode to use
      Returns:
      The created MeshData
    • getModelBuffer

      public com.mojang.blaze3d.vertex.VertexBuffer getModelBuffer()
      Description copied from interface: IRenderableModel
      Gets the model's VertexBuffer
      Specified by:
      getModelBuffer in interface IRenderableModel
      Returns:
      The model's VertexBuffer
    • setModelBuffer

      public void setModelBuffer(com.mojang.blaze3d.vertex.VertexBuffer modelBuffer)
      Description copied from interface: IRenderableModel
      Sets the model's VertexBuffer
      Specified by:
      setModelBuffer in interface IRenderableModel
      Parameters:
      modelBuffer - The VertexBuffer to set
    • cleanup

      public void cleanup()
      Description copied from interface: IRenderableModel
      Cleans up the model's VertexBuffer
      Specified by:
      cleanup in interface IRenderableModel