Skip to content

TriangleArrayWriter

Overview

Helps writing buffer-array style triangles into buffers.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class TriangleArrayWriter

import { TriangleArrayWriter } from 'scenerystack/mobius';

Constructor

new TriangleArrayWriter( positionArray : Float32Array | null, normalArray : Float32Array | null, uvArray : Float32Array | null, offset, offsetPosition : Vector3 )

Instance Methods

position( x : number, y : number, z : number )

Writes a position into the (optional) positionArray, and increments the offset.

normal( x : number, y : number, z : number )

Writes a normal into the (optional) normalArray

uv( u : number, v : number )

Writes a UV into the (optional) uvArray

getOffset() : number

Returns the offset (previous offset + number of triangles added, counted from the positionArray)

Source Code

See the source for TriangleArrayWriter.ts in the mobius repository.