Module technology.sola.engine
Interface CollisionDetectionBroadPhase
- All Known Implementing Classes:
QuadTreeCollisionDetectionBroadPhase
,SkipCollisionDetectionBroadPhase
,SpatialHashMapCollisionDetectionBroadPhase
@NullMarked
public interface CollisionDetectionBroadPhase
CollisionDetectionBroadPhase defines the contract for a broad phase collision detection algorithm to be used by
CollisionDetectionSystem
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
populate
(Collection<technology.sola.ecs.view.View2Entry<ColliderComponent, TransformComponent>> views) Populates the underlying data structure from the list of collidable entities.Collection<technology.sola.ecs.view.View2Entry<ColliderComponent,
TransformComponent>> query
(technology.sola.ecs.view.View2Entry<ColliderComponent, TransformComponent> searchEntry) Searches for collidable entities that are near the search entity.void
renderDebug
(Renderer renderer, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Renders debug information about this broad phase algorithm.
-
Method Details
-
populate
void populate(Collection<technology.sola.ecs.view.View2Entry<ColliderComponent, TransformComponent>> views) Populates the underlying data structure from the list of collidable entities.- Parameters:
views
- the list of collidable entities
-
query
Collection<technology.sola.ecs.view.View2Entry<ColliderComponent,TransformComponent>> query(technology.sola.ecs.view.View2Entry<ColliderComponent, TransformComponent> searchEntry) Searches for collidable entities that are near the search entity.- Parameters:
searchEntry
- the entity to search for possible collisions for- Returns:
- the list of nearby collidable entities
-
renderDebug
void renderDebug(Renderer renderer, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Renders debug information about this broad phase algorithm.- Parameters:
renderer
- theRenderer
cameraScaleTransform
- the camera's scale transform matrixcameraTranslationTransform
- the camera's translation transform matrix
-