Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • CreateBox(name: string, size: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a box mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    Returns Mesh

    a new Mesh

  • CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene?: Scene, updatable?: any, sideOrientation?: number): Mesh
  • Creates a cylinder or a cone mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • height: number

      sets the height size (float) of the cylinder/cone (float, default 2)

    • diameterTop: number

      set the top cap diameter (floats, default 1)

    • diameterBottom: number

      set the bottom cap diameter (floats, default 1). This value can't be zero

    • tessellation: number

      sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance

    • subdivisions: any

      sets the number of rings along the cylinder height (positive integer, default 1)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: any

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • Creates a dashed line mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • points: Vector3[]

      is an array successive Vector3

    • dashSize: number

      is the size of the dashes relatively the dash number (positive float, default 3)

    • gapSize: number

      is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)

    • dashNb: number

      is the intended total number of dashes (positive integer, default 200)

    • scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional instance: LinesMesh

      is an instance of an existing LineMesh object to be updated with the passed points parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)

    Returns LinesMesh

    a new Mesh

  • Creates a decal mesh. . A decal is a mesh usually applied as a model onto the surface of another mesh

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh

    • sourceMesh: AbstractMesh

      defines the mesh receiving the decal

    • position: Vector3

      sets the position of the decal in world coordinates

    • normal: Vector3

      sets the normal of the mesh where the decal is applied onto in world coordinates

    • size: Vector3

      sets the decal scaling

    • angle: number

      sets the angle to rotate the decal

    Returns Mesh

    a new Mesh

  • CreateDisc(name: string, radius: number, tessellation: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane polygonal mesh. By default, this is a disc.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

      sets the radius size (float) of the polygon (default 0.5)

    • tessellation: number

      sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc

    • scene: Nullable<Scene>

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • CreateGround(name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh
  • Creates a ground mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • width: number

      set the width of the ground

    • height: number

      set the height of the ground

    • subdivisions: number

      sets the number of subdivisions per side

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

  • CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: ((mesh: GroundMesh) => void), alphaFilter?: number): GroundMesh
  • Creates a ground mesh from a height map.

    see

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • url: string

      sets the URL of the height map image resource

    • width: number

      set the ground width size

    • height: number

      set the ground height size

    • subdivisions: number

      sets the number of subdivision per side

    • minHeight: number

      is the minimum altitude on the ground

    • maxHeight: number

      is the maximum altitude on the ground

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional onReady: ((mesh: GroundMesh) => void)

      is a callback function that will be called once the mesh is built (the height map download can last some time)

    • Optional alphaFilter: number

      will filter any data where the alpha channel is below this value, defaults 0 (all data visible)

    Returns GroundMesh

    a new Mesh

  • CreateHemisphere(name: string, segments: number, diameter: number, scene?: Scene): Mesh
  • Creates a hemisphere mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • segments: number

      sets the sphere number of horizontal stripes (positive integer, default 32)

    • diameter: number

      sets the diameter size (float) of the sphere (default 1)

    • Optional scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

  • CreateIcoSphere(name: string, options: { flat?: boolean; radius?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }, scene: Scene): Mesh
  • Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided

    • The parameter radius sets the radius size (float) of the icosphere (default 1)
    • You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters radiusX, radiusY and radiusZ (all by default have the same value than radius)
    • The parameter subdivisions sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
    • The parameter flat (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
    • You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
    • If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters frontUVs and backUVs (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created
    see

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh

    • options: { flat?: boolean; radius?: number; sideOrientation?: number; subdivisions?: number; updatable?: boolean }

      defines the options used to create the mesh

      • Optional flat?: boolean
      • Optional radius?: number
      • Optional sideOrientation?: number
      • Optional subdivisions?: number
      • Optional updatable?: boolean
    • scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

  • CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates lathe mesh. The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero

    • radius: number

      is the radius value of the lathe

    • tessellation: number

      is the side number of the lathe.

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a plane mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    Returns Mesh

    a new Mesh

  • CreatePolygon(name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh
  • Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh. The parameter shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors. You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created. Remember you can only change the shape positions, not their number when updating a polygon.

    see

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors

    • scene: Scene

      defines the hosting scene

    • Optional holes: Vector3[][]

      is a required array of arrays of successive Vector3 used to defines holes in the polygon

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional earcutInjection: any

      can be used to inject your own earcut reference

    Returns Mesh

    a new Mesh

  • CreatePolyhedron(name: string, options: { custom?: any; faceColors?: Color4[]; faceUV?: Vector4[]; sideOrientation?: number; size?: number; sizeX?: number; sizeY?: number; sizeZ?: number; type?: number; updatable?: boolean }, scene: Scene): Mesh
  • Creates a polyhedron mesh. .

    • The parameter type (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded types. Please refer to the type sheet in the tutorial to choose the wanted type
    • The parameter size (positive float, default 1) sets the polygon size
    • You can overwrite the size on each dimension bu using the parameters sizeX, sizeY or sizeZ (positive floats, default to size value)
    • You can build other polyhedron types than the 15 embbeded ones by setting the parameter custom (polyhedronObject, default null). If you set the parameter custom, this overwrittes the parameter type
    • A polyhedronObject is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
    • You can set the color and the UV of each side of the polyhedron with the parameters faceColors (Color4, default (1, 1, 1, 1)) and faceUV (Vector4, default (0, 0, 1, 1))
    • To understand how to set faceUV or faceColors, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
    • The parameter flat (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, faceColors and faceUV are ignored
    • You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
    • If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters frontUVs and backUVs (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created
    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • options: { custom?: any; faceColors?: Color4[]; faceUV?: Vector4[]; sideOrientation?: number; size?: number; sizeX?: number; sizeY?: number; sizeZ?: number; type?: number; updatable?: boolean }

      defines the options used to create the mesh

      • Optional custom?: any
      • Optional faceColors?: Color4[]
      • Optional faceUV?: Vector4[]
      • Optional sideOrientation?: number
      • Optional size?: number
      • Optional sizeX?: number
      • Optional sizeY?: number
      • Optional sizeZ?: number
      • Optional type?: number
      • Optional updatable?: boolean
    • scene: Scene

      defines the hosting scene

    Returns Mesh

    a new Mesh

  • CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene?: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a sphere mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • segments: number

      sets the sphere number of horizontal stripes (positive integer, default 32)

    • diameter: number

      sets the diameter size (float) of the sphere (default 1)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { h: number; w: number }, precision: { h: number; w: number }, scene: Scene, updatable?: boolean): Mesh
  • Creates a tiled ground mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • xmin: number

      set the ground minimum X coordinate

    • zmin: number

      set the ground minimum Y coordinate

    • xmax: number

      set the ground maximum X coordinate

    • zmax: number

      set the ground maximum Z coordinate

    • subdivisions: { h: number; w: number }

      is an object {w: positive integer, h: positive integer} (default {w: 6, h: 6}). w and h are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile

      • h: number
      • w: number
    • precision: { h: number; w: number }

      is an object {w: positive integer, h: positive integer} (default {w: 2, h: 2}). w and h are the numbers of subdivisions on the ground width and height of each tile

      • h: number
      • w: number
    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    Returns Mesh

    a new Mesh

  • CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • diameter: number

      sets the diameter size (float) of the torus (default 1)

    • thickness: number

      sets the diameter size of the tube of the torus (float, default 0.5)

    • tessellation: number

      sets the number of torus sides (positive integer, default 16)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh
  • Creates a torus knot mesh.

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • radius: number

      sets the global radius size (float) of the torus knot (default 2)

    • tube: number

      sets the diameter size of the tube of the torus (float, default 0.5)

    • radialSegments: number

      sets the number of sides on each tube segments (positive integer, default 32)

    • tubularSegments: number

      sets the number of tubes to decompose the knot into (positive integer, default 32)

    • p: number

      the number of windings on X axis (positive integers, default 2)

    • q: number

      the number of windings on Y axis (positive integers, default 3)

    • Optional scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number

    Returns Mesh

    a new Mesh

  • CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: ((i: number, distance: number) => number), cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates a tube mesh. The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.

    see

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • path: Vector3[]

      is a required array of successive Vector3. It is the curve used as the axis of the tube

    • radius: number

      sets the tube radius size

    • tessellation: number

      is the number of sides on the tubular surface

    • radiusFunction: ((i: number, distance: number) => number)

      is a custom function. If it is not null, it overrides the parameter radius. This function is called on each point of the tube path and is passed the index i of the i-th point and the distance of this point from the first point of the path

        • (i: number, distance: number): number
        • Parameters

          • i: number
          • distance: number

          Returns number

    • cap: number

      sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      is an instance of an existing Tube object to be updated with the passed pathArray parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)

    Returns Mesh

    a new Mesh

  • Extends a mesh to a Goldberg mesh Warning the mesh to convert MUST be an import of a perviously exported Goldberg mesh

    deprecated

    Please use ExtendMeshToGoldberg instead

    Parameters

    • mesh: Mesh

      the mesh to convert

    Returns Mesh

    the extended mesh

  • ExtrudePolygon(name: string, shape: Vector3[], depth: number, scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh
  • ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • ExtrudeShapeCustom(name: string, shape: Vector3[], path: Vector3[], scaleFunction: Nullable<((i: number, distance: number) => number)>, rotationFunction: Nullable<((i: number, distance: number) => number)>, ribbonCloseArray: boolean, ribbonClosePath: boolean, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh
  • Creates an custom extruded shape mesh. The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.

    see

    https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes

    deprecated

    Please use MeshBuilder instead

    Parameters

    • name: string

      defines the name of the mesh to create

    • shape: Vector3[]

      is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis

    • path: Vector3[]

      is a required array of successive Vector3. This is the axis curve the shape is extruded along

    • scaleFunction: Nullable<((i: number, distance: number) => number)>

      is a custom Javascript function called on each path point

    • rotationFunction: Nullable<((i: number, distance: number) => number)>

      is a custom Javascript function called on each path point

    • ribbonCloseArray: boolean

      forces the extrusion underlying ribbon to close all the paths in its pathArray

    • ribbonClosePath: boolean

      forces the extrusion underlying ribbon to close its pathArray

    • cap: number

      sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL

    • scene: Scene

      defines the hosting scene

    • Optional updatable: boolean

      defines if the mesh must be flagged as updatable

    • Optional sideOrientation: number
    • Optional instance: Mesh

      is an instance of an existing ExtrudedShape object to be updated with the passed shape, path, scale or rotation parameters (https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)

    Returns Mesh

    a new Mesh

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme