Skip to content

@bendyline/molen-kernel/kinematics ​

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

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

Interfaces ​

ColliderData ​

Extends ​

Indexable ​

ts
[key: string]: JsonValue | undefined

Properties ​

halfExtents? ​
ts
optional halfExtents?: [number, number];
isStatic? ​
ts
optional isStatic?: boolean;
layer ​
ts
layer: number;
mask ​
ts
mask: number;
radius? ​
ts
optional radius?: number;
shape ​
ts
shape: "circle" | "aabb";

KinematicBodyData ​

Extends ​

Indexable ​

ts
[key: string]: JsonValue | undefined

Properties ​

slide ​
ts
slide: boolean;
vel ​
ts
vel: Vec3;

KinematicsOptions ​

Properties ​

broadphase? ​
ts
optional broadphase?: "grid" | "brute";

grid (default) or brute (the O(n²) reference, kept as the test oracle).

ground? ​
ts
optional ground?: "flat" | "terrain";

Vertical constraint for kinematic bodies: none (default; vel[1] integrates freely), flat (clamped to y = 0), or terrain (clamped to the world's ground field — see installTerrain on the /terrain subpath).


RayHit ​

Properties ​

distance ​
ts
distance: number;
id ​
ts
id: string;
point ​
ts
point: Vec3;

Variables ​

Collider ​

ts
const Collider: ComponentType<ColliderData>;

KinematicBody ​

ts
const KinematicBody: ComponentType<KinematicBodyData>;

Functions ​

installKinematics() ​

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

Install the kinematic collision system (physics phase).

Parameters ​

world ​

World

opts? ​

KinematicsOptions

Returns ​

void


overlapCircle() ​

ts
function overlapCircle(
   world, 
   center, 
   radius, 
   mask?
): string[];

Return entity ids whose collider overlaps a circle at (center, radius).

Parameters ​

world ​

World

center ​

Vec3

radius ​

number

mask? ​

number

Returns ​

string[]


raycast() ​

ts
function raycast(
   world, 
   origin, 
   dir, 
   maxDist, 
   mask?
): RayHit | null;

Raycast in the XZ plane against colliders; returns the nearest hit. O(n).

Parameters ​

world ​

World

origin ​

Vec3

dir ​

Vec3

maxDist ​

number

mask? ​

number

Returns ​

RayHit | null

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