Skip to content

@bendyline/molen-figures/client ​

Molen figures capability: stylized human, biped and quadruped rigs, gaits and sockets (kernel) with procedural skinned bodies (client).

ts
import { /* … */ } from '@bendyline/molen-figures/client';

Classes ​

FigureGeometryCache ​

Constructors ​

Constructor ​
ts
new FigureGeometryCache(): FigureGeometryCache;
Returns ​

FigureGeometryCache

Accessors ​

size ​
Get Signature ​
ts
get size(): number;
Returns ​

number

Methods ​

acquire() ​
ts
acquire(descriptor, tier): CachedFigureGeometry;

Acquire (generating on a miss) the geometry of a descriptor at a tier.

Parameters ​
descriptor ​

ResolvedFigureDescriptor

tier ​

FigureTier

Returns ​

CachedFigureGeometry

dispose() ​
ts
dispose(): void;
Returns ​

void

release() ​
ts
release(key): void;
Parameters ​
key ​

string

Returns ​

void

rigFor() ​
ts
rigFor(descriptor): FigureRig;

The rig of a descriptor (cached by descriptor key).

Parameters ​
descriptor ​

ResolvedFigureDescriptor

Returns ​

FigureRig

Interfaces ​

CachedFigureGeometry ​

Properties ​

body ​
ts
body: FigureBody;
geometry ​
ts
geometry: BufferGeometry;
key ​
ts
key: string;

FigureKindOptions ​

Properties ​

hysteresis? ​
ts
optional hysteresis?: number;

Fractional hysteresis around each tier boundary (default 0.1).

material? ​
ts
optional material?: Material<MaterialEventMap>;

Material for every figure (default: a vertex-colored standard material).

tierDistances? ​
ts
optional tierDistances?: [number, number];

Camera distances (meters) beyond which tier 1 and tier 2 bodies are used on the live path; default [0.35, 1] times the client's animation distantDistance.


FigureMesh ​

Properties ​

bones ​
ts
bones: Bone<Object3DEventMap>[];

Bones in rig order (empty for rigid tiers).

mesh ​
ts
mesh: 
  | SkinnedMesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>
| Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>;
root ​
ts
root: Group;

The root the backend places: the mesh and (for skinned tiers) the bone hierarchy.

skeleton ​
ts
skeleton: Skeleton | undefined;

Methods ​

dispose() ​
ts
dispose(): void;
Returns ​

void

Functions ​

applyPose() ​

ts
function applyPose(pose, bones): void;

Write a pose's local joint transforms into the bones (rig order).

Parameters ​

pose ​

FigurePose

bones ​

readonly Bone&lt;Object3DEventMap&gt;[]

Returns ​

void


cycleRiderPose() ​

ts
function cycleRiderPose(
   vehicle, 
   state, 
   seat
): 
  | {
  ik: Partial<Record<FigureIkEffector, Vec3>>;
  lean: number;
  level?: number;
  push?: number;
  stance?: "seated" | "standing" | "sideways";
  turn?: number;
}
  | undefined;

The rider's posture and hand/foot targets for the driver of a handlebar-steered vehicle: a cycle (seated, standing or sideways, see CycleSpec.stance) or a non-leaning vehicle with spec.handlebar. Undefined for every other vehicle and seat.

Parameters ​

vehicle ​

VehicleData | undefined

state ​

VehicleStateData | undefined

seat ​

SeatData | undefined

Returns ​

Type Literal ​
ts
{
  ik: Partial<Record<FigureIkEffector, Vec3>>;
  lean: number;
  level?: number;
  push?: number;
  stance?: "seated" | "standing" | "sideways";
  turn?: number;
}
ik ​
ts
ik: Partial<Record<FigureIkEffector, Vec3>>;
lean ​
ts
lean: number;
level? ​
ts
optional level?: number;

Roll of the vehicle with the ground across it, in radians (right side down positive), which an upright rider stands plumb against: on skis crossing a slope the body stays vertical while the feet follow the skis.

push? ​
ts
optional push?: number;
stance? ​
ts
optional stance?: "seated" | "standing" | "sideways";

Default seated. A standing or sideways rider stands on the idle pose instead of the seated one, the hips raised or lowered to this body's legs; a sideways rider turns across the board, left foot forward, and looks down it.

turn? ​
ts
optional turn?: number;

undefined


figureBodyToSkinnedMesh() ​

ts
function figureBodyToSkinnedMesh(
   body, 
   geometry, 
   material
): FigureMesh;

Wrap a generated body (its geometry already uploaded) in a posable mesh.

Parameters ​

body ​

FigureBody

geometry ​

BufferGeometry

material ​

Material

Returns ​

FigureMesh


figureGeometry() ​

ts
function figureGeometry(buffers): BufferGeometry;

A three.js geometry over kernel-generated figure buffers (shared by every entity with the key).

Parameters ​

buffers ​

SkinnedMeshBuffers

Returns ​

BufferGeometry


figureKind() ​

ts
function figureKind(options?): RenderableKind;

The figure renderable kind for ClientOptions.kinds.

Parameters ​

options? ​

FigureKindOptions

Returns ​

RenderableKind

References ​

evaluatePose ​

Re-exports evaluatePose


FigureAnchor ​

Re-exports FigureAnchor


FigureData ​

Re-exports FigureData


FigureMode ​

Re-exports FigureMode


FigurePose ​

Re-exports FigurePose


FigureRig ​

Re-exports FigureRig


figureSeed ​

Re-exports figureSeed


FigureStateData ​

Re-exports FigureStateData


FigureTier ​

Re-exports FigureTier


PoseEvalOptions ​

Re-exports PoseEvalOptions


ResolvedFigureDescriptor ​

Re-exports ResolvedFigureDescriptor


resolveFigureDescriptor ​

Re-exports resolveFigureDescriptor


strideRateFor ​

Re-exports strideRateFor


worldToFigure ​

Re-exports worldToFigure

50 guides · 44 schema formats · 51 API entry points · 11 samples. API, CLI and schema pages are generated from the shipped build.