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.

Constructors

Methods

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

    Parameters

    Returns void

    2.0.2b23

  • Adds new mesh to the current one on the specified coordinates with specified offset.

    Parameters

    Returns void

    2.0.2b23

  • Adds new mesh to the current one on the specified coordinates with specified offset and scale.

    Parameters

    • mesh: RenderMesh

      RenderMesh object to be added to current mesh

    • addX: number
    • addY: number
    • addZ: number
    • scaleX: number
    • scaleY: number
    • scaleZ: number

    Returns void

    2.0.2b23

  • Adds a new vertex on the specified coordinates.

    Parameters

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

    Returns 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

  • Scales the mesh to fit into the specified box.

    Parameters

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

    Returns void

    2.0.2b26

  • 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

    2.0.2b26

  • Returns number

    Pointer to the native object instance of the following RenderMesh, represented as long number.

  • 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

  • Resets color applied to the mesh.

    Returns void

    0xfff // white
    
  • 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

    2.0.2b26

  • 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

  • Scales the whole mesh along the three axis.

    Parameters

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

    Returns void

  • Specifies block texture to be used by mesh.

    Parameters

    • textureName: string
    • textureMeta: number

    Returns 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

    Returns 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
    • a: number

    Returns void

  • Sets following RenderMesh light direction.

    Parameters

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

    Returns void

  • Parameters

    • ignore: boolean
    • bool2: boolean

    Returns void

  • Parameters

    • float1: number
    • float2: number
    • float3: number

    Returns void

  • Sets following RenderMesh light position.

    Parameters

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

    Returns void

    2.0.2b25

  • Specifies the normal vector for the next vertices.

    Parameters

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

    Returns void

  • Translates the whole mesh along three axis.

    Parameters

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

    Returns void

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.