Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Physics engine
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Software for approximate simulation of physical systems}} {{More citations needed|date=August 2010}} {{Infobox software | name = Physics engine | screenshot = PhysicsEngine.ogv | caption = <!-- Since this is NOT a real caption, override text "center" --><div style= "text-align: left;">These are four examples of a physics engine simulating an object falling onto a slope. The examples differ in accuracy of the simulation: # No physics # [[Gravity]], no collision detection # Gravity and [[collision detection]], no rigid body dynamics # Gravity, collision detection and rotation calculations</div> | screenshot size = | screenshot alt = | genre = }} A '''physics engine''' is [[computer software]] that provides an approximate [[Computer simulation|simulation]] of certain [[physical system]]s, typically [[classical dynamics]], including [[rigid body dynamics]] (including [[collision detection]]), [[soft body dynamics]], and [[Fluid simulation|fluid dynamics]]. It is of use in the domains of [[computer graphics]], [[video game]]s and film ([[Computer-generated imagery|CGI]]). Their main uses are in video games (typically as [[game middleware|middleware]]), in which case the simulations are in [[Real-time simulation|real-time]]. The term is sometimes used more generally to describe any [[software system]] for simulating physical phenomena, such as [[High-performance computing|high-performance scientific simulation]]. == Description == There are generally two classes of physics [[Software engine|engine]]s: [[Real-time computer graphics|real-time]] and high-precision. High-precision physics engines require more processing power to calculate very [[Accuracy and precision|precise]] 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. A physics engine is essentially a big calculator that does mathematics needed to simulate physics.<ref>{{Cite book |last=Millington |first=Ian |url=https://books.google.com/books?id=d0NZDwAAQBAJ&q=is+computer+software+that&pg=PP1 |title=Game Physics Engine Development |date=2007-03-07 |publisher=CRC Press |isbn=978-1-4822-6732-7 |language=en}}</ref> === Scientific engines === {{Expand section|date=August 2010}} One of the first general purpose computers, [[ENIAC]], 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]] 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]] modeling, where particles are assigned [[force vector]]s that are combined to show circulation. Due to the requirements of speed and high precision, special computer processors known as [[vector processor]]s were developed to accelerate the calculations. The techniques can be used to model weather patterns in [[weather forecasting]], wind tunnel data for designing air- and watercraft or motor vehicles including racecars, and thermal cooling of computer processors for improving [[heat sink]]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; [[butterfly effect|small fluctuations]] not modeled in the simulation can drastically change the predicted results. Tire manufacturers use physics simulations to examine how new [[tire tread]] types will perform under wet and dry conditions, using new tire materials of varying flexibility and under different levels of weight loading. === Game engines === {{Main|Game engine|Game physics}} 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 (game engine)|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 animation|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 dynamics|soft body physics]]. Soft body physics are also used for particle effects, liquids and cloth. Some form of limited [[fluid dynamics]] simulation is sometimes provided to simulate water and other liquids as well as the flow of fire and explosions through the air. ==== Collision detection ==== {{Main|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]]. 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 (software)|Bullet]] or [[Havok (software)|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.<ref>{{cite web|url=http://graphics.eecs.berkeley.edu/site_root/papers/Obrien-GMA-1999-08/ |title=Graphical Modeling and Animation of Brittle Fracture|publisher=Graphics.eecs.berkeley.edu|access-date=2012-09-01}}</ref> ==== 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 3D [[virtual world]] [[Second Life]], 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.<ref>{{cite web |url=http://wiki.blender.org/index.php/Doc:Manual/Game_Engine/Logic/Object_type/Rigid_body |title=Doc:Manual/Game Engine/Logic/Object type/Rigid body - BlenderWiki |publisher=Wiki.blender.org |date=2009-11-20 |access-date=2010-08-16 |archive-date=2011-10-01 |archive-url=https://web.archive.org/web/20111001101647/http://wiki.blender.org/index.php/Doc:Manual/Game_Engine/Logic/Object_type/Rigid_body |url-status=dead }}</ref> ==== Paradigms ==== Physics engines for video games typically have two core components, a [[collision detection]]/[[collision response]] system, and the [[Dynamical simulation|dynamics simulation]] component responsible for solving the forces affecting the simulated objects. Modern physics engines may also contain [[Computational fluid dynamics|fluid simulations]], animation [[Motion control|control systems]] and [[COLLADA|asset integration]] tools. There are three major paradigms for the physical simulation of solids:<ref>{{cite book |last1=Erleben |first1=Kenny |last2=Sporring |first2=Jon |last3=Henriksen |first3=Knud |last4=Dohlmann |first4=Henrik |date=2005 |title=Physics-Based Animation}}</ref> * Penalty methods, where interactions are commonly modelled as [[Soft body dynamics#Spring/mass models|mass-spring]] systems. This type of engine is popular for deformable, or [[Soft body dynamics|soft-body physics]]. * Constraint based methods, where [[Constraint (mathematics)|constraint equations]] are solved that estimate physical laws. * Impulse based methods, where [[impulse (physics)|impulse]]s 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 (visual arts)|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)== {{Main|Physics processing unit}} A physics processing unit (PPU) is a dedicated microprocessor designed to handle the calculations of physics, especially in the physics engine of [[video game]]s. Examples of calculations involving a PPU might include [[rigid body dynamics]], [[soft body dynamics]], [[collision detection]], [[fluid dynamics]], hair and clothing simulation, [[finite element analysis]], 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) == {{Main|General-purpose computing on graphics processing units}} 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|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.<ref>{{cite web|url=http://www.nvidia.com/page/8800_features.html |title=NVIDIA 8800 features page - Quantum Effects Technology |publisher=Nvidia.com |access-date=2010-08-16}}</ref> 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 === {{Col-begin}} {{Col-break}} ;Open source <!-- Alphabetical order! --> <!-- Simple Physics Engine is not open source --> *[[Advanced Simulation Library]] - open source hardware accelerated multiphysics simulation software *[[Box2D]] *[[Bullet (software)|Bullet]] *[[Chipmunk physics engine]] - 2D physics engine *Jolt Physics<ref>[https://github.com/jrouwe/JoltPhysics Jolt Physics GitHub Repository]</ref> - Horizon Forbidden West physics engine *[[Newton Game Dynamics]] *[[Open Dynamics Engine]] *[[PAL (software)|PAL (Physics Abstraction Layer)]] - A uniform API that supports multiple physics engines *[[PhysX]] *[[Project Chrono]] - An open source simulation engine for multi-physics applications. *Rapier<ref>[https://github.com/dimforge/rapier Rapier's official GitHub repository]</ref><ref>[https://rapier.rs Rapier's official website]</ref> - a 2D and 3D physics engine written in [[Rust (programming language)|Rust]] *[[Siconos]] Modeling and the simulation of mechanical systems with contact, impact and Coulomb's friction *[[SOFA (Simulation Open Framework Architecture)]] *[[Tokamak physics engine]] {{Col-break}} ;Public domain <!-- Alphabetical order! --> *[[Phyz]] (Dax Phyz) - 2.5D physics simulator/editor. ;Closed source/limited free distribution <!-- Alphabetical order! --> <!-- DMM is not a physics engine, DMM requires physics-engine eg. Bullet --> <!-- DMM is a stand-alone physics engine. It does not need Bullet or any other engine to work. Read the page describing it before making deletion edits. --> <!-- Euphoria is not a physics engine, Euphoria is an animation engine (physics-engine independent) and works with all commercially available physics engines --> <!-- Unreal Engine is not a physics engine, requires PhysX --> <!-- starLiGHT.Engine is not a physics engine --> *[[Digital Molecular Matter]] *[[Havok (software)|Havok]] *Chaos by [[Epic Games]] *[[Vortex (physics engine)|Vortex]] by CMLabs Simulations *[[AGX Multiphysics (physics engine)|AGX Multiphysics]] by [[Algoryx Simulation AB]] *[[Algodoo]] by [[Algoryx Simulation AB]] *Rubikon by [[Valve Corporation]]{{col-end}} === High precision physics engines === <!-- Alphabetical order! --> *[[VisSim]] - Visual Simulation engine for linear and nonlinear dynamics == See 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 Analysis]] == References == {{Reflist}} == Further reading == * Bourg, David M. (2002) ''[https://archive.org/details/physicsforgamede0000bour <!-- quote="physics engine". --> Physics for Game Developers]''. O'Reilly & Associates. == External links == * {{cite web |url= https://www.digitalrune.com/Blog/Post/1813/Physics-Engines-List |title= Physics Engines List |orig-year= 2010 |date= Mar 30, 2015 |publisher= Digital Rune |work= Database |archive-date= Mar 9, 2016 |archive-url= https://web.archive.org/web/20160309162438/https://www.digitalrune.com/Blog/Post/1813/Physics-Engines-List }} {{Physics engines}} {{DEFAULTSORT:Physics Engine}} [[Category:Computer graphics]] [[Category:Computer physics engines| ]] [[Category:Video game development]] [[Category:Articles containing video clips]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:'
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Col-begin
(
edit
)
Template:Col-break
(
edit
)
Template:Col-end
(
edit
)
Template:Expand section
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main
(
edit
)
Template:Main other
(
edit
)
Template:More citations needed
(
edit
)
Template:Physics engines
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)