Skip to content

PrimitiveComp

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

A primitive shape component. Its id is "shape", so an object has only one.

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

ShapeComp.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

ShapeComp.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

ShapeComp.fixedUpdate


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

ShapeComp.inspect


optional isolateMaterials(): void

Defined in: packages/threeplay/src/plugins/shapes/types.ts:34

Optional. Makes the shape’s materials private to this object (clones them, once), for shapes whose materials may be shared with other objects, like model(). color() and opacity() call it before writing to the materials.

void

ShapeComp.isolateMaterials


optional update(this): void

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

Called once per frame.

GameObj

void

ShapeComp.update

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).

ShapeComp.conflicts


id: "shape"

Defined in: packages/threeplay/src/plugins/shapes/types.ts:49

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

ShapeComp.id


mesh: Mesh

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

ShapeComp.mesh


optional require?: string[]

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

Ids of components that must be present on the object.

ShapeComp.require


shape: ShapeDesc

Defined in: packages/threeplay/src/plugins/shapes/types.ts:27

ShapeComp.shape