物理引擎中的 SIMD 碰撞检测优化实践
Box2D 作者详解在 Box3D 物理引擎中通过“宽 SIMD”优化复杂凸包碰撞检测的性能提升。针对 SAT 算法中边缘-边缘测试的二次复杂度问题,利用 SoA 数据布局并行处理多个边缘对。 实测数据显示,在 AMD 7950X 上,SSE2 使整体模拟速度翻倍,AVX2 进一步优化。该优化主要惠及高复杂度模型(如破坏效果),对简单方块碰撞影响微弱。
Box2D 物理引擎历年技术出版物与演讲资料汇总
Box2D 官方整理的历年 GDC 演讲幻灯片及相关技术文档链接。 涵盖碰撞检测、约束求解、软体动力学等底层算法实现细节。
Box2D 推出全新录制回放系统,精准复现物理引擎 Bug
Box2D 作者开发了一套新的录制与回放系统,旨在解决开源物理引擎调试难题。 旧版导出方式无法包含内部状态和查询,新版通过二进制录制完整模拟过程,支持精确复现 Bug。 该系统利用 Box2D 的确定性设计和面向数据架构,实现了高效的快照与回滚功能。作者还分享了关于回调处理、跨平台一致性等技术细节,并预告了 v3.2 版本的进展。
Announcing Box3D :: Box2D
I’m happy to announce the release of Box3D, an open source 3D physics engine. It is now available on GitHub. Box3D repository You can think of Box3D as a fork of Box2D, extended with many features nee...
Box2D 3.1 Released
Version 3.0 was released about 8 months ago. It was a huge update and it needed some refinement. Version 3.1 addresses most of the bugs and build problems. It also introduces some new features and ref...
Dynamic Tree Improvements
Dynamic Tree Insertion Dynamic tree insertion can be expensive if you try to optimize for some metric such as the surface area heuristic (SAH). The SAH tries find a node configuration that minimizes t...
Determinism
Determinism means many things when it comes to game development and especially physics engines. Generally in game development we like things to be repeatable. This makes debugging easier. This doesn’t...
SIMD Matters: Graph Coloring
SIMD in game development Often in game development we talk about SIMD. It is the holy grail of CPU performance, often out of reach. The conventional wisdom is that it is difficult to achieve real gain...
Box2D 3.0 Released
Over 18 months ago I announced that I was working on Box2D version 3.0 (v3 for short). And it has finally arrived! It has been a long journey and I’ve learned a lot. There is more work to do, but the ...
Solver2D: Box2D
I was recently testing the Box2D version 3.0 alpha and found a stability problem. I found a fix for the problem fairly quickly, however the experience left me thinking about the progression of v3.0 an...
Simulation Islands
Island management is a fundamental low level feature of physics engines and can have a big impact on solver design and performance. This was one of the first problems I decided to work on for Box2D ve...
Starting Box2D 3.0
Over the holidays I started working on version 3.0 of Box2D. I started closing out some issues for v2.4 and then moved onto a backlog task: speculative collision. Speculative collision is a technique ...
Ghost Collisions
Dealing with ghost collisions is a challenging problem in game physics. The basic idea comes from motion across a flat surface. You may have several shapes joined together to make a flat surface, like...
Stuck Inside
There a several computational geometry algorithms that are relevant for preparing collision data: convex hull, mesh simplification, and convex decomposition. Many implementations of these algorithms a...
Predictive Joint Limits
Box2D has support for continuous collision. This solves the problem of fast moving objects passing through each other due to discrete time steps. The Box2D continuous collision algorithm uses a time o...
How to Transform a Plane
Suppose you have a plane equation in local space and you’d like to express that plane equation in world space. The plane in local space is written as: $P:= (n, w)$where (n) is the plane normal and (...
Box2D Subreddit
I’m now a moderator on the Box2D subreddit. So I think this makes it the official! r/box2d I look forward to seeing Box2D discussion on reddit.
Box2D Discord Server
Hi All! I created a Box2D server on Discord. Discord On a related note, I’m considering locking the forums because I’d rather spend my limited free time working on Box2D than maintaining the forums. I...
Troublesome Triangle
I ran into a problem computing a polygon normal using Newell’s method as described in Christer Ericson’s excellent book Real-Time Collision Detection. In this case the polygon happens to a be a triang...