Repository navigation
API Type ShapeDesc2D
type ShapeDesc2D =
| {
halfExtents: PhysicsVec2;
kind: "box";
}
| {
kind: "circle";
radius: number;
}
| {
halfHeight: number;
kind: "capsule";
radius: number;
}
| {
kind: "convexPolygons";
label?: string;
outline: readonly PhysicsPoint2[];
parts: readonly (readonly PhysicsPoint2[])[];
}
| {
kind: "convexHull";
points: readonly PhysicsPoint2[];
}
| {
kind: "polyline";
oriented?: boolean;
points: readonly PhysicsPoint2[];
}
| {
fixInternalEdges?: boolean;
kind: "compound";
parts: readonly object[];
}
| {
cells: Int32Array;
kind: "voxels";
size: PhysicsVec2;
};Defined in: src/plugins/physics/runtime/backend.ts:42
2D shapes, in the collider's frame.
{
halfExtents: PhysicsVec2;
kind: "box";
}{
kind: "circle";
radius: number;
}{
halfHeight: number;
kind: "capsule";
radius: number;
}Upright (along y); halfHeight is the straight part's.
{
kind: "convexPolygons";
label?: string;
outline: readonly PhysicsPoint2[];
parts: readonly (readonly PhysicsPoint2[])[];
}A polygon split into convex parts (one part: a convex hull). If a part has no hull, the closed outline collides as a line.
{
kind: "convexHull";
points: readonly PhysicsPoint2[];
}The convex hull of the points (a tiny circle when they have none).
{
kind: "polyline";
oriented?: boolean;
points: readonly PhysicsPoint2[];
}A line through the points; closed shapes repeat the first point. Oriented lines are solid on their left only.
{
fixInternalEdges?: boolean;
kind: "compound";
parts: readonly object[];
}Several shapes as one collider; fixInternalEdges keeps bodies sliding over the seams from catching.
{
cells: Int32Array;
kind: "voxels";
size: PhysicsVec2;
}Capability voxelColliders (ADR 0444): grid cells, each size (positive) on a side. cells holds the filled
cells' integer coordinates as (x, y) pairs; cell (x, y) covers x·size.x .. (x+1)·size.x (and the same in y) in the
collider's frame. Edited in place with setVoxels; never a compound's part.
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference