CollisionComponent
Native collision component.
Provides access to a native collision component instance.
.TypeName: string
.collider: Collider
Collision component collider
.collider
Set collision component collider.
.extents: Float32Array
Collision component extents.
If collider returns Sphere, only the first component of the returned vector is used.
.extents
Set collision component extents.
If collider returns Sphere, only the first component of the passed vector is used.
Example:
.group: number
Collision component group.
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.
.group
Set collision component group.
.radius: number
Get collision component radius.
Note: If collider is not Sphere, the returned value corresponds to the radius of a sphere enclosing the shape.
Example:
.radius
Set collision component radius.
Note: If collider is not Sphere, the extents are set to form a square that fits a sphere with the provided radius.
Example:
.queryOverlaps() ⇒ CollisionComponent[]
Query overlapping objects.
Usage:
Returns: Collision components overlapping this collider.