Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RenderMesh

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

Hierarchy

  • RenderMesh

Index

Constructors

constructor

Methods

addMesh

  • addMesh(mesh: RenderMesh, x: number, y: number, z: number, sx: number, sy: number, sz: number): void
  • addMesh(mesh: RenderMesh, x: number, y: number, z: number): void
  • addMesh(mesh: RenderMesh): void
  • Adds new mesh to the current one on the specified coordinates with specified scale

    Parameters

    • mesh: RenderMesh

      RenderMesh object to be added to current mesh

    • x: number
    • y: number
    • z: number
    • sx: number
    • sy: number
    • sz: number

    Returns void

  • Adds new mesh to the current one on the specified coordinates

    Parameters

    Returns void

  • Adds new mesh to the current one

    Parameters

    Returns void

addVertex

  • addVertex(x: number, y: number, z: number, u: number, v: number): void
  • Adds a new vertex on the specified coordinates

    Parameters

    • x: number
    • y: number
    • z: number
    • u: number

      x texture offset of the vertex

    • v: number

      y texture offset of the vertex

    Returns void

clear

  • clear(): void

clone

fitIn

  • fitIn(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, keepRatio: boolean): void
  • Scales the mesh to fit into the specified box

    Parameters

    • x1: number
    • y1: number
    • z1: number
    • x2: number
    • y2: number
    • z2: number
    • keepRatio: boolean

      if true, the ratio of the dimensions are preserved

    Returns void

getPtr

  • getPtr(): number

getReadOnlyVertexData

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: string

      file type to read mesh from. The only currently supported mesh file type is "obj"

    • params: Nullable<ImportParams>

      additional import parameters or null, if not needed

    Returns void

invalidate

  • invalidate(): void

newGuiRenderMesh

rebuild

  • rebuild(): void

resetColor

  • resetColor(): void

resetTexture

  • resetTexture(): void

rotate

  • rotate(x: number, y: number, z: number, rotX: number, rotY: number, rotZ: number): void
  • rotate(rotX: number, rotY: number, rotZ: number): void
  • 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

  • Rotates the mesh around the (0, 0, 0) coordinates

    Parameters

    • 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

  • scale(x: number, y: number, z: number): void
  • Scales the whole mesh along the three axis

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setBlockTexture

  • setBlockTexture(name: string, index: number): void
  • Specifies block texture to be used by mesh

    Parameters

    • name: string
    • index: number

    Returns void

setColor

  • setColor(r: number, g: number, b: number, a?: number): void
  • 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
    • Optional a: number

    Returns void

setFoliageTinted

  • setFoliageTinted(): void
  • setFoliageTinted(int: number): void

setGrassTinted

  • setGrassTinted(): void

setLightDir

  • setLightDir(x: number, y: number, z: number): void

setLightIgnore

  • setLightIgnore(ignore: boolean, bool2: boolean): void

setLightParams

  • setLightParams(float1: number, float2: number, float3: number): void

setLightPos

  • setLightPos(x: number, y: number, z: number): void

setNoTint

  • setNoTint(): void

setNormal

  • setNormal(x: number, y: number, z: number): void
  • Specifies the normal vector for the next vertices

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setWaterTinted

  • setWaterTinted(): void

translate

  • translate(x: number, y: number, z: number): void
  • Translates the whole mesh along three axis

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

Generated using TypeDoc