Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 220.127.116.11 (18.104.22.16803)
public class Simulation
Public Class Simulation
public ref class Simulation
The RigidBodies, Constraints and ForceEffects. All RigidBody, Constraint, and ForceEffect objects need to be added to these collections. All objects in these collections take part in the simulation. Object that are not added to these collections are not simulated.owns collections of
Advancing the Simulation: To advance the simulation Update(TimeSpan) must be called with the time span by which the simulation time should advance. In Update(TimeSpan) the simulation computes forces and moves the objects to new positions. One step of the simulation is called a "time step". In some cases the simulation will internally subdivide a time step into "sub time steps" or "internal time steps". In most games the Update(TimeSpan) will be called with 1/60 s (60 frames per second) and the simulation will make exactly one time step. See TimingSettings for more information regarding timing.
Collision Detection: The CollisionDomain. Each RigidBody has a CollisionObject that represents the collision information of the body and is put into the collision domain. You are free to use the CollisionDomain to perform collision queries (e.g. GetContacts(CollisionObject)). You can also add custom CollisionObjects to the collision domain. For example, you can add a collision object to check if rigid bodies or other collision objects enter a certain area.owns a
The collision filter of the CollisionDetection is set to an instance of type CollisionFilter. The filter rules in the CollisionFilter can freely be changed as required by the application. The whole filter can be replaced too, but the new filter should implement the interface ICollisionFilter. If the new collision filter does not implement ICollisionFilter, then automatic collision filtering for constraints does not work (see property CollisionEnabled). Advanced physics modules like ragdoll physics and vehicle physics might also need a collision filter that implements ICollisionFilter.
The "World" Rigid Body: The simulation owns one special rigid body that represents the "world" of the simulation: World. This rigid body is not contained in the RigidBodies collection and other bodies do not collide with this body. This body is only used to define the space in which the simulation takes place. Rigid bodies that leave the space of this rigid body are automatically removed from the simulation. Per default the Shape of the World body is a box that is 20,000 units long and centered at the world space origin. - If object leave this area, they should be removed. A typical scenario is that an explosion shoots objects into nirvana. When they leave the 20,000 units area, they are removed to safe simulation time. You can adjust the Shape of the world body to the size of the level or the "area of interest".
The second function of the World body is to act as an anchor for Constraints. All constraints are two-body constraints and, for example, if you want to fix a rigid body at a certain position in world space you create a constraint between the rigid body and the world body as the other body.