

Welcome to part two of my developer diary. This time I will talk about the physics engine we utilize for Black Prophecy.
Have a good read!
The physics engine offers the possibility to define and create instances of the previously mentioned objects within a "physics world". The "physics world" itself has also to be considered an object. The "update" function is called repeatedly on this object with a certain, fixed delta time. In the course of processing this function call, several different things happen in a specific order.
As a result of each „update" function call, all included rigid bodies can have altered data with regards to position, orientation, linear and rotation velocity. Within the game this data is used to update render geometries in their position and orientation. The game logic can deduce further actions, respectively consequences, due to the data alteration. The repeated call of the "update" function is often called "physics loop".
The individual processing steps within the "update" function are divided into:
I will now briefly elaborate these individual phases and their relevance for the game.
As its name implies, collision detection is about the detection of collisions of individual geometries among each other. During collision detection, a distinction is made between two or more phases. Firstly, the so-called broad phase in which potential collision pairs are identified based on highly simplified geometry. Secondly, the contact calculation or narrow phase in which the exact contact data between individual, previously identified, geometry pairs is calculated. This phase is much more complex than the broad phase. Hereby the kind and complexity of the collision geometry play an essential role.
At the end of this phase, data is available which is not just utilized for the physics simulation but also for the event generation. By analyzing the contact data, collision particle effects or collision sounds can be generated for example.
PAGE 1 - PAGE 2 >>