Skip to content

@tmrw-realityos/charmDocs


@tmrw-realityos/charm / Mesh

Class: Mesh

Extended by

Constructors

new Mesh()

new Mesh(): Mesh

Returns

Mesh

Defined in

packages/charm/src/graphics/mesh.ts:38

Properties

bounding

bounding: AABB

Defined in

packages/charm/src/graphics/mesh.ts:25


colors?

optional colors: Uint8Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:32


indices?

optional indices: Uint16Array | Uint32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:33


mustUpdate

mustUpdate: boolean = false

Defined in

packages/charm/src/graphics/mesh.ts:34


normals?

optional normals: Float32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:28


positions?

optional positions: Float32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:27


primitives

primitives: Primitive[] = []

Defined in

packages/charm/src/graphics/mesh.ts:36


tangents?

optional tangents: Float32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:31


texcoords?

optional texcoords: Float32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:29


texcoords1?

optional texcoords1: Float32Array | number[]

Defined in

packages/charm/src/graphics/mesh.ts:30

Methods

appendMesh()

appendMesh(mesh, transform): void

Parameters

mesh: Mesh

transform: undefined | mat4 = undefined

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:121


bakeTransform()

bakeTransform(transform, start, range): void

applies a transformation in place to every vertex and normal

Parameters

transform: mat4

a mat4 that contains the transform to apply

start: number = 0

an offset defined from which primitive to start

range: number = -1

the number of primitives that must be affected

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:90


computeNormals()

computeNormals(): void

computes the normals for every vertex based on connectivity and face orientation

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:178


copyFrom()

copyFrom(mesh): void

Parameters

mesh: Mesh

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:67


createCube()

createCube(halfsize): void

Parameters

halfsize: number

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:264


createCylinder()

createCylinder(height, lowRadius, highRadius, subdivisions): void

Parameters

height: number

lowRadius: number

highRadius: number

subdivisions: number = 32

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:287


createPlane()

createPlane(halfsize, xy): void

Parameters

halfsize: number

xy: boolean = false

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:243


createPrimitive()

createPrimitive(): Primitive

Returns

Primitive

Defined in

packages/charm/src/graphics/mesh.ts:42


createSphere()

createSphere(radius, subdivisions, arc, hemi): void

Parameters

radius: number

subdivisions: number = 24

arc: number = 24

hemi: boolean = false

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:334


createTorus()

createTorus(innerradius, outerradius, angle, innerslices, outerslices): void

innerradius is the small, outerradius is the big one. Use angle to only create a partial torus

Parameters

innerradius: number

outerradius: number

angle: number = ...

innerslices: number = 24

outerslices: number = 32

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:387


updateBounding()

updateBounding(): void

Returns

void

Defined in

packages/charm/src/graphics/mesh.ts:48