Open Source Platform
for interconnected virtual worlds

NG Design Document/Viewer Architecture/Physics

From Rex community wiki

Contents

Background

At the moment physics in Opensimulator is performed primarily by the server. There are some things that the client does that have some relation to physics, specifically the motion interpolation of the avatars and world objects. In addition, there are visual effects implemented by some clients that are often colloquially thought of as physics-related. However, the really important observation is that presently only the server is able to initiate a collision, and cause objects (avatars or prims) to change behavior due to such collisions.

Physics are implemented in the viewer as a plugin. This plugin and the World Logic module determine which objects in the world use client-side physics.


Features

  • Almost any kind of client-side physics simulation requires that collision data is also available on the client. This collision data includes any collision models used in the objects, data about avatars and the terrain.
  • More responsiveness for avatar movement and reduced lag. When avatar movement is done on the client, avatar starts moving immediately instead of waiting for the movement packet to come from the server. Also when colliding with a wall avatar won't go through the wall first (because client is interpolating the movement) and then appear suddenly in front of the wall because the movement packet has come from the server which has the result movement of the collision with the wall. This feature requires that collision data is also on the client.
  • Using client-side physics on avatars and objects means changing the server behaviour. Server must know that it isn't completely authorative anymore on the position of certain objects.
  • More heavy physics simulations which don't need to be replicated to all clients can be run.
  • Client can have a more realistic representation of the avatar's physics model than just a simple cylinder or box. This enables things like positioning avatar's feet correctly on the ground or objects she is standing on instead of having the feet in the air.

Considered libraries

The following physics engines are both open source physics engines which have been used also on commercial products, thus validating their maturity.

  • Bullet physics [1]
  • Open Dynamics Engine (ODE) [2]

References

  1. Bullet physics
    (http://www.bulletphysics.com)
  2. Open Dynamics Engine
    (http://www.ode.org)