Physics Engine Feature Requirements:
- High-functioning collision detection. We don’t want the angles to get “clipped” or intersect with each other in the final image.
- Natural Collision Response. Bernar insisted the angles should fall and rest like they would in real life. Once achieved, we can push these limits.
- Debugging functionality so we can visualize the code and make necessary adjustments.
- Lightweight and concise code base, ensuring deployment to the Ethereum blockchain is reasonable.
We saw some interesting outcomes in our engine, though in being thorough, we also tested and benchmarked our engine against established lightweight open-source physics libraries, including Oimo.js and CANNON-ES.
CANNON-ES has a comprehensive collision detection and response system and an API that allows us to custom-fit a physics body around non-standard geometries, such as our dynamic angle. This allows us to prevent angles from interfering with fairly high confidence.
It also has debugging and visualization systems that made fitting our dynamic angle to a natural physics body and testing the compositions possible. This would ultimately be critical in fine-tuning the compositions and ensuring the collision detection and response worked at a high standard of quality.
In January, based on the research and experimentation results, and being mindful of the project timeline, it was decided CANNON-ES was the way to go, and would allow the work of integrating and building out the physics-based compositions to begin.