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

PropertyModifiersTypeDescription
childComponentsreadonlyComponent3D[]
colliderColliderCollider for this component, it encapsulates some convenience methods for physics And gives access to the underlying physics rigidbody and collider
componentIdreadonlystringReturns the unique id for this component
componentNamereadonlystringReturns the name of this component (if set in data.name)
componentTypereadonlyunknownReturns the type of this component (avatar, model, etc)
dataDataData used to create this component
identifierreadonlystringReturns the unique identifier for this component
optsprotectedComponentOpts
rigidBodyRigidBodyWrapper

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

tagreadonlystringReturns the group identifier for this component

Methods

MethodModifiersDescription
destroy()Destroy this component
duplicate()

Duplicate this component

Returns a promise that resolves with the duplicated component

getBBox(target)Returns the bounding box of this component
getDimensions(target)Returns the dimensions of this 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