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 |
---|---|---|---|
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 | Data | Data used to create this component | |
identifier | readonly | string | Returns the unique identifier for this component |
opts | protected | ComponentOpts | |
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 | |
tag | readonly | string | Returns the group identifier for this component |
Methods
Method | Modifiers | Description |
---|---|---|
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 |