Component3d

Component3D class

Signature:

export declare class Component3D<Data extends Component3DData = Component3DData> extends AugmentedGroup 

Extends: AugmentedGroup

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Component3D class.

Properties

Property

Modifiers

Type

Description

_dataChangeListener

() => void

behaviors

readonly

ScriptBehavior[]

childComponents

readonly

Component3D[]

collider

Collider

Collider for this component, it encapsulates some convenience methods for physics And gives access to the underlying physics rigidbody and collider

componentId

readonly

string

Returns the unique id for this component

componentName

readonly

string

Returns the name of this component (if set in data.name)

componentType

readonly

unknown

Returns the type of this component (avatar, model, etc)

data

readonly

Data

geometry

never

geometry prop is not allowed on components

identifier

readonly

string

Returns the unique identifier for this component

isPersistent

readonly

boolean

material

never

material prop is not allowed on components

opts

protected

ComponentOpts

parentComponent

readonly

Component3D

positionWorld

readonly

Vector3

the position in world space

quaternionWorld

readonly

Quaternion

the quaternion in world space

rigidBody

RigidBodyWrapper

Rigid body attached to this component, it encapsulates some convenience methods for physics And gives access to the underlying physics rigidbody and colliders

you can find more info at RigidBodyWrapper

rotationWorld

readonly

Quaternion

the rotation in world space

scaleWorld

readonly

Vector3

the scale in world space

tag

readonly

string

Returns the group identifier for this component

Methods

Method

Modifiers

Description

_onCreateCollisionMesh()

protected

destroy()

Destroy this component

dispose()

protected

duplicate(opts)

Duplicate this component

Returns a promise that resolves with the duplicated component

getBBox(target)

Returns the bounding box of this component

getBehavior(type)

getBehaviors(type)

getDimensions(target)

Returns the dimensions of this component

init()

protected

isDescendantOf(component)

Returns true if this component is a dierct or indirect child of the provided component

off(event, listener)

on(event, listener)

onCollisionEnter(cb)

Event fired when this component starts colliding with another component

onCollisionExit(cb)

Event fired when this component stops colliding with another component

onCollisionStay(cb)

This event is fired each frame between the start and end of a collision

onSensorEnter(cb)

Event fired when this component starts intersecting a sensor

onSensorExit(cb)

Event fired when this component stops intersecting a sensor

onSensorStay(cb)

This event is fired each frame between the start and end of a sensor intersection