An Extensible Plugin for Integrating High-Performance Collision Detection Broad-Phase Algorithms into Unity

  • Raul Costa Feitosa Unifor
  • Maria Andréia Formico Rodrigues Unifor

Resumo


This paper presents a plugin architecture for Unity to integrate and benchmark broad-phase collision detection algorithms. The solution connects high-performance C++ algorithms to Unity’s C# environment via an external dynamic-link library, allowing developers to test and compare different methods in interactive scenarios. We evaluated three integrated algorithms (Brute Force, Tracy, and KDTree) in tests with up to 1600 objects (uniform and assorted) across ten distinct simulation configurations, assessing both algorithmic performance and the integration bridge’s efficiency. Results show a stable architecture, validating the use of C++ DLLs for intensive tasks in Unity and providing a modular framework to extend its native physics capabilities.

Referências

Coumans, E. (2018). Bullet physics library 2.88. [link].

Ericson, C. (2005). Real-Time Collision Detection. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.

Gomez, M. (2021). A quick-and-dirty guide to building a collision detection system. Game Developer. Accessed: July 12, 2025.

Joiner, D. (2019). DLLs and Unity. [link].

Lewerentz, A. t. (2023). Integrating Julia Code into the Unity Game Engine to Dive into Aquatic Plant Growth. In 3rd Int. Conference on Interactive Media, Smart Sys. and Emerging Technologies, pages 97–100. The Eurographics Association.

Liu, F., Harada, T., Lee, Y., and Kim, Y. (2010). Real-time Collision Culling of a Million Bodies on Graphics Processing Units. ACM ToG, 29:154.

Lo, S.-H., Lee, C.-R., Chung, I.-H., and Chung, Y.-C. (2013). Optimizing Pairwise Box Intersection Checking on GPUs for Large-Scale Simulations. ACM Transactions on Modeling and Computer Simulation (TOMACS), 23.

NVIDIA (2019). Physx 4.1. [link].

Samet, H. (1990). The Design and Analysis of Spatial Data Structures. Addison-Wesley Longman Publishing Co., Inc., USA.

Serpa, Y. R. and Rodrigues, M. A. F. (2019a). Broadmark. [link].

Serpa, Y. R. and Rodrigues, M. A. F. (2019b). Flexible use of temporal and spatial reasoning for fast and scalable CPU broad-phase collision detection using KD-Trees. 38(1):260–273. [link].

Tarigan, N. P., Darmawan, I., and Nasution, M. N. N. (2024). Implementation of Enhanced Axis Aligned Bounding Box for Object Collision Detection in Distributed Virtual Environment. ResearchGate Preprint.

Terdiman, P. (2017). Physics engine evaluation lab (peel). [link].

Tracy, D. and Brown, S. (2012). Accelerating physics in large, continuous virtual environments. Concurrency and Computation: Practice and Experience, 24:125–134.

Tracy, D., Buss, S., and Woods, B. (2009). Efficient Large-Scale Sweep and Prune Methods with AABB Insertion and Removal. IEEE VR, pages 191–198.

Unity Technologies (2024). Physics in Unity. [link].

van den Bergen, G. (2003). Collision Detection in Interactive 3D Environments. Morgan Kaufmann, San Francisco, CA, USA.
Publicado
23/09/2025
FEITOSA, Raul Costa; RODRIGUES, Maria Andréia Formico. An Extensible Plugin for Integrating High-Performance Collision Detection Broad-Phase Algorithms into Unity. In: WORKSHOP SOBRE ENGENHARIA DE SOFTWARE PARA DESENVOLVIMENTO DE JOGOS (SE4GAMES), 1. , 2025, Recife/PE. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2025 . p. 41-48. DOI: https://doi.org/10.5753/se4games.2025.14883.