Skip to content

The library

lusine's library is a set of kernels: small laws written once in Trait, which a game calls by name, such as lusine.laws.drag. They are grouped into layers by what they are about. Each kernel's page shows its Trait source first, then checks what it computes.

Camera

Moving a game's camera: following a target, orbiting it, looking and walking in the first person.

Display

Turning a value into a colour to show: a grey level, a heat ramp.

Error

The seeded error: random draws that are the same on every run, from a seed, a step, a stream's name and an index.

Events

Noticing things between steps: the step a state turns on, and how much two intervals overlap.

Finance

Markets and money: returns and volatility, bonds and yields, options and their sensitivities, matching orders and a factor model's fair value.

Integrator

Moving bodies through time, a step at a time: velocity Verlet, semi-implicit Euler, contacts, impacts, rolling and turning.

Kinematics

Orientation: turning a vector into or out of a body's frame, and a rolling ball's spin.

Laws

Physical laws: gravity and drag, buoyancy, diffusion, elasticity, erosion, pressure, spin and lift, and the standard atmosphere.

Light

Light across a lattice: a directional beam and point sources, with the shadows what stands between casts.

Motion

Movement on a lattice by propose and grant: each item asks to move, and each place goes to one.

Properties

A material's properties derived from the library's tables: densities and mixtures, the speed of sound, optics, heat flow, and kinetic energy.

Radiation

A black body's light: Planck's law, the power it radiates, and where its spectrum peaks.

Rays

The rays a source or a direction casts across a lattice, the cells each passes through.

Render

Drawing a scene by tracing rays: a camera's rays, what they hit, how surfaces shade, shadows, the sky, haze, surface noise and tone mapping.

Sky

The sky over a world: the sun, the moon and the stars, sidereal time, and gravity at a height.

Sound

Sound: a sound field across a lattice and a loudness meter.

Space

Finding the items near each other: every pair within a radius.

Statistics

Summaries over a table: the weighted mean.

Stochastic

Chance and spread for a step of any length, from what holds over a period.