Bodies

MV3D uses Bodies to hold on to visual and physical characteristics. There are several types of bodies including StationaryBody and MobileBody. Bodies are shared between servers and between the server and the client.

For bodies that can move such as Mobile Bodies and Biped Bodies, their iterate function is called every tick when they are active. It is important to only enable the bodies when absolutely necessary as it consumes server CPU.

Stationary Bodiess

StationaryBodys are for objects in the world that don't normally move. While it is possible to move a Stationary Body, it's not necessarily efficient, and they can not be animated. Also any MobileBody that collides with one will act as if colliding with an immobile object. Stationary Bodies have colliders and also a representation. The representationID is an asset ID that points to something which can be loaded as a representation. This includes models and rxml files.

Mobile Bodies

MobileBodys can move and respond to interactions with other bodies. Mobile Bodies have a linear and angular velocity. Similar to StationaryBodys, they can have colliders or a representation. Mobile Bodies are actually simulated on both the server and the client. This way while the server is in control of them, the client is able to display their movement as being smooth.

Biped Bodies

BipedBodys are used solely for players. They are generally too heavy weight to be used for NPCs. They simulate a bipedal creature by suspending a capsule collider which is attached by a joint to their head. Under the capsule, a series of raycasts are made to hit the ground. This is how the capsule is suspended in the air. At present, Bipeds can have a list of visual objectss, but do not yet support representations.