Description
There are generally two classes of physicsScientific engines
One of the first general purpose computers,Game engines
In most computer games, speed of the processors and gameplay are more important than accuracy of simulation. This leads to designs for physics engines that produce results in real-time but that replicate real world physics only for simple cases and typically with some approximation. More often than not, the simulation is geared towards providing a "perceptually correct" approximation rather than a real simulation. However some game engines, such as Source, use physics in puzzles or in combat situations. This requires more accurate physics so that, for example, the momentum of an object can knock over an obstacle or lift a sinking object. Physically-based character animation in the past only used rigid body dynamics because they are faster and easier to calculate, but modern games and movies are starting to use soft body physics. Soft body physics are also used for particle effects, liquids and cloth. Some form of limitedCollision detection
Objects in games interact with the player, the environment, and each other. Typically, most 3D objects in games are represented by two separate meshes or shapes. One of these meshes is the highly complex and detailed shape visible to the player in the game, such as a vase with elegant curved and looping handles. For purpose of speed, a second, simplified invisible mesh is used to represent the object to the physics engine so that the physics engine treats the example vase as a simple cylinder. It would thus be impossible to insert a rod or fire a projectile through the handle holes on the vase, because the physics engine model is based on the cylinder and is unaware of the handles. The simplified mesh used for physics processing is often referred to as the collision geometry. This may be a bounding box, sphere, or convex hull. Engines that use bounding boxes or bounding spheres as the final shape for collision detection are considered extremely simple. Generally a bounding box is used for broad phase collision detection to narrow down the number of possible collisions before costly mesh on mesh collision detection is done in the narrow phase of collision detection. Another aspect of precision in discrete collision detection involves the framerate, or the number of moments in time per second when physics is calculated. Each frame is treated as separate from all other frames, and the space between frames is not calculated. A low framerate and a small fast-moving object causes a situation where the object does not move smoothly through space but instead seems to teleport from one point in space to the next as each frame is calculated. Projectiles moving at sufficiently high speeds will miss targets, if the target is small enough to fit in the gap between the calculated frames of the fast moving projectile. Various techniques are used to overcome this flaw, such as '' Second Life''s representation of projectiles as arrows with invisible trailing tails longer than the gap in frames to collide with any object that might fit between the calculated frames. By contrast, continuous collision detection such as in Bullet or Havok does not suffer this problem.Soft-body dynamics
An alternative to using bounding box-based rigid body physics systems is to use a finite element-based system. In such a system, a 3-dimensional, volumetric tessellation is created of the 3D object. The tessellation results in a number of finite elements which represent aspects of the object's physical properties such as toughness, plasticity, and volume preservation. Once constructed, the finite elements are used by a solver to model the stress within the 3D object. The stress can be used to drive fracture, deformation and other physical effects with a high degree of realism and uniqueness. As the number of modeled elements is increased, the engine's ability to model physical behavior increases. The visual representation of the 3D object is altered by the finite element system through the use of a deformation shader run on the CPU or GPU. Finite Element-based systems had been impractical for use in games due to the performance overhead and the lack of tools to create finite element representations out of 3D art objects. With higher performance processors and tools to rapidly create the volumetric tessellations, real-time finite element systems began to be used in games, beginning with '' Star Wars: The Force Unleashed'' that used Digital Molecular Matter for the deformation and destruction effects of wood, steel, flesh and plants using an algorithm developed by Dr. James O'Brien as a part of his PhD thesis.Brownian motion
In the real world, physics is always active. There is a constant Brownian motion jitter to all particles in our universe as the forces push back and forth against each other. For a game physics engine, such constant active precision is unnecessarily wasting the limited CPU power, which can cause problems such as decreased framerate. Thus, games may put objects to "sleep" by disabling the computation of physics on objects that have not moved a particular distance within a certain amount of time. For example, in the 3DParadigms
Physics engines for video games typically have two core components, a collision detection/ collision response system, and the dynamics simulation component responsible for solving the forces affecting the simulated objects. Modern physics engines may also contain fluid simulations, animation control systems and asset integration tools. There are three major paradigms for the physical simulation of solids: * Penalty methods, where interactions are commonly modelled as mass-spring systems. This type of engine is popular for deformable, or soft-body physics. * Constraint based methods, where constraint equations are solved that estimate physical laws. * Impulse based methods, where impulses are applied to object interactions. However, this is actually just a special case of a constraint based method combined with an iterative solver that propagates impulses throughout the system. Finally, hybrid methods are possible that combine aspects of the above paradigms.Limitations
A primary limit of physics engine realism is the approximated result of the constraint resolutions and collision result due to the slow convergence of algorithms. Collision detection computed at a too low frequency can result in objects passing through each other and then being repelled with an abnormal correction force. On the other hand, approximated results of reaction force is due to the slow convergence of typical Projected Gauss Seidel solver resulting in abnormal bouncing. Any type of free-moving compound physics object can demonstrate this problem, but it is especially prone to affecting chain links under high tension, and wheeled objects with actively physical bearing surfaces. Higher precision reduces the positional/force errors, but at the cost of needing greater CPU power for the calculations.Physics processing unit (PPU)
A physics processing unit (PPU) is a dedicated microprocessor designed to handle the calculations of physics, especially in the physics engine ofGeneral-purpose computing on graphics processing unit (GPGPU)
Hardware acceleration for physics processing is now usually provided by graphics processing units that support more general computation, a concept known as general-purpose computing on graphics processing units (GPGPU). AMD and NVIDIA provide support for rigid body dynamics computations on their latest graphics cards. NVIDIA's GeForce 8 series supports a GPU-based Newtonian physics acceleration technology named ''Quantum Effects Technology''. NVIDIA provides an SDK Toolkit for CUDA ( Compute Unified Device Architecture) technology that offers both a low and high-level API to the GPU. For their GPUs, AMD offers a similar SDK, called Close to Metal (CTM), which provides a thin hardware interface. PhysX is an example of a physics engine that can use GPGPU based hardware acceleration when it is available.Engines
Real-time physics engines
;Open source * Advanced Simulation Library - open source hardware accelerated multiphysics simulation software * Box2D * Bullet * Chipmunk physics engine - 2D physics engine *Jolt Physics - Horizon Forbidden West physics engine * Newton Game Dynamics * Open Dynamics Engine * PAL (Physics Abstraction Layer) - A uniform API that supports multiple physics engines * PhysX * Project Chrono - An open source simulation engine for multi-physics applications. *RapierHigh precision physics engines
* VisSim - Visual Simulation engine for linear and nonlinear dynamicsSee also
* Game physics * Ragdoll physics * Procedural animation * Rigid body dynamics * Soft body dynamics * Physics processing unit * Cell microprocessor * Linear complementarity problem Impulse/constraint physics engines require a solver for such problems to handle multi-point collisions. * Finite Element AnalysisReferences
Further reading
* Bourg, David M. (2002)External links
* {{DEFAULTSORT:Physics Engine Computer graphics Video game development Articles containing video clips