Repository navigation
API Type ShapeDesc2D
github-actions[bot] edited this page Nov 24, 2026
·
3 revisions
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[];
};Defined in: src/plugins/physics/runtime/backend.ts:41
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.
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