HOME

TheInfoList



OR:

A physics engine is
computer software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consist ...
that provides an approximate
simulation A simulation is the imitation of the operation of a real-world process or system over time. Simulations require the use of Conceptual model, models; the model represents the key characteristics or behaviors of the selected system or proc ...
of certain
physical system A physical system is a collection of physical objects. In physics, it is a portion of the physical universe chosen for analysis. Everything outside the system is known as the environment. The environment is ignored except for its effects on the ...
s, such as
rigid body dynamics In the physical science of dynamics, rigid-body dynamics studies the movement of systems of interconnected bodies under the action of external forces. The assumption that the bodies are ''rigid'' (i.e. they do not deform under the action of ...
(including
collision detection Collision detection is the computational problem of detecting the intersection of two or more objects. Collision detection is a classic issue of computational geometry and has applications in various computing fields, primarily in computer grap ...
),
soft body dynamics Soft-body dynamics is a field of computer graphics that focuses on visually realistic physical simulations of the motion and properties of deformable objects (or ''soft bodies''). The applications are mostly in video games and films. Unlike in si ...
, and
fluid dynamics In physics and engineering, fluid dynamics is a subdiscipline of fluid mechanics that describes the flow of fluids— liquids and gases. It has several subdisciplines, including ''aerodynamics'' (the study of air and other gases in motion) a ...
, of use in the domains of
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
,
video game Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This feedba ...
s and film ( CGI). Their main uses are in video games (typically as
middleware Middleware is a type of computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to implement ...
), in which case the simulations are in
real-time Real-time or real time describes various operations in computing or other processes that must guarantee response times within a specified time (deadline), usually a relatively short time. A real-time process is generally one that happens in defined ...
. The term is sometimes used more generally to describe any
software system A software system is a system of intercommunicating components based on software forming part of a computer system (a combination of hardware and software). It "consists of a number of separate programs, configuration files, which are used to se ...
for simulating physical phenomena, such as high-performance scientific simulation.


Description

There are generally two classes of physics
engine An engine or motor is a machine designed to convert one or more forms of energy into mechanical energy. Available energy sources include potential energy (e.g. energy of the Earth's gravitational field as exploited in hydroelectric power ...
s:
real-time Real-time or real time describes various operations in computing or other processes that must guarantee response times within a specified time (deadline), usually a relatively short time. A real-time process is generally one that happens in defined ...
and high-precision. High-precision physics engines require more processing power to calculate very
precise Precision, precise or precisely may refer to: Science, and technology, and mathematics Mathematics and computing (general) * Accuracy and precision, measurement deviation from true value and its scatter * Significant figures, the number of digit ...
physics and are usually used by scientists and computer animated movies. Real-time physics engines—as used in video games and other forms of interactive computing—use simplified calculations and decreased accuracy to compute in time for the game to respond at an appropriate rate for game play.


Scientific engines

One of the first general purpose computers,
ENIAC ENIAC (; Electronic Numerical Integrator and Computer) was the first programmable, electronic, general-purpose digital computer, completed in 1945. There were other computers that had these features, but the ENIAC had all of them in one pac ...
, was used as a very simple type of physics engine. It was used to design ballistics tables to help the United States military estimate where
artillery Artillery is a class of heavy military ranged weapons that launch munitions far beyond the range and power of infantry firearms. Early artillery development focused on the ability to breach defensive walls and fortifications during si ...
shells of various mass would land when fired at varying angles and gunpowder charges, also accounting for drift caused by wind. The results were calculated a single time only, and were tabulated into printed tables handed out to the artillery commanders. Physics engines have been commonly used on supercomputers since the 1980s to perform
computational fluid dynamics Computational fluid dynamics (CFD) is a branch of fluid mechanics that uses numerical analysis and data structures to analyze and solve problems that involve fluid flows. Computers are used to perform the calculations required to simulate ...
modeling, where particles are assigned force vectors that are combined to show circulation. Due to the requirements of speed and high precision, special computer processors known as
vector processor In computing, a vector processor or array processor is a central processing unit (CPU) that implements an instruction set where its instructions are designed to operate efficiently and effectively on large one-dimensional arrays of data calle ...
s were developed to accelerate the calculations. The techniques can be used to model weather patterns in
weather forecasting Weather forecasting is the application of science and technology to predict the conditions of the atmosphere for a given location and time. People have attempted to predict the weather informally for millennia and formally since the 19th cen ...
, wind tunnel data for designing air- and watercraft or motor vehicles including racecars, and thermal cooling of computer processors for improving
heat sink A heat sink (also commonly spelled heatsink) is a passive heat exchanger that transfers the heat generated by an electronic or a mechanical device to a fluid medium, often air or a liquid coolant, where it is dissipated away from the device, ...
s. As with many calculation-laden processes in computing, the accuracy of the simulation is related to the resolution of the simulation and the precision of the calculations; small fluctuations not modeled in the simulation can drastically change the predicted results. Tire manufacturers use physics simulations to examine how new
tire tread The tread of a tire or track refers to the rubber on its circumference that makes contact with the road or the ground. As tires are used, the tread is worn off, limiting its effectiveness in providing traction. A worn tire can often be retrea ...
types will perform under wet and dry conditions, using new tire materials of varying flexibility and under different levels of weight loading.


Game engines

In most computer games, speed of the processors and
gameplay Gameplay is the specific way in which players interact with a game, and in particular with video games. Gameplay is the pattern defined through the game rules, connection between player and the game, challenges and overcoming them, plot and pl ...
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 In the physical science of dynamics, rigid-body dynamics studies the movement of systems of interconnected bodies under the action of external forces. The assumption that the bodies are ''rigid'' (i.e. they do not deform under the action of ...
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 limited
fluid dynamics In physics and engineering, fluid dynamics is a subdiscipline of fluid mechanics that describes the flow of fluids— liquids and gases. It has several subdisciplines, including ''aerodynamics'' (the study of air and other gases in motion) a ...
simulation is sometimes provided to simulate water and other liquids as well as the flow of fire and explosions through the air.


Collision 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 In geometry, the convex hull or convex envelope or convex closure of a shape is the smallest convex set that contains it. The convex hull may be defined either as the intersection of all convex sets containing a given subset of a Euclidean space ...
. 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 Frame rate (expressed in or FPS) is the frequency (rate) at which consecutive images ( frames) are captured or displayed. The term applies equally to film and video cameras, computer graphics, and motion capture systems. Frame rate may also be ...
, 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 ''Second Life'' is an online multimedia platform that allows people to create an avatar for themselves and then interact with other users and user created content within a multi player online virtual world. Developed and owned by the San Fr ...
''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 A bullet is a kinetic projectile, a component of firearm ammunition that is shot from a gun barrel. Bullets are made of a variety of materials, such as copper, lead, steel, polymer, rubber and even wax. Bullets are made in various shapes and co ...
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 A tessellation or tiling is the covering of a surface, often a plane, using one or more geometric shapes, called ''tiles'', with no overlaps and no gaps. In mathematics, tessellation can be generalized to higher dimensions and a variety of ...
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 Brownian motion, or pedesis (from grc, πήδησις "leaping"), is the random motion of particles suspended in a medium (a liquid or a gas). This pattern of motion typically consists of random fluctuations in a particle's position insi ...
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 Frame rate (expressed in or FPS) is the frequency (rate) at which consecutive images ( frames) are captured or displayed. The term applies equally to film and video cameras, computer graphics, and motion capture systems. Frame rate may also be ...
. 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 3D
virtual world A virtual world (also called a virtual space) is a computer-simulated environment which may be populated by many users who can create a personal avatar, and simultaneously and independently explore the virtual world, participate in its activities ...
Second Life ''Second Life'' is an online multimedia platform that allows people to create an avatar for themselves and then interact with other users and user created content within a multi player online virtual world. Developed and owned by the San Fr ...
, if an object is resting on the floor and the object does not move beyond a minimal distance in about two seconds, then the physics calculations are disabled for the object and it becomes frozen in place. The object remains frozen until physics processing reactivates for the object after collision occurs with some other active physical object.


Paradigms

Physics engines for video games typically have two core components, a
collision detection Collision detection is the computational problem of detecting the intersection of two or more objects. Collision detection is a classic issue of computational geometry and has applications in various computing fields, primarily in computer grap ...
/
collision response In the context of classical mechanics simulations and physics engines employed within video games, collision response deals with models and algorithms for simulating the changes in the motion of two solid bodies following collision and other for ...
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 A control system manages, commands, directs, or regulates the behavior of other devices or systems using control loops. It can range from a single home heating controller using a thermostat controlling a domestic boiler to large industrial c ...
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. Finally, hybrid methods are possible that combine aspects of the above paradigms.


Limitations

A primary limit of physics engine
realism Realism, Realistic, or Realists may refer to: In the arts *Realism (arts), the general attempt to depict subjects truthfully in different forms of the arts Arts movements related to realism include: * Classical Realism *Literary realism, a mov ...
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 object passing through each other and then be repelled with an abnormal correction force. In 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 greater CPU power needed 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 of
video game Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This feedba ...
s. Examples of calculations involving a PPU might include
rigid body dynamics In the physical science of dynamics, rigid-body dynamics studies the movement of systems of interconnected bodies under the action of external forces. The assumption that the bodies are ''rigid'' (i.e. they do not deform under the action of ...
,
soft body dynamics Soft-body dynamics is a field of computer graphics that focuses on visually realistic physical simulations of the motion and properties of deformable objects (or ''soft bodies''). The applications are mostly in video games and films. Unlike in si ...
,
collision detection Collision detection is the computational problem of detecting the intersection of two or more objects. Collision detection is a classic issue of computational geometry and has applications in various computing fields, primarily in computer grap ...
,
fluid dynamics In physics and engineering, fluid dynamics is a subdiscipline of fluid mechanics that describes the flow of fluids— liquids and gases. It has several subdisciplines, including ''aerodynamics'' (the study of air and other gases in motion) a ...
, hair and clothing simulation,
finite element analysis The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat ...
, and fracturing of objects. The idea is that specialized processors offload time-consuming tasks from a computer's CPU, much like how a GPU performs graphics operations in the main CPU's place. The term was coined by Ageia's marketing to describe their PhysX chip to consumers. Several other technologies in the CPU-GPU spectrum have some features in common with it, although Ageia's solution was the only complete one designed, marketed, supported, and placed within a system ''exclusively'' as a PPU.


General-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 General-purpose computing on graphics processing units (GPGPU, or less often GPGP) is the use of a graphics processing unit (GPU), which typically handles computation only for computer graphics, to perform computation in applications traditiona ...
(GPGPU). AMD and
NVIDIA Nvidia CorporationOfficially written as NVIDIA and stylized in its logo as VIDIA with the lowercase "n" the same height as the uppercase "VIDIA"; formerly stylized as VIDIA with a large italicized lowercase "n" on products from the mid 1990s to ...
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 CUDA (or Compute Unified Device Architecture) is a parallel computing platform and application programming interface (API) that allows software to use certain types of graphics processing units (GPUs) for general purpose processing, an approach ...
( 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 In computing, Close To Metal ("CTM" in short, originally called ''Close-to-the-Metal'') is the name of a beta version of a low-level programming interface developed by ATI, now the AMD Graphics Product Group, aimed at enabling GPGPU computing. CTM ...
(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 A bullet is a kinetic projectile, a component of firearm ammunition that is shot from a gun barrel. Bullets are made of a variety of materials, such as copper, lead, steel, polymer, rubber and even wax. Bullets are made in various shapes and co ...
* Chipmunk physics engine - 2D physics engine * Newton Game Dynamics * Open Dynamics Engine * PAL (Physics Abstraction Layer) - A uniform API that supports multiple physics engines * PhysX *
Project Chrono Project Chrono is a physics engine developed by University of Wisconsin-Madison and University of Parma and members of its open source community. It supports simulating rigid body dynamics, rigid and soft body dynamics, collision detection, vehic ...
- An open source simulation engine for multi-physics applications. * Siconos Modeling and the simulation of mechanical systems with contact, impact and Coulomb's friction *
SOFA (Simulation Open Framework Architecture) Simulation Open Framework Architecture (SOFA) is an open source framework primarily targeted at real-time physical simulation, with an emphasis on medical simulation. It is mostly intended for the research community to help develop newer algori ...
* Tokamak physics engine ;Public domain * Phyz (Dax Phyz) - 2.5D physics simulator/editor. ;Closed source/limited free distribution * Digital Molecular Matter * Havok *
Vortex In fluid dynamics, a vortex ( : vortices or vortexes) is a region in a fluid in which the flow revolves around an axis line, which may be straight or curved. Vortices form in stirred fluids, and may be observed in smoke rings, whirlpools in ...
by CMLabs Simulations * AGX Multiphysics by Algoryx Simulation AB * Algodoo by Algoryx Simulation AB *Rubikon by
Valve Corporation Valve Corporation is an American video game developer, publisher, and digital distribution company headquartered in Bellevue, Washington. It is the developer of the software distribution platform Steam and the franchises ''Half-Life'', '' C ...


High precision physics engines

*
VisSim VisSim is a visual block diagram program for simulation of dynamical systems and model-based design of embedded systems, with its own visual language. It is developed by Visual Solutions of Westford, Massachusetts. Visual Solutions was acquire ...
- Visual Simulation engine for linear and nonlinear dynamics


See also

* Game physics * Ragdoll physics * Procedural animation *
Rigid body dynamics In the physical science of dynamics, rigid-body dynamics studies the movement of systems of interconnected bodies under the action of external forces. The assumption that the bodies are ''rigid'' (i.e. they do not deform under the action of ...
*
Soft body dynamics Soft-body dynamics is a field of computer graphics that focuses on visually realistic physical simulations of the motion and properties of deformable objects (or ''soft bodies''). The applications are mostly in video games and films. Unlike in si ...
* 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 Analysis The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat ...


References


Further reading

* Bourg, David M. (2002)
Physics for Game Developers"> Physics for Game Developers
'. O'Reilly & Associates.


External links

* {{DEFAULTSORT:Physics Engine Computer graphics Video game development Articles containing video clips