Skip to content

@bendyline/molen-kernel/character ​

Molen headless deterministic simulation kernel (no DOM, no three.js).

ts
import { /* … */ } from '@bendyline/molen-kernel/character';

Interfaces ​

CharacterData ​

Extends ​

Indexable ​

ts
[key: string]: JsonValue | undefined

Properties ​

gravity ​
ts
gravity: number;
grounded ​
ts
grounded: boolean;
jumpSpeed ​
ts
jumpSpeed: number;
speed ​
ts
speed: number;
vy ​
ts
vy: number;

Vertical velocity (kernel-owned).


CharacterOptions ​

Properties ​

groundHeight? ​
ts
optional groundHeight?: (x, z) => number;

Terrain/ground height at a world XZ. Default: the world's registered ground field (installTerrain, resolved lazily each tick so install order does not matter), else a flat ground at y=0.

Parameters ​
x ​

number

z ​

number

Returns ​

number


MoveIntentData ​

Extends ​

Indexable ​

ts
[key: string]: JsonValue | undefined

Properties ​

dir ​
ts
dir: [number, number];

Desired planar move direction (need not be normalized).

jump ​
ts
jump: boolean;

Variables ​

Character ​

ts
const Character: ComponentType<CharacterData>;

MoveIntent ​

ts
const MoveIntent: ComponentType<MoveIntentData>;

Functions ​

installCharacterController() ​

ts
function installCharacterController(world, opts?): void;

Install the character controller system (physics phase).

Parameters ​

world ​

World

opts? ​

CharacterOptions

Returns ​

void

37 guides · 36 schema formats · 41 API entry points · 10 samples. API, CLI and schema pages are generated from the shipped build.