Physics

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Flesh out this important but empty article: OpenSim resolves against the ground only by default. Role of physics engine vs simulator db engine. Importance of gravity and the surface patch in realism.)
(more about how collisions work. objects causing continuous high resolver load can be defensively turned phantom by some physics engines)
Line 13: Line 13:
 
It is technically possible to connect to a simulator without a physics engine, but the avatars would appear to float in space without gravity and can pass through any object including other avatars, and move in any direction to the coordinate limits of the simulated space.
 
It is technically possible to connect to a simulator without a physics engine, but the avatars would appear to float in space without gravity and can pass through any object including other avatars, and move in any direction to the coordinate limits of the simulated space.
  
== Gravity and the ground ==
 
 
The primary task of the physics engine is to move objects affected by forces and to resolve collisions. Collisions occur when two physical objects collide or are simply touching each other.
 
The primary task of the physics engine is to move objects affected by forces and to resolve collisions. Collisions occur when two physical objects collide or are simply touching each other.
 +
 +
Most objects in the simulator are pinned in space and do not move. They do not normally require any physics processing time.  However, when a physical moving object collides with a pinned object, the pinned object is temporarily treated as if it were physical and collisions are calculated against it. Since it cannot move, the only resolving forces are applied to the movable object.
 +
 +
In certain unresolvable situations (described below) a physical moving object causing continuous high simulator load may be defensively changed by the simulator into a nonphysical or phantom object, so that the simulator does not become stuck in a continuous high-load state.
 +
 +
== Gravity and the ground ==
  
 
The single biggest force in the simulator is gravity, which causes physical objects to move downward (Z axis in the 3D coordinate system), typically following Earth-based experience of accelerating to a terminal falling velocity of 9.81 meters per second.
 
The single biggest force in the simulator is gravity, which causes physical objects to move downward (Z axis in the 3D coordinate system), typically following Earth-based experience of accelerating to a terminal falling velocity of 9.81 meters per second.

Revision as of 00:50, 4 April 2010


By default, Open Simulator uses an extremely simple physics engine which only allows you to stand on the ground. All objects using the basic physics engine appear to be phantom, and the only way to make them act as solids is to use some other more sophisticated physics engine, such as the Open Dynamics Engine.

Note that physics processing is one of the biggest sources of region simulator lag. If you use a better engine to make objects appear to be solid, you will most likely want to isolate the region simulator and physics engine on its own physical hardware so that lag in the physics engine does not also slow down your asset and inventory servers.

The role of the physics engine

One of the primary functions of the simulator is to provide an experience that approximates real life. This typically requires making the objects in the 3D world appear to be solid and real.

As far as the simulator database engine is concerned, it simply knows the positions of objects in the simulated 3D space and knows the references to textures for each surface of the objects. The database engine does not know anything about gravity, pushes, or collisions.

It is technically possible to connect to a simulator without a physics engine, but the avatars would appear to float in space without gravity and can pass through any object including other avatars, and move in any direction to the coordinate limits of the simulated space.

The primary task of the physics engine is to move objects affected by forces and to resolve collisions. Collisions occur when two physical objects collide or are simply touching each other.

Most objects in the simulator are pinned in space and do not move. They do not normally require any physics processing time. However, when a physical moving object collides with a pinned object, the pinned object is temporarily treated as if it were physical and collisions are calculated against it. Since it cannot move, the only resolving forces are applied to the movable object.

In certain unresolvable situations (described below) a physical moving object causing continuous high simulator load may be defensively changed by the simulator into a nonphysical or phantom object, so that the simulator does not become stuck in a continuous high-load state.

Gravity and the ground

The single biggest force in the simulator is gravity, which causes physical objects to move downward (Z axis in the 3D coordinate system), typically following Earth-based experience of accelerating to a terminal falling velocity of 9.81 meters per second.

There is also a deformable plane surface in each sim which is the lowest point any object can descend. We call this the ground or the surface patch. If the ground did not exist, physical objects in the simulator would simply fall to the lowest possible Z axis coordinate value of zero and simply stop, apparantly suspended above/in nothingness. This is outside our normal experience so we have the ground in the simulator to make the simulated world seem more like real life.

When objects affected by gravity collide with the ground in the simulator, the physics engine resolves the collision by pushing back on the colliding object, causing it to rise up out of the ground against the force of gravity. If the forces are treated as springs, and the object is elastic while the ground is hard and resilient, the simulator can apply an opposite upward force equal to the downward force to cause a fast moving object to "bounce" upward again.

As mentioned above, the default basic physics engine included with Open Simulator only resolves collisions with the ground, and makes no attempt to make object primitives appear to be solid. As a result, a basic install of Open Simulator will tend to have a mostly flat world layout following the ground surface because that is the only place where people can walk around in a realistic looking manner. Walking around in the second floor of a house made from primitives suspended in midair above the ground for example is not possible.

Personal tools
General
About This Wiki