CollisionComponent

@MainThread
class CollisionComponent : Component

A Component responsible for managing collision settings and operations, including collision detection and response.

This component is essential for enabling physics effects such as forces, motion, and interactions between objects. Attach this component to entities to integrate physics-based behavior into your application.

Note: The collision detection system operates with a precision of 0.001 meters (1 millimeter). When the distance between the surfaces of two colliders is less than this threshold, the colliders are considered to be in contact.

Constructors

Link copied to clipboard
constructor(collisionShape: List<ShapeResource>, physicsMaterial: PhysicsMaterialResource, collisionResponseMode: CollisionResponseMode = COLLIDER_FULL, collisionFilter: CollisionFilter = CollisionFilter.COLLISION_FILTER_DEFAULT, collisionInfoDetailLevel: CollisionInfoDetailLevel = CollisionInfoDetailLevel.BRIEF)

Creates a new CollisionComponent instance.

Properties

Link copied to clipboard

The CollisionFilter of the CollisionComponent. The CollisionFilter is used to group and classify entities into different collision groups. Default value is CollisionFilter.COLLISION_FILTER_DEFAULT.

Link copied to clipboard

Represents the geometric shape of an object used for collision detection in physics simulations. This shape is a collection of ShapeResources, which is fundamental for determining whether two objects intersect or collide in a virtual environment.

Functions

Link copied to clipboard
open override fun clone(): Component

Creates and returns a copy of this Component instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String