Namespace in reactor_3d_models.js

(global functions)

15 public functions in 1 groups · show internal (_) functions

Characters made in the 3D Character Builder.

Quick Reference

Other 15

reactorSplitGlb() Off-thread GLB parsing: a worker splits the container, parses the JSON chunk, and decodes embedded textures t…
reactorCompactGlb() The part of a GLB's binary chunk the runtime reads: every accessor's view, packed into a buffer of its own (e…
reactorKtx2Worker() The transcoder worker's message loop, run after basis_transcoder.js in the worker (so BASIS is there).
keyStop() Key stop.
keyField() Key field.
keyMeets() Key meets.
keySlope() Key slope.
keyWidth() Key width.
keyTangent() Key tangent.
animNextVec() The animation pool's hand-outs, as plain functions over counters kept on the pool itself.
animNextQuat() Anim next quat.
animNextMat() Anim next mat.
animPivotTurn() Anim pivot turn.
animPivotGrow() Anim pivot grow.
animSetQuaternion() Anim set quaternion.

Other

reactorSplitGlb

function source
function reactorSplitGlb(buffer)

Off-thread GLB parsing: a worker splits the container, parses the JSON chunk, and decodes embedded textures to ImageBitmaps, transferring the file buffer there and back.

Details

Off-thread GLB parsing: a worker splits the container, parses the JSON chunk, and decodes embedded textures to ImageBitmaps, transferring the file buffer there and back. The worker's source is assembled from the two functions below and spawned from a Blob URL, so the runtime stays one module and the same worker serves the game and the editor alike. Any failure hands the buffer back and the caller parses synchronously.

reactorCompactGlb

function source
function reactorCompactGlb(json, buffer, binOffset, binLength)

The part of a GLB's binary chunk the runtime reads: every accessor's view, packed into a buffer of its own (each view keeps its offset's remainder by 16, so every typed array over it stays aligned), and the pictures a material names as Blobs on their images entries (rrBlob).

Details

The part of a GLB's binary chunk the runtime reads: every accessor's view, packed into a buffer of its own (each view keeps its offset's remainder by 16, so every typed array over it stays aligned), and the pictures a material names as Blobs on their images entries (rrBlob). This includes normal and emissive maps and extension textures: the model reader still needs their bytes after the original buffer is released. Pictures nothing names are left behind, with the rest of the file. json is updated in place to the new offsets. Returns the packed ArrayBuffer.

reactorKtx2Worker

function source
function reactorKtx2Worker(scope)

The transcoder worker's message loop, run after basis_transcoder.js in the worker (so BASIS is there).

Details

The transcoder worker's message loop, run after basis_transcoder.js in the worker (so BASIS is there). The first message brings the WebAssembly; each later one a KTX2 file to transcode from the first level at most cap on a side, its levels sent back as they will be uploaded.

keyStop

function source
function keyStop(line, j)

Key stop.

keyField

function source
function keyField(stop, name, i)

Key field.

keyMeets

function source
function keyMeets(line, name, i)

Key meets.

keySlope

function source
function keySlope(line, name, i, j)

Key slope.

keyWidth

function source
function keyWidth(line, j)

Key width.

keyTangent

function source
function keyTangent(line, name, i, j)

Key tangent.

animNextVec

function source
function animNextVec(pool)

The animation pool's hand-outs, as plain functions over counters kept on the pool itself.

Details

The animation pool's hand-outs, as plain functions over counters kept on the pool itself. As closures they were made afresh on every call: seven allocations per animated model per frame, for the same four lines.

animNextQuat

function source
function animNextQuat(pool)

Anim next quat.

animNextMat

function source
function animNextMat(pool)

Anim next mat.

animPivotTurn

function source
function animPivotTurn(pool, pivot, quat)

Anim pivot turn.

animPivotGrow

function source
function animPivotGrow(pool, pivot, size)

Anim pivot grow.

animSetQuaternion

function source
function animSetQuaternion(entry, q)

Anim set quaternion.