PosComp
Defined in: packages/threeplay/src/plugins/transform/types.ts:9
Fields added by pos().
Extends
Section titled “Extends”Methods
Section titled “Methods”add()?
Section titled “add()?”
optionaladd(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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”destroy()?
Section titled “destroy()?”
optionaldestroy(this):void
Defined in: packages/threeplay/src/core/types.ts:69
Called when the object is destroyed or the component removed.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”distanceTo()
Section titled “distanceTo()”distanceTo(
target):number
Defined in: packages/threeplay/src/plugins/transform/types.ts:26
Distance to a point or object.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”number
fixedUpdate()?
Section titled “fixedUpdate()?”
optionalfixedUpdate(this):void
Defined in: packages/threeplay/src/core/types.ts:67
Called at the fixed physics rate (50 Hz by default).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”inspect()?
Section titled “inspect()?”
optionalinspect(this):string|null|undefined
Defined in: packages/threeplay/src/core/types.ts:71
Short status line shown by the debug inspector.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string | null | undefined
Inherited from
Section titled “Inherited from”move()
Section titled “move()”move(
x,y?,z?):void
Defined in: packages/threeplay/src/plugins/transform/types.ts:18
Moves by a velocity in units per second (multiplied by dt() for you).
If the object has a component defining applyMove (physics), the
movement is handed to it so it respects collisions.
Parameters
Section titled “Parameters”number | Vec3Like
number
number
Returns
Section titled “Returns”void
moveTo()
Section titled “moveTo()”moveTo(
target,speed?):void
Defined in: packages/threeplay/src/plugins/transform/types.ts:20
Moves towards a point at speed units/s, or jumps there without speed.
Parameters
Section titled “Parameters”target
Section titled “target”speed?
Section titled “speed?”number
Returns
Section titled “Returns”void
setWorldPos()
Section titled “setWorldPos()”setWorldPos(
v):void
Defined in: packages/threeplay/src/plugins/transform/types.ts:24
Sets the world-space position.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
update()?
Section titled “update()?”
optionalupdate(this):void
Defined in: packages/threeplay/src/core/types.ts:65
Called once per frame.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”worldPos()
Section titled “worldPos()”worldPos():
Vector3
Defined in: packages/threeplay/src/plugins/transform/types.ts:22
Position in world space (accounts for parents).
Returns
Section titled “Returns”Vector3
Properties
Section titled “Properties”conflicts?
Section titled “conflicts?”
optionalconflicts?:string[]
Defined in: packages/threeplay/src/core/types.ts:61
Ids of components that can’t be on the same object (checked both ways).
Inherited from
Section titled “Inherited from”id:
"pos"
Defined in: packages/threeplay/src/plugins/transform/types.ts:10
Unique name. Two components with the same id replace each other.
Overrides
Section titled “Overrides”pos:
Vector3
Defined in: packages/threeplay/src/plugins/transform/types.ts:12
Local position (it is object3d.position).
require?
Section titled “require?”
optionalrequire?:string[]
Defined in: packages/threeplay/src/core/types.ts:59
Ids of components that must be present on the object.