CLASSES
TagsA - Z

VertexData

Description

class VertexData

The VertexData class.

Members

positions : number[]

The VertexData position

Float32Array : undefined

normals : number[]

The VertexData normals

Float32Array : undefined

tangents : number[]

Float32Array : undefined

uvs : number[]

The VertexData uvs

Float32Array : undefined

uvs2 : number[]

Float32Array : undefined

uvs3 : number[]

Float32Array : undefined

uvs4 : number[]

Float32Array : undefined

uvs5 : number[]

Float32Array : undefined

uvs6 : number[]

Float32Array : undefined

colors : number[]

The VertexData colors

Float32Array : undefined

matricesIndices : number[]

The VertexData matricesIndices

Float32Array : undefined

matricesWeights : number[]

The VertexData matricesWeights

Float32Array : undefined

matricesIndicesExtra : number[]

Float32Array : undefined

matricesWeightsExtra : number[]

Float32Array : undefined

indices : IndicesArray

The VertexData indices

Methods

set(data, Float32Array, kind) → void

Parameters

Name Type Description
data number[] or Float32Array @param data
kind string @param kind

applyToMesh(mesh, updatable) → VertexData

Associates the vertexData to the passed Mesh.

Sets it as updatable or not (default false).

Returns the VertexData.

Parameters

Name Type Description
mesh Mesh @param mesh
optional updatable boolean @param updatable

applyToGeometry(geometry, updatable) → VertexData

Associates the vertexData to the passed Geometry.

Sets it as updatable or not (default false).

Returns the VertexData.

Parameters

Name Type Description
geometry Geometry @param geometry
optional updatable boolean @param updatable

updateMesh(mesh, updateExtends, makeItUnique) → VertexData

Updates the associated mesh.

Returns the VertexData.

Parameters

Name Type Description
mesh Mesh @param mesh
optional updateExtends boolean Not used here
optional makeItUnique boolean Not used here

updateGeometry(geometry, updateExtends, makeItUnique) → VertexData

Updates the associated geometry.

Returns the VertexData.

Parameters

Name Type Description
geometry Geometry @param geometry
optional updateExtends boolean Not used here
optional makeItUnique boolean Not used here

transform(matrix) → VertexData

Transforms each position and each normal of the vertexData according to the passed Matrix.

Returns the VertexData.

Parameters

Name Type Description
matrix Matrix @param matrix

merge(other) → VertexData

Merges the passed VertexData into the current one.

Returns the modified VertexData.

Parameters

Name Type Description
other VertexData @param other

serialize() → any

Serializes the VertexData.

Returns a serialized object.

static ExtractFromMesh(mesh, copyWhenShared, forceCopy) → VertexData

Returns the object VertexData associated to the passed mesh.

Parameters

Name Type Description
mesh Mesh @param mesh
optional copyWhenShared boolean
optional forceCopy boolean

static ExtractFromGeometry(geometry, copyWhenShared, forceCopy) → VertexData

Returns the object VertexData associated to the passed geometry.

Parameters

Name Type Description
geometry Geometry @param geometry
optional copyWhenShared boolean
optional forceCopy boolean

static CreateRibbon(options) → VertexData

Creates the vertexData of the Ribbon.

Parameters

Name Type Description
options { pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4, invertUV: boolean, uvs: Vector2[], colors: Color4[] }

static CreateBox(options) → VertexData

Creates the VertexData of the Box.

Parameters

Name Type Description
options { size: number, width: number, height: number, depth: number, faceUV: Vector4[], faceColors: Color4[], sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateSphere(options) → VertexData

Creates the VertexData of the Sphere.

Parameters

Name Type Description
options { segments: number, diameter: number, diameterX: number, diameterY: number, diameterZ: number, arc: number, slice: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateCylinder(options) → VertexData

Creates the VertexData of the Cylinder or Cone.

Parameters

Name Type Description
options { height: number, diameterTop: number, diameterBottom: number, diameter: number, tessellation: number, subdivisions: number, arc: number, faceColors: Color4[], faceUV: Vector4[], hasRings: boolean, enclose: boolean, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateTorus(options) → VertexData

Creates the VertexData of the Torus.

Parameters

Name Type Description
options { diameter: number, thickness: number, tessellation: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateLineSystem(options) → VertexData

Creates the VertexData of the LineSystem.

Parameters

Name Type Description
options { lines: Vector3[][] }

static CreateDashedLines(options) → VertexData

Create the VertexData of the DashedLines.

Parameters

Name Type Description
options { points: Vector3[], dashSize: number, gapSize: number, dashNb: number }

static CreateGround(options) → VertexData

Creates the VertexData of the Ground.

Parameters

Name Type Description
options { width: number, height: number, subdivisions: number, subdivisionsX: number, subdivisionsY: number }

static CreateTiledGround(options) → VertexData

Creates the VertexData of the TiledGround.

Parameters

Name Type Description
options { xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { w: number, h: number }, precision: { w: number, h: number } }

static CreateGroundFromHeightMap(options) → VertexData

Creates the VertexData of the Ground designed from a heightmap.

Parameters

Name Type Description
options { width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, colorFilter: Color3, buffer: Uint8Array, bufferWidth: number, bufferHeight: number }

static CreatePlane(options) → VertexData

Creates the VertexData of the Plane.

Parameters

Name Type Description
options { size: number, width: number, height: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateDisc(options) → VertexData

Creates the VertexData of the Disc or regular Polygon.

Parameters

Name Type Description
options { radius: number, tessellation: number, arc: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreatePolygon(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs) → VertexData

Re-creates the VertexData of the Polygon for sideOrientation.

Parameters

Name Type Description
polygon Mesh
sideOrientation number
optional fUV any
optional fColors any
optional frontUVs Vector4

static CreateIcoSphere(options) → VertexData

Creates the VertexData of the IcoSphere.

Parameters

Name Type Description
options { radius: number, radiusX: number, radiusY: number, radiusZ: number, flat: boolean, subdivisions: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreatePolyhedron(options) → VertexData

Creates the VertexData of the Polyhedron.

Parameters

Name Type Description
options { type: number, size: number, sizeX: number, sizeY: number, sizeZ: number, custom: any, faceUV: Vector4[], faceColors: Color4[], flat: boolean, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static CreateTorusKnot(options) → VertexData

Creates the VertexData of the Torus Knot.

Parameters

Name Type Description
options { radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, sideOrientation: number, frontUVs: Vector4, backUVs: Vector4 }

static ComputeNormals(positions, indices, normals, options) → void

options (optional) :

facetPositions : optional array of facet positions (vector3)

facetNormals : optional array of facet normals (vector3)

facetPartitioning : optional partitioning array. facetPositions is required for facetPartitioning computation

subDiv : optional partitioning data about subdivsions on each axis (int), required for facetPartitioning computation

ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation

bbSize : optional bounding box size data, required for facetPartitioning computation

bInfo : optional bounding info, required for facetPartitioning computation

Parameters

Name Type Description
positions any @param positions
indices any @param indices
normals any @param normals

static ImportVertexData(parsedVertexData, geometry) → void

Creates a new VertexData from the imported parameters.

Parameters

Name Type Description
parsedVertexData any
geometry Geometry @param geometry