world global
The physical world of a running match, generated from the shipped declarations.
Generated from the declarations in @disko-game/build/types. world is
usable only while a match runs, between the start and stop events. See
World & physics for a guide.
The world global
The physical world of the running match.
World
Disko.Filtered
Collision groups shared by every collidable object.
| Member | Description |
|---|---|
setAcceptedGroups() | Only objects in one of these groups collide with this one. |
Disko.Collidable
Shared collision settings.
Disko.CollisionState
Collision properties of contact geometry, as read by state().
| Member | Description |
|---|---|
groups | Sorted memberships. |
acceptedGroups | Sorted accepted groups. |
Disko.DiscState
A disc's state at the current tick.
| Member | Description |
|---|---|
velocity | Per-tick displacement. |
gravity | Per-tick acceleration. |
inverseMass | Reciprocal mass; zero is immune to contact response. |
Disko.PlaneState
A plane's state.
| Member | Description |
|---|---|
normal | Normalized inward direction. |
Disko.VertexState
A vertex's state.
Disko.SegmentState
A segment's state. start and end are the vertices' engine handles.
| Member | Description |
|---|---|
curve | Curve factor, or null for a straight segment. |
Disko.JointState
A joint's state. first and second are the discs' engine handles.
Disko.CrossingState
A crossing's state.
| Member | Description |
|---|---|
groups | Sorted memberships. |
acceptedGroups | Sorted accepted groups. |
Disko.PhysicalState
The physical state of an object at the current tick.
Disko.DiscAppearance
Paint of a disc. Colors are #rrggbb or #rrggbbaa.
| Member | Description |
|---|---|
strokeWidth | Outline width in CSS pixels, 0 to 64; zero hides it. |
Disko.Disc
A physical disc.
Disko.Plane
An infinite collision plane.
Disko.Vertex
A fixed collision point, also the endpoint of segments.
Disko.Segment
A straight or curved segment between two vertices.
| Member | Description |
|---|---|
setCurve() | Curvature in radians; null for a straight segment. |
Disko.Joint
A distance constraint between two discs.
Disko.Crossing
A line that reports discs crossing it (crossing events).
Disko.PhysicalObject
Any physical object.
Disko.DiscOptions
Disko.PlaneOptions
Disko.VertexOptions
Disko.SegmentOptions
Disko.JointOptions
Disko.CrossingOptions
| Member | Description |
|---|---|
groups | Named memberships, in addition to the default membership. |
Disko.VisualAnchor
Where a world visual is drawn.
Disko.VisualAudience
Which players see a world visual. Exclusions take precedence.
| Member | Description |
|---|---|
include | Omitted: everyone; empty: nobody. |
Disko.TextVisualAppearance
Upright centered text, outlined for readability.
| Member | Description |
|---|---|
text | At most 256 UTF-8 bytes; no control characters. |
sizing | world (default) follows camera zoom; screen is CSS pixels. |
color | #rrggbb or #rrggbbaa. |
Disko.RingVisualAppearance
A circular stroke, without collisions.
| Member | Description |
|---|---|
radius | A fixed radius, or the anchor body's radius plus a gap. |
width | Stroke width in world units. |
color | #rrggbb or #rrggbbaa. |
Disko.VisualAppearance
Disko.VisualOptions
| Member | Description |
|---|---|
layer | Named rendering layer; exclusive with order. |
order | Relative to the anchor body; attached visuals default to above it. |
Disko.VisualPatch
A change to a world visual. An appearance of the same type is merged into the current one; a different type replaces it.
Disko.Visual
A non-physical world visual, such as a name label or a ring.
Disko.World
The physical world of the running match. Only usable between start and stop.
| Member | Description |
|---|---|
setLayerOrder() | Draw order of disc layers, back to front. |