generateCollisionShapes(recursive:)
Creates the shape used to detect collisions between two entities that have collision components.
Declaration
@MainActor @preconcurrency func generateCollisionShapes(recursive: Bool)Parameters
- recursive:
A Boolean that you set to
trueto also generate the collision shapes for all descendants of the entity.
Mentioned in
Discussion
Call this method on entities that have a mesh to prepare a shape used for collision detection. The method stores the shape in the entity’s CollisionComponent instance.
This method has no effect for entities without a mesh. Nevertheless, the method is defined for all entities so that you can call it on any entity, and have the calculation propagate recursively to all that entity’s descendants.