Repository navigation
API Class Physics2D
Defined in: src/plugins/physics/runtime/Physics2D.ts:47
2D physics queries and settings for the current World (ADR 0005, 0032). Each World has its own physics world; queries never see another World's colliders.
new Physics2D(): Physics2D;Physics2D
get static gravity(): Vector2;Defined in: src/plugins/physics/runtime/Physics2D.ts:48
set static gravity(g): void;Defined in: src/plugins/physics/runtime/Physics2D.ts:52
void
static boxCast(
origin,
size,
angle,
direction,
maxDistance?,
layers?
): ShapeCastHit2D | null;Defined in: src/plugins/physics/runtime/Physics2D.ts:69
Sweep a box (full size, rotated by angle degrees) along direction.
number
number = Number.MAX_VALUE
string[]
ShapeCastHit2D | null
static capsuleCast(
origin,
size,
angle,
direction,
maxDistance?,
layers?
): ShapeCastHit2D | null;Defined in: src/plugins/physics/runtime/Physics2D.ts:74
Sweep a vertical capsule (full size, rotated by angle degrees) along direction.
number
number = Number.MAX_VALUE
string[]
ShapeCastHit2D | null
static circleCast(
origin,
radius,
direction,
maxDistance?,
layers?
): ShapeCastHit2D | null;Defined in: src/plugins/physics/runtime/Physics2D.ts:64
Sweep a circle along direction; returns the first collider hit.
number
number = Number.MAX_VALUE
string[]
ShapeCastHit2D | null
static overlapBox(
point,
size,
angle?,
layers?
): Collider2D[];Defined in: src/plugins/physics/runtime/Physics2D.ts:84
Every collider overlapping a box (full size, rotated by angle degrees).
number = 0
string[]
static overlapCapsule(
point,
size,
angle?,
layers?
): Collider2D[];Defined in: src/plugins/physics/runtime/Physics2D.ts:89
Every collider overlapping a vertical capsule (full size, rotated by angle degrees).
number = 0
string[]
static overlapCircle(
point,
radius,
layers?
): Collider2D[];Defined in: src/plugins/physics/runtime/Physics2D.ts:79
Every collider overlapping a circle.
number
string[]
static overlapPoint(point, layers?): Collider2D[];Defined in: src/plugins/physics/runtime/Physics2D.ts:94
Every collider containing the point.
string[]
static raycast(
origin,
direction,
maxDistance?,
layers?
): RaycastHit2D | null;Defined in: src/plugins/physics/runtime/Physics2D.ts:57
Cast a ray; optionally restrict hits to the named layers.
number = Number.MAX_VALUE
string[]
RaycastHit2D | null
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