Skip to content
We are updating the documentation, some information may be outdated or incomplete

Terrain

Introduction

For vehicles to be able to move on blocks, the physics engine needs to know about the presence of blocks in specific locations. This is the role of the terrain part of DynamX. The terrain involves converting the Minecraft world (blocks, player-added slopes) into something understandable by the physics engine (only triangles). The DynamX API allows you to modify its behavior.

DynamXTerrainApi

This class provides access to two elements of the terrain:

IBlockCollisionBehavior

This interface allows you to modify the collisions of certain blocks, for example, creating speed bumps. Manipulating this requires good development skills and mathematics knowledge (for triangles). It's essential always to optimize collisions as much as possible to avoid lag. DynamX typically groups collisions from multiple blocks into a single collision box.

Everything is explained in the javadoc; it's your turn to experiment!

IPhysicsTerrainLoader

This interface allows you to load the terrain around a specific area, such as the item for slopes.