RenderMesh
Index
Constructors
Methods
Constructors
constructor
Creates a new RenderMesh and initializes it from file. See RenderMesh.importFromFile method description for parameters details.
Parameters
path: string
type: string
params: ImportParams
Returns RenderMesh
Methods
addMesh
Adds new mesh to the current one on the specified coordinates.
Parameters
mesh: RenderMesh
RenderMesh object to be added to current mesh
Returns void
addVertex
Adds a new vertex on the specified coordinates.
Parameters
x: number
y: number
z: number
Returns void
clear
Removes all vertices of the mesh.
Returns void
clone
Creates a copy of current RenderMesh.
Returns RenderMesh
fitIn
Scales the mesh to fit into the specified box.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
Returns void
getPtr
Returns number
Pointer to the native object instance of the following RenderMesh, represented as long number.
getReadOnlyVertexData
Returns ReadOnlyVertexData
importFromFile
Imports mesh file using specified path.
Parameters
path: string
path to the mesh file. Path should be absolute path or be relative to the resources folder or to the "models/" folder
type: obj
file type to read mesh from. The only currently supported mesh file type is "obj"
importParams: ImportParams
additional import parameters or null, if not needed
Returns void
invalidate
Returns void
newGuiRenderMesh
Returns GuiRenderMesh
rebuild
Forces Minecraft to rebuild specified RenderMesh object.
Returns void
resetColor
Resets color applied to the mesh.
Returns void
resetTexture
Resets texture of the mesh.
Returns void
rotate
Rotates the mesh around the specified coordinates.
Parameters
x: number
y: number
z: number
rotX: number
rotation angle along X axis, in radians
rotY: number
rotation angle along Y axis, in radians
rotZ: number
rotation angle along Z axis, in radians
Returns void
scale
Scales the whole mesh along the three axis.
Parameters
x: number
y: number
z: number
Returns void
setBlockTexture
Specifies block texture to be used by mesh.
Parameters
textureName: string
textureMeta: number
Returns void
setColor
Specifies color to be applied to the next vertices. If the color is not white and the texture is applied to mesh, texture's colors will be affected.
Parameters
r: number
g: number
b: number
Returns void
setFoliageTinted
Makes specified RenderMesh foliage tinted.
Returns void
setGrassTinted
Makes specified RenderMesh grass tinted.
Returns void
setLightDir
Sets following RenderMesh light direction.
Parameters
x: number
y: number
z: number
Returns void
setLightIgnore
Parameters
ignore: boolean
bool2: boolean
Returns void
setLightParams
Parameters
float1: number
float2: number
float3: number
Returns void
setLightPos
Sets following RenderMesh light position.
Parameters
x: number
y: number
z: number
Returns void
setNoTint
Removes any tint from specified RenderMesh.
Returns void
setNormal
Specifies the normal vector for the next vertices.
Parameters
x: number
y: number
z: number
Returns void
setWaterTinted
Makes specified RenderMesh water tinted.
Returns void
translate
Translates the whole mesh along three axis.
Parameters
x: number
y: number
z: number
Returns void
Class representing a set of vertices with some other parameters required to display them correctly. Used as block, entity and item models, in animations and actually anywhere you need some physical shape.