Skip to content

Functionality beyond ODE

Tilmann edited this page May 19, 2023 · 6 revisions

Introduction

ode4j contains some functionality that is not present in the original ODE.

Ragdolls

ode4j has generic support for rag dolls (or any other entities made of multiple bodies connected with joints). The patch adds a new type of joint - DxJointConstrainedBall, it is an extension to the regular ball and socket joint and additionally provides a way to constrain the movement as described at http://www.monsterden.net/software/ragdoll-pyode-tutorial. It is useful to implement more realistic shoulders of a human rag doll for instance. DxRagdoll class builds the actual rag doll based on the given list of "bones" and "joints". Additionally it provides a simple autoDisable method that can be used to freeze the whole rag doll when the movement of the bodies is minimal. Usually rag doll bodies tend to oscillate due to the high number of hard constraints and disabling only some of them does not work. Additionally, there is a demo with an example of a humanoid rag doll based on the tutorial mentioned above. The demo is extremely simple, you can only press space to apply some force.

Heightfields with holes

ode4j enhances the functionality of the gimpact-based heightfield geom by adding simple support for holes and multiple layers. There is a corresponding demo showing 2 overlapping heightfields that look somewhat like a Swiss cheese. Moving bodies can fall through the holes and roll on both heightfields. The functionality is not very interesting on its own, but it allows to build complex environments including tunnels or caves (e.g. a pipe-like trimesh combined with a heightfield with 2 holes at the end of the tunnel) The code purposely enforces the rectangular shape of the holes to make it compatible with most of the rendering techniques. In order to keep the heightfield data API intact NaN value was chosen to denote a hole.

SAP Space 2

This is essentially the same as SAP Space but with a crucial improvement: It is possible to specify a mask for marking bodies as 'immobile' (such as houses or walls in a 3D game). These objects are not tested for collision. For large gaming areas this can considerably improve performance because many or even most of the collisions do not need to be calculated even if the objects touch or even intersect.

BVH Space

Release 0.4.0 contains a new BVH Space (ported from the Turbulenz Engine project) that may often scale better than SAPSpace or SAPSpace2 when handling large numbers of objects, see here.