类 CCModel
java.lang.Object
committee.nova.mods.avaritia.api.client.render.CCModel
- 所有已实现的接口:
IVertexSource,Copyable<CCModel>
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明apply(Transformation t, int srcpos, int destpos, int length) Generates a rotated copy of verts into this modelapply(UVTransformation uvt) bounds()collapse()static CCModelcombine(Collection<CCModel> models) Combines the given models together.Computes the minecraft lighting coordinates for use with a LightMatrixcomputeLighting(LightModel light) Computes lighting using the normals add a light model If the model is rotated, the lighting will no longer be validcomputeNormals(int start, int length) Computes the normals of all faces in the model.copy()static voidCopies a range of vertices and attributes form one model to another.static CCModelcreateModel(List<Vector3> verts, List<Vector3> uvs, List<Vector3> normals, com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, List<int[]> polys) expand(int extraVerts) static CCModelgenerateBackface(CCModel src, int srcpos, CCModel dst, int destpos, int length) Generates copies of faces with clockwise verticesgenerateBlock(int i, double x1, double y1, double z1, double x2, double y2, double z2) 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 boundsgenerateBlock(int i, Cuboid6 bounds) Generates a box, uv mapped to be the same as a minecraft block with the same boundsgenerateBlock(int i, Cuboid6 bounds, int mask) 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 modelstatic voidgenerateSidedModels(CCModel[] models, int side, Vector3 point) Generate models rotated to the other 5 sides of the blockstatic voidgenerateSidedModelsH(CCModel[] models, int side, Vector3 point) Generate models rotated to the other 3 horizontal of the blockgenerateSidedPart(int side1, int side2, Vector3 point, int srcpos, int destpos, int length) Generates a sided copy of verts into this modelgenerateSidedParts(int side, Vector3 point) Generates sided copies of vertices into this model.generateSidedPartsH(int side, Vector3 point) Generates sided copies of vertices into this model.<T> TgetAttribute(AttributeKey<T> attr) Gets an attribute from thisIVertexSource.<T> TgetOrAllocate(AttributeKey<T> attr) Gets an attribute.Vertex5[]The vertices for this model.booleanhasAttribute(AttributeKey<?> attr) Returnstrueif the specified attribute is provided by thisIVertexSource.@Nullable ModelMaterialmaterial()static CCModelnewModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode) static CCModelnewModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, int numVerts) Vector3[]normals()voidprepareVertex(CCRenderState ccrs) Called before the pipeline processes a vertex.static CCModelquadModel(int numVerts) voidrender(CCRenderState state, double x, double y, double z, double u, double v) voidrender(CCRenderState state, double x, double y, double z, UVTransformation u) voidrender(CCRenderState state, int start, int end, IVertexOperation... ops) Renders vertices start through start+length-1 of the modelvoidrender(CCRenderState state, IVertexOperation... ops) voidrender(CCRenderState state, Transformation t, double u, double v) <T> voidsetAttribute(AttributeKey<T> attr, T value) Set an attribute.setColour(int c) setTex(int tex) shrinkUVs(double d) Brings the UV coordinates of each face closer to the center UV by d.Averages all normals at the same position to produce a smooth lighting effect.static CCModeltriModel(int numVerts) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 committee.nova.mods.avaritia.api.client.render.pipeline.IVertexSource
getVertexCount
-
字段详细资料
-
vertexMode
public final com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode -
vp
public final int vp -
verts
-
attributes
-
-
构造器详细资料
-
CCModel
protected CCModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode)
-
-
方法详细资料
-
quadModel
-
triModel
-
newModel
public static CCModel newModel(com.mojang.blaze3d.vertex.VertexFormat.Mode vertexMode, int numVerts) -
newModel
-
createModel
-
copy
Copies a range of vertices and attributes form one model to another.This will deeply copy all vertex data and attributes.
ModelMaterialattributes will only be copied to the destination model if the providedsrcposanddestposare0.- 参数:
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
Generate models rotated to the other 5 sides of the block- 参数:
models- An array of 6 modelsside- The side of this modelpoint- The rotation point
-
generateSidedModelsH
Generate models rotated to the other 3 horizontal of the block- 参数:
models- An array of 4 modelsside- The side of this modelpoint- 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
Combines the given models together.This will deeply copy all vertices and attributes. The returned model will have the
ModelMaterialof the first provided Model.- 参数:
models- The Models.- 返回:
- The combined model.
-
normals
-
material
-
getVertices
从接口复制的说明:IVertexSourceThe vertices for this model.- 指定者:
getVertices在接口中IVertexSource- 返回:
- The Vertices.
-
getAttribute
从接口复制的说明:IVertexSourceGets an attribute from thisIVertexSource.- 指定者:
getAttribute在接口中IVertexSource- 参数:
attr- The vertex attribute to get- 返回:
- The
Tfor the givenAttributeKeyornullof the Attribute does not exist.
-
hasAttribute
从接口复制的说明:IVertexSourceReturnstrueif the specified attribute is provided by thisIVertexSource.The
IVertexSourcewill either return data fromIVertexSource.getAttribute(AttributeKey)or set the state inIVertexSource.prepareVertex(CCRenderState).- 指定者:
hasAttribute在接口中IVertexSource- 返回:
trueif the attribute exists.
-
prepareVertex
从接口复制的说明:IVertexSourceCalled before the pipeline processes a vertex.- 指定者:
prepareVertex在接口中IVertexSource- 参数:
ccrs- The instance.
-
getOrAllocate
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
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 atx1- The minX bound of the boxy1- The minY bound of the boxz1- The minZ bound of the boxw- The width of the boxh- The height of the boxd- The depth of the boxtx- The distance of the top left corner of the texture map from the left in pixelsty- The distance of the top left corner of the texture map from the top in pixelstw- The width of the texture in pixelsth- The height of the texture in pixelsf- The scale of the model, pixels per block, normally 16- 返回:
- The generated model
-
generateBlock
Generates a box, uv mapped to be the same as a minecraft block with the same bounds- 参数:
i- The vertex index to start generating atbounds- 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
-
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 atx1- minXy1- minYz1- minZx2- maxXy2- maxYz2- maxZmask- 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
-
computeNormals
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 forlength- 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
Computes lighting using the normals add a light model If the model is rotated, the lighting will no longer be valid- 返回:
- The model
-
setColour
-
setTex
-
computeLightCoords
Computes the minecraft lighting coordinates for use with a LightMatrix- 返回:
- The model
-
smoothNormals
Averages all normals at the same position to produce a smooth lighting effect.- 返回:
- The model
-
apply
-
apply
-
expand
-
render
-
render
-
render
-
render
-
render
Renders vertices start through start+length-1 of the model- 参数:
start- The first vertex index to renderend- The vertex index to render untilops- Operations to apply
-
shrinkUVs
Brings the UV coordinates of each face closer to the center UV by d. Useful for fixing texture seams -
sidedCopy
- 参数:
side1- The side of this modelside2- The side of the new modelpoint- The point to rotate around- 返回:
- A copy of this model rotated to the appropriate side
-
backfacedCopy
-
generateSidedParts
Generates sided copies of vertices into this model. Assumes that your model has been generated at vertex side*(numVerts/6) -
generateSidedPartsH
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
Generates a rotated copy of verts into this model -
twoFacedCopy
-
copy
-
collapse
- 返回:
- The average of all vertices, for bones.
-
zOffset
-
bounds
- 返回:
- A Cuboid6 containing all the verts in this model
-