java.lang.Object
committee.nova.mods.avaritia.api.client.render.CCModel
所有已实现的接口:
IVertexSource, Copyable<CCModel>

public class CCModel extends Object implements IVertexSource, Copyable<CCModel>
  • 字段详细资料

    • vertexMode

      public final com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode
    • vp

      public final int vp
    • verts

      public Vertex5[] verts
    • attributes

      public ArrayList<Object> attributes
  • 构造器详细资料

    • CCModel

      protected CCModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode)
  • 方法详细资料

    • quadModel

      public static CCModel quadModel(int numVerts)
    • triModel

      public static CCModel triModel(int numVerts)
    • newModel

      public static CCModel newModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, int numVerts)
    • newModel

      public static CCModel newModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode)
    • createModel

      public static CCModel createModel(List<Vector3> verts, List<Vector3> uvs, List<Vector3> normals, com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, List<int[]> polys)
    • copy

      public static void copy(CCModel src, int srcpos, CCModel dst, int destpos, int length)
      Copies a range of vertices and attributes form one model to another.

      This will deeply copy all vertex data and attributes. ModelMaterial attributes will only be copied to the destination model if the provided srcpos and destpos are 0.

      参数:
      src - The source model.
      srcpos - The index in the source model to copy from.
      dst - The destination model.
      destpos - The index in the destination model to copy to.
      length - The number of vertices to copy.
    • generateSidedModels

      public static void generateSidedModels(CCModel[] models, int side, Vector3 point)
      Generate models rotated to the other 5 sides of the block
      参数:
      models - An array of 6 models
      side - The side of this model
      point - The rotation point
    • generateSidedModelsH

      public static void generateSidedModelsH(CCModel[] models, int side, Vector3 point)
      Generate models rotated to the other 3 horizontal of the block
      参数:
      models - An array of 4 models
      side - The side of this model
      point - The rotation point
    • generateBackface

      public static CCModel generateBackface(CCModel src, int srcpos, CCModel dst, int destpos, int length)
      Generates copies of faces with clockwise vertices
      返回:
      The model
    • combine

      public static CCModel combine(Collection<CCModel> models)
      Combines the given models together.

      This will deeply copy all vertices and attributes. The returned model will have the ModelMaterial of the first provided Model.

      参数:
      models - The Models.
      返回:
      The combined model.
    • normals

      public Vector3[] normals()
    • material

      @Nullable public @Nullable ModelMaterial material()
    • getVertices

      public Vertex5[] getVertices()
      从接口复制的说明: IVertexSource
      The vertices for this model.
      指定者:
      getVertices 在接口中 IVertexSource
      返回:
      The Vertices.
    • getAttribute

      public <T> T getAttribute(AttributeKey<T> attr)
      从接口复制的说明: IVertexSource
      Gets an attribute from this IVertexSource.
      指定者:
      getAttribute 在接口中 IVertexSource
      参数:
      attr - The vertex attribute to get
      返回:
      The T for the given AttributeKey or null of the Attribute does not exist.
    • hasAttribute

      public boolean hasAttribute(AttributeKey<?> attr)
      从接口复制的说明: IVertexSource
      Returns true if the specified attribute is provided by this IVertexSource.

      The IVertexSource will either return data from IVertexSource.getAttribute(AttributeKey) or set the state in IVertexSource.prepareVertex(CCRenderState).

      指定者:
      hasAttribute 在接口中 IVertexSource
      返回:
      true if the attribute exists.
    • prepareVertex

      public void prepareVertex(CCRenderState ccrs)
      从接口复制的说明: IVertexSource
      Called before the pipeline processes a vertex.
      指定者:
      prepareVertex 在接口中 IVertexSource
      参数:
      ccrs - The instance.
    • getOrAllocate

      public <T> T getOrAllocate(AttributeKey<T> attr)
      Gets an attribute.

      If the model doesn't have this attribute, a new storage will be created and set.

      参数:
      attr - The attribute to get.
      返回:
      The value.
    • setAttribute

      public <T> void setAttribute(AttributeKey<T> attr, @Nullable T value)
      Set an attribute.
      参数:
      attr - The attribute to set.
      value - The value to set.
    • generateBox

      public CCModel generateBox(int i, double x1, double y1, double z1, double w, double h, double d, double tx, double ty, double tw, double th, double f)
      Each pixel corresponds to one unit of position when generating the model
      参数:
      i - Vertex index to start generating at
      x1 - The minX bound of the box
      y1 - The minY bound of the box
      z1 - The minZ bound of the box
      w - The width of the box
      h - The height of the box
      d - The depth of the box
      tx - The distance of the top left corner of the texture map from the left in pixels
      ty - The distance of the top left corner of the texture map from the top in pixels
      tw - The width of the texture in pixels
      th - The height of the texture in pixels
      f - The scale of the model, pixels per block, normally 16
      返回:
      The generated model
    • generateBlock

      public CCModel generateBlock(int i, Cuboid6 bounds)
      Generates a box, uv mapped to be the same as a minecraft block with the same bounds
      参数:
      i - The vertex index to start generating at
      bounds - The bounds of the block, 0 to 1
      返回:
      The generated model. When rendering an icon will need to be supplied for the UV transformation.
    • generateBlock

      public CCModel generateBlock(int i, Cuboid6 bounds, int mask)
    • generateBlock

      public CCModel generateBlock(int i, double x1, double y1, double z1, double x2, double y2, double z2)
    • generateBlock

      public CCModel generateBlock(int i, double x1, double y1, double z1, double x2, double y2, double z2, int mask)
      Generates a box, uv mapped to be the same as a minecraft block with the same bounds
      参数:
      i - The vertex index to start generating at
      x1 - minX
      y1 - minY
      z1 - minZ
      x2 - maxX
      y2 - maxY
      z2 - maxZ
      mask - A bitmask of sides NOT to generate. I high bit at index s means side s will not be generated
      返回:
      The generated model. When rendering an icon will need to be supplied for the UV transformation.
    • computeNormals

      public CCModel computeNormals()
    • computeNormals

      public CCModel computeNormals(int start, int length)
      Computes the normals of all faces in the model. Uses the cross product of the vectors along 2 sides of the face
      参数:
      start - The first vertex to generate normals for
      length - The number of vertices to generate normals for. Note this must be a multiple of 3 for triangles or 4 for quads
      返回:
      The model
    • computeLighting

      public CCModel computeLighting(LightModel light)
      Computes lighting using the normals add a light model If the model is rotated, the lighting will no longer be valid
      返回:
      The model
    • setColour

      public CCModel setColour(int c)
    • setTex

      public CCModel setTex(int tex)
    • computeLightCoords

      public CCModel computeLightCoords()
      Computes the minecraft lighting coordinates for use with a LightMatrix
      返回:
      The model
    • smoothNormals

      public CCModel smoothNormals()
      Averages all normals at the same position to produce a smooth lighting effect.
      返回:
      The model
    • apply

      public CCModel apply(Transformation t)
    • apply

      public CCModel apply(UVTransformation uvt)
    • expand

      public CCModel expand(int extraVerts)
    • render

      public void render(CCRenderState state, double x, double y, double z, double u, double v)
    • render

      public void render(CCRenderState state, double x, double y, double z, UVTransformation u)
    • render

      public void render(CCRenderState state, Transformation t, double u, double v)
    • render

      public void render(CCRenderState state, IVertexOperation... ops)
    • render

      public void render(CCRenderState state, int start, int end, IVertexOperation... ops)
      Renders vertices start through start+length-1 of the model
      参数:
      start - The first vertex index to render
      end - The vertex index to render until
      ops - Operations to apply
    • shrinkUVs

      public CCModel shrinkUVs(double d)
      Brings the UV coordinates of each face closer to the center UV by d. Useful for fixing texture seams
    • sidedCopy

      public CCModel sidedCopy(int side1, int side2, Vector3 point)
      参数:
      side1 - The side of this model
      side2 - The side of the new model
      point - The point to rotate around
      返回:
      A copy of this model rotated to the appropriate side
    • backfacedCopy

      public CCModel backfacedCopy()
    • generateSidedParts

      public CCModel generateSidedParts(int side, Vector3 point)
      Generates sided copies of vertices into this model. Assumes that your model has been generated at vertex side*(numVerts/6)
    • generateSidedPartsH

      public CCModel generateSidedPartsH(int side, Vector3 point)
      Generates sided copies of vertices into this model. Assumes that your model has been generated at vertex side*(numVerts/4)
    • generateSidedPart

      public CCModel generateSidedPart(int side1, int side2, Vector3 point, int srcpos, int destpos, int length)
      Generates a sided copy of verts into this model
    • apply

      public CCModel apply(Transformation t, int srcpos, int destpos, int length)
      Generates a rotated copy of verts into this model
    • twoFacedCopy

      public CCModel twoFacedCopy()
    • copy

      public CCModel copy()
      指定者:
      copy 在接口中 Copyable<CCModel>
    • collapse

      public Vector3 collapse()
      返回:
      The average of all vertices, for bones.
    • zOffset

      public CCModel zOffset(Cuboid6 offsets)
    • bounds

      public Cuboid6 bounds()
      返回:
      A Cuboid6 containing all the verts in this model