Class CubeMeshUtil
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class CubeMeshUtil
- Inheritance
-
CubeMeshUtil
- Derived
- Inherited Members
- Extension Methods
Fields
BaseCubeVertexIndices
Can be used for any face if offseted correctly
public static int[] BaseCubeVertexIndices
Field Value
- int[]
CloudSideShadings
Top, Front/Left, Back/Right, Bottom
public static float[] CloudSideShadings
Field Value
- float[]
CubeFaceIndices
Cube face indices, in order: North, East, South, West, Up, Down.
public static byte[] CubeFaceIndices
Field Value
- byte[]
CubeUvCoords
UV Coords for every Vertex in a cube
public static int[] CubeUvCoords
Field Value
- int[]
CubeVertexIndices
Indices for every triangle in a cube
public static int[] CubeVertexIndices
Field Value
- int[]
CubeVertices
XYZ Vertex positions for every vertex in a cube. Origin is the cube middle point.
public static int[] CubeVertices
Field Value
- int[]
DefaultBlockSideShadings
Top, Front/Left, Back/Right, Bottom
public static float[] DefaultBlockSideShadings
Field Value
- float[]
DefaultBlockSideShadingsByFacing
Shadings by Blockfacing index
public static float[] DefaultBlockSideShadingsByFacing
Field Value
- float[]
Methods
GetCube()
Returns a default 2x2x2 cube with xyz,uv,rgba and indices set - ready for upload to the graphics card
public static MeshData GetCube()
Returns
GetCube(float, float, float, Vec3f)
Same as GetCubeModelData but can define scale and translation. Scale is applied first.
public static MeshData GetCube(float scaleX, float scaleY, float scaleZ, Vec3f translate)
Parameters
Returns
GetCube(float, float, Vec3f)
Same as GetCubeModelData but can define scale and translation. Scale is applied first.
public static MeshData GetCube(float scaleH, float scaleV, Vec3f translate)
Parameters
Returns
GetCubeFace(BlockFacing)
Gets the face of a given cube.
public static MeshData GetCubeFace(BlockFacing face)
Parameters
face
BlockFacingThe face you want to fetch in cardinal directions.
Returns
- MeshData
The mesh data for the cube's given face.
GetCubeFace(BlockFacing, float, float, Vec3f)
Gets the face of a given cube.
public static MeshData GetCubeFace(BlockFacing face, float scaleH, float scaleV, Vec3f translate)
Parameters
face
BlockFacingThe face you want to fetch in cardinal directions.
scaleH
floatThe horizontal scale.
scaleV
floatThe vertical scale.
translate
Vec3fThe translation desired.
Returns
- MeshData
The mesh data for the given parameters.
GetCubeOnlyScaleXyz(float, float, Vec3f)
Same as GetCubeModelData but can define scale and translation. Scale is applied first.
public static MeshData GetCubeOnlyScaleXyz(float scaleH, float scaleV, Vec3f translate)
Parameters
Returns
GetShadedCubeRGBA(int, float[], bool)
Returns a rgba byte array to be used for default shading on a standard cube, can supply the shading levels
public static byte[] GetShadedCubeRGBA(int baseColor, float[] blockSideShadings, bool smoothShadedSides)
Parameters
Returns
- byte[]
GetShadedCubeRGBA(int[], bool)
Returns a rgba byte array to be used for default shading on a standard cube
public static byte[] GetShadedCubeRGBA(int[] colorSides, bool smoothShadedSides)
Parameters
Returns
- byte[]
ScaleCubeMesh(MeshData, float, float, float, Vec3f)
Scales a mesh retrieced by GetCube()
public static MeshData ScaleCubeMesh(MeshData modelData, float scaleX, float scaleY, float scaleZ, Vec3f translate)
Parameters
Returns
SetXyzFacesAndPacketNormals(MeshData)
public static void SetXyzFacesAndPacketNormals(MeshData mesh)
Parameters
mesh
MeshData