CollisionComponent
CollisionComponent
Native collision component
Provides access to a native collision component instance
Kind: global class
.collider ⇒ Collider
Kind: instance property of CollisionComponent
Returns: Collider - Collision component collider
.collider
Set collision component collider
Kind: instance property of CollisionComponent
Param | Type | Description |
---|---|---|
collider | Collider | Collider of the collision component. |
.extents ⇒ Array.<number>
If collider returns Sphere, only the first component of the returned vector is used.
Kind: instance property of CollisionComponent
Returns: Array.<number> - Collision component extents
.extents
Set collision component extents
If collider returns Sphere, only the first component of the passed vector is used.
Kind: instance property of CollisionComponent
Param | Type | Description |
---|---|---|
extents | Array.<number> | Extents of the collision component, expects a 3 component array. |
.group ⇒ number
The groups is a bitmask that is compared to other components in queryOverlaps or the group in rayCast.
Colliders that have no common groups will not overlap with each other. If a collider has none of the groups set for rayCast, the ray will not hit it.
Each bit represents belonging to a group, see example.
Kind: instance property of CollisionComponent
Returns: number - collision component group
Example
.group
Set collision component group
Kind: instance property of CollisionComponent
Param | Type | Description |
---|---|---|
group | number | Group mask of the collision component |
.queryOverlaps () ⇒ Array.<CollisionComponent>
Query overlapping objects
Kind: instance method of CollisionComponent
Returns: Array.<CollisionComponent> - Collision components overlapping this collider.