Skip to content

AreaComp

Defined in: packages/threeplay/src/plugins/physics/types.ts:43

Fields added by area().

optional add(this): void

Defined in: packages/threeplay/src/core/types.ts:63

Called when the object enters the scene (or when used on a live object).

GameObj

void

Comp.add


optional destroy(this): void

Defined in: packages/threeplay/src/core/types.ts:69

Called when the object is destroyed or the component removed.

GameObj

void

Comp.destroy


optional fixedUpdate(this): void

Defined in: packages/threeplay/src/core/types.ts:67

Called at the fixed physics rate (50 Hz by default).

GameObj

void

Comp.fixedUpdate


getCollisions(): GameObj[]

Defined in: packages/threeplay/src/plugins/physics/types.ts:58

Objects currently touching this one.

GameObj[]


optional inspect(this): string | null | undefined

Defined in: packages/threeplay/src/core/types.ts:71

Short status line shown by the debug inspector.

GameObj

string | null | undefined

Comp.inspect


isColliding(other): boolean

Defined in: packages/threeplay/src/plugins/physics/types.ts:56

true while touching other (or any object with that tag).

string | GameObj

boolean


onCollide(tag, fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:47

When this object starts touching another (optionally with tag).

string

(other, col) => void

EventController

onCollide(fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:48

(other, col) => void

EventController


onCollideEnd(tag, fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:53

When this object stops touching another.

string

(other) => void

EventController

onCollideEnd(fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:54

(other) => void

EventController


onCollideUpdate(tag, fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:50

Every fixed step while touching.

string

(other, col) => void

EventController

onCollideUpdate(fn): EventController

Defined in: packages/threeplay/src/plugins/physics/types.ts:51

(other, col) => void

EventController


optional update(this): void

Defined in: packages/threeplay/src/core/types.ts:65

Called once per frame.

GameObj

void

Comp.update

area: object

Defined in: packages/threeplay/src/plugins/physics/types.ts:45

sensor: boolean

shape: string


optional conflicts?: string[]

Defined in: packages/threeplay/src/core/types.ts:61

Ids of components that can’t be on the same object (checked both ways).

Comp.conflicts


id: "area"

Defined in: packages/threeplay/src/plugins/physics/types.ts:44

Unique name. Two components with the same id replace each other.

Comp.id


optional require?: string[]

Defined in: packages/threeplay/src/core/types.ts:59

Ids of components that must be present on the object.

Comp.require