Skip to content

@bendyline/molen-kernel/glass ​

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

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

Interfaces ​

GlassCrashLoad ​

One resolved chassis collision. Vectors are world-space; angular change is rad/s.

Properties ​

angularVelocity ​
ts
angularVelocity: Vec3;
centerOfMass ​
ts
centerOfMass: Vec3;
deltaAngularVelocity ​
ts
deltaAngularVelocity: Vec3;
deltaVelocity ​
ts
deltaVelocity: Vec3;
velocity ​
ts
velocity: Vec3;

Variables ​

Glass ​

ts
const Glass: ComponentType<GlassData>;

GlassState ​

ts
const GlassState: ComponentType<GlassStateData>;

Functions ​

applyGlassCrash() ​

ts
function applyGlassCrash(
   world, 
   entity, 
   crash
): void;

Chassis impulse loads each pane by its mass and normal acceleration, including yaw shock.

Parameters ​

world ​

World

entity ​

string

crash ​

GlassCrashLoad

Returns ​

void


applyGlassImpact() ​

ts
function applyGlassImpact(
   pane, 
   state, 
   impact
): GlassSurfaceState;

Reduced thin-strip bending model: sigma = C F span / (width thickness²). C = 1.5 for a centered point force, 0.75 for distributed inertia. Normal impulse / physical pulse duration supplies F; tangential energy cannot fracture the pane. Strength initiates cracks, excess normal energy grows them. Frame/interlayer failure has its own force/work budget. This is a deterministic gameplay approximation, not a laminated-plate FEM solver.

Parameters ​

pane ​

GlassSurfaceSpec

state ​

GlassSurfaceState

impact ​

GlassImpact

Returns ​

GlassSurfaceState


damageGlass() ​

ts
function damageGlass(world, input): void;

Apply a contact to an authored pane and publish transitions after committing persistent state.

Parameters ​

world ​

World

input ​

GlassImpactEvent

Returns ​

void


initialGlassSurfaceState() ​

ts
function initialGlassSurfaceState(): GlassSurfaceState;

Returns ​

GlassSurfaceState


installGlass() ​

ts
function installGlass(world): void;

Enables glass-impact contacts from scripts/physics adapters. State lives entirely in ECS.

Parameters ​

world ​

World

Returns ​

void

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