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 refinements. Character mover I’ve added experimental character mover support to 3.1. This uses a geometric solver. It should be useful for games that want greater control than what you get with a dynamic or kinematic body.| box2d.org
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 rule out emergent behavior though because player input can be viewed as random. Testing Determinism Determinism is a brittle feature. It is easy to break. Code changes can break it. Compiler versions can break it. So it needs to be tested using continuous integration, or CI for short.| box2d.org
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 gains from SIMD. It is tempting to build a math library around SIMD hoping to get some performance gains. However, it often has no proven benefit. It just feels good to be using something we know can improve performance.| box2d.org
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 library is ready to be used for game development. I'd like to thank the Box2D users who tested v3 during the alpha and beta. Their feedback and bug reports have been super helpful!| box2d.org
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 and how the engine has been getting more features and more complexity. There are several joint types now. There is island management, multithreading, SIMD, graph coloring, continuous collision, and so on. These are all important features, but there is a problem.| box2d.org
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 version 3 (v3). Since I began working on v3 I’ve been comparing several algorithms for island management. My goal has been to make island building scale better with multiple CPU cores. Here are the three approaches I’ve considered:| box2d.org
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 a triangle mesh in 3D or a chain of edges in 2D. Convex shapes can hit the internal connections and have their motion blocked. This is undesirable, we would rather have the convex shape move smoothly across the surface.| box2d.org
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 are developed outside the specific context of rigid body simulation. For example, qhull computes convex hulls and appears to be application agnostic. Simplygon is focused on simplifying render mesh. On the other hand, convex decomposition algorithms such as V-HACD are developed with physics simula...| box2d.org
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 of impact (TOI) collision algorithm along with time sub-stepping for the response. There are other artifacts due to discrete time steps. Joint limits can also suffer from fast movement. For example, consider a filing cabinet where the drawers use prismatic (slider) joints.| box2d.org
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 \(w\) is the plane offset. A point \(x\) is on the plane if \[n \cdot x = w\] Now define a transform \(A\) as \[ A := (R, p) \] where \(R\) is an orthonormal rotation matrix and \(p\) is a translation vector.| box2d.org
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.org
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've looked for new moderators over the last year or so unsuccessfully. Also updating phpBB and dealing with spam is not my cup of tea. In the future I'd like to see most Box2D community interactions be on GitHub and Discord, with announcements on my Twitter account.| box2d.org
I received this question on LinkedIn: I'm working on a 3d dynamic aabb tree based on the concepts of Presson's bullet contribution. I came across a bullet forum thread in which Dirk recommended looking at your box2d implementation. I noticed the major difference is that box2d is a balanced tree using a surface area heuristic while bullet's is unbalanced with manhattan distance heuristic. My guess is that keeping your tree balanced resulted in increased maintenance overhead but decreased tree ...| box2d.org
Given a normalized 3D vector, here’s an efficient method for computing a full basis. The computed basis is axis aligned if the input vector is axis aligned. void ComputeBasis(const Vec& a, Vec* b, Vec* c) { // Suppose vector a has all equal components and is a unit vector: // a = (s, s, s) // Then 3*s*s = 1, s = sqrt(1/3) = 0.57735. This means that at // least one component of a unit vector must be greater or equal // to 0.| box2d.org
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 triangle that is close to the origin. So I would guess that Newell's method would yield a great result. However, this is not true. I only get 2 digits of accuracy in single precision. Here is the triangle:| box2d.org
The best way to use SSE is to use the __m128 intrinsic directly. Unfortunately Visual Studio displays the values backwards (w,z,y,x). Bleh. Here is a change to autoexp.dat to correct the order. First comment out this line: __m128=$BUILTIN(M128) And add this line: __m128=, , ,| box2d.org
Keep in mind that a shape does not know about bodies and stand apart from the dynamics system. Shapes are stored in a compact form that is optimized for size and performance. As such, shapes are not easily moved around. You have to manually set the shape vertex positions to move a shape. However, when a shape is attached to a body using a fixture, the shapes move rigidly with the host body.| box2d.org
Box2D uses MKS (meters, kilograms, and seconds) units and radians for angles. You may have trouble working with meters because your game is expressed in terms of pixels. To deal with this in the testbed I have the whole game work in meters and just use an OpenGL viewport transformation to scale the world into screen space. float lowerX = -25.0f, upperX = 25.0f, lowerY = -5.0f, upperY = 25.0f; gluOrtho2D(lowerX, upperX, lowerY, upperY); If your game must work in pixel units then you should con...| box2d.org
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 for continuous collision that promises to remove the serial bottleneck of time of impact sub-stepping. I made good progress in my research and then I realized that this would be a major update to Box2D. And if I'm doing a major update to Box2D I might as well tackle some other big features and ma...| box2d.org