All Topics  
Physics engine

 

   Email Print
   Bookmark   Link






 

Physics engine



 
 
A physics engine is a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 that simulates Newtonian physics models, using variables such as mass
Mass

In physical science, mass refers to the degree of acceleration a body acquires when subject to a force: bodies with greater mass are accelerated less by the same force....
, velocity
Velocity

In physics, velocity is defined as the Derivative of Position vector. It is a vector physical quantity; both speed and direction are required to define it....
, friction
Friction

File:Friction alt.svgFriction is the force resisting the relative lateral motion of solid surfaces, fluid layers, or material elements in contact....
 and wind resistance. It can simulate
Computer simulation

A computer simulation, a computer model or a computational model is a computer program, or network of computers, that attempts to simulation an abstract model of a particular system....
 and predict effects under different conditions that would approximate what happens in real life or in a fantasy world. Its main uses are in scientific simulation and in video games.

Description
There are generally two classes of physics engines, real-time
Real-time computing

In computer science, real-time computing is the study of Computer hardware and computer software systems that are subject to a "real-time constraint"?i.e., operational deadlines from event to system response....
 and high-precision.






Discussion
Ask a question about 'Physics engine'
Start a new discussion about 'Physics engine'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A physics engine is a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 that simulates Newtonian physics models, using variables such as mass
Mass

In physical science, mass refers to the degree of acceleration a body acquires when subject to a force: bodies with greater mass are accelerated less by the same force....
, velocity
Velocity

In physics, velocity is defined as the Derivative of Position vector. It is a vector physical quantity; both speed and direction are required to define it....
, friction
Friction

File:Friction alt.svgFriction is the force resisting the relative lateral motion of solid surfaces, fluid layers, or material elements in contact....
 and wind resistance. It can simulate
Computer simulation

A computer simulation, a computer model or a computational model is a computer program, or network of computers, that attempts to simulation an abstract model of a particular system....
 and predict effects under different conditions that would approximate what happens in real life or in a fantasy world. Its main uses are in scientific simulation and in video games.

Description


There are generally two classes of physics engines, real-time
Real-time computing

In computer science, real-time computing is the study of Computer hardware and computer software systems that are subject to a "real-time constraint"?i.e., operational deadlines from event to system response....
 and high-precision. High-precision physics engines require more processing power to calculate very precise physics and are usually used by scientists and computer animated movies. In video games, or other forms of interactive computing, the physics engine simplifies its calculations and lowers its accuracy so that they can be performed in time for the game to respond at an appropriate rate for gameplay. This is referred to as real-time physics. Computer games use physics engines to improve realism.

Physics engines have two core components, a collision detection
Collision detection

In physical simulations, video games and computational geometry, collision detection involves algorithms for checking for collision, i.e. intersection, of two given solids....
 system, and the dynamics simulation
Dynamical simulation

Dynamical simulation, in computational physics, is the simulation of systems of objects that are free to move, usually in three dimensions according to Newton's laws of dynamics, or approximations thereto....
 component responsible for solving the forces affecting the simulated objects. Modern physics engines may also contain fluid simulations
Computational fluid dynamics

Computational fluid dynamics is one of the branches of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems that involve fluid flows....
, animation control systems
Motion control

Motion control is a sub-field of automation, in which the position and/or velocity of machines are controlled using some type of device such as a hydraulic pump, linear actuator, or an electric motor, generally a servomechanism....
 and asset integration
COLLADA

COLLADA is a COLLAborative Design Activity for establishing an interchange file format for interactive 3-D computer graphics applications....
 tools. There are three major paradigms for the physical simulation of solids:
  • Penalty methods, where interactions are commonly modeled as mass-spring
    Hooke's law

    In mechanics, and physics, Hooke's law of theory of elasticity is an approximation that states that the extension of a spring is in direct proportion with the load added to it as long as this load does not exceed the elastic limit....
     systems. This type of engine is popular for deformable, or soft-body physics
    Soft body dynamics

    Soft body dynamics is an area of physics simulation software that focuses on accurate simulation of a Elasticity . That is, the object is deformation, meaning that the relative positions of points of the objects can change....
    .
  • Constraint based methods, where constraint equations
    Constraint (mathematics)

    In mathematics, a constraint is a condition that a solution to an optimization problem must satisfy. There are two types of constraints: equality constraints and inequality constraints....
     are solved that estimate physical laws.
  • Impulse based methods, where impulse
    Impulse

    In classical mechanics, an impulse is defined as the integral of a force with respect to time. When a force is applied to a rigid body it changes the momentum of that body....
    s are applied to object interactions.


Finally, hybrid methods are possible that combine aspects of the above paradigms.

Scientific engines


One of the first general purpose computers ENIAC
ENIAC

ENIAC, short for Electronic Numerical Integrator And Computer, was a general-purpose electronic computer. It was a Turing complete, digital computer capable of being reprogrammed to solve a full range of computing problems....
 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

Artillery is a military Combat Arms which employs any apparatus, machine, an assortment of tools or instruments, a system or systems used as weapons for the discharge of large projectiles in combat as a major contribution of fire power within the overall military capability of an armed force....
 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 simulate the flowing of atmospheric air and water, in order to predict weather patterns
Weather forecasting

Bold text'Weather forecasting is the application of science and technology to predict the state of the Earth's atmosphere for a future time and a given location....
. This is known as computational fluid dynamics
Computational fluid dynamics

Computational fluid dynamics is one of the branches of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems that involve fluid flows....
 modeling, where particles of air are assigned a force vector, and these combined forces are calculated across vast regions of space to show how the overall weather patterns will circulate. Due to the requirements of speed and high precision, special computer processors known as vector processors were developed to accelerate the calculations.

Generally weather prediction is still an inaccurate science because the resolution of the simulated atmosphere is not detailed enough to match real-world conditions, and small fluctuations
Butterfly effect

The butterfly effect is a phrase that encapsulates the more technical notion of sensitive dependence on initial conditions in chaos theory....
 not modeled in the simulation can drastically change the predicted results after several days.

Similar fluid dynamic modeling is also commonly used for designing new types of aircraft and watercraft, and can provide engineers the information that used to be obtained solely from wind tunnel
Wind tunnel

A wind tunnel is a research tool developed to assist with studying the effects of air moving over or around solid objects.Ways that wind-speed and flow are measured in wind tunnels:...
 testing.

Tire manufacturers use physics simulations to examine how new tire tread
Tread

The tread of a tire or caterpillar track refers to the rubber on its circumference that makes contact with the road. As tires are used, the tread is worn down limiting their effectiveness in providing traction....
 types will perform under wet and dry conditions, using new tire materials of varying flexibility and under different levels of weight loading.

Electronics manufacturers use fluid dynamic modeling to examine how cooling air will flow through the computer case, to locate thermal hotspots
Heat sink

A heat sink is an environment or object that absorbs and dissipates heat from another object using thermal contact . Heat sinks are used in a wide range of applications wherever efficient heat dissipation is required; major examples include refrigeration, heat engines, Thermal management of electronic devices and systems and lasers....
 that may need additional cooling.

Game engines


In most computer games, speed of simulation is more important than accuracy of simulation. Typically most 3D objects in a game are represented by two separate meshes or shapes. One of these meshes is a highly complex and detailed shape which the player sees in the game, for example a vase with elegant curved and looping handles. However, for purposes of speed, a second highly simplified invisible mesh is used to represent the object to the physics engine. To the physics engine, the object may be processed as nothing more than a simple tall cylinder. It is therefore impossible to insert a rod or fire a projectile through the handle holes on the vase, because the physics engine does not know the handles exist and only processes the rough cylindrical shape. 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
Convex hull

In mathematics, the convex hull or convex envelope for a Set of points X in a real vector space V is the minimal convex set containing X....
. 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.

In the real world, physics is always active. There is a constant Brownian motion
Brownian motion

Brownian motion is the seemingly random movement of particles suspended in a liquid or gas or the mathematical model used to describe such random movements, often called a particle theory....
 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 unnecessary and a waste of the limited CPU power. In the 3D virtual world
Virtual world

A virtual world is a computer simulation intended for its user to inhabit and interact via Avatar s. These avatars are usually depicted as textual, two-dimensional, or 3D computer graphics representations, although other forms are possible ....
 Second Life
Second Life

Second Life is a virtual world developed by Linden Lab that launched on June 23, 2003 and is accessible via the Internet. A free Client called the Second Life Viewer enables its users, called Resident , to interact with each other through avatar ....
, if an object is resting on the floor and the object does not move beyond a certain minimal distance in about two seconds, then the physics calculations are disabled for the object and it becomes frozen in place. It remains frozen until a collision occurs with some other actively physical object, and that reactivates physics processing for the object. This freezing of stable non-moving objects allows the physics engine to conserve processing power and increase the framerate of other objects currently in motion, but can lead to unusual problems such as a huge slow pendulum freezing in place on the upswing, as it slows down and starts to reverse direction.

The primary limit of physics engine realism is the precision of the numbers representing the position of an object and the forces acting on that object. When the precision is too low, errors can creep into the calculations due to rounding, causing an object to overshoot or undershoot the correct position. These errors are compounded in situations where two free-moving objects are fitted together with a precision that is greater than what the physics engine can calculate. This can lead to an unnatural buildup energy in the object due to the rounding errors, that begins to violently shake and eventually blow the objects apart. 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.

Another unusual aspect of physics precision 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 leads to a situation where the object does not move smoothly through space but in fact seems to teleport from one point in space to the next point in space as each frame is calculated. At sufficiently high speeds a projectile will miss a target, if the target is small enough to fit in the gap between the calculated frames of the fast moving projectile. In Second Life this problem is resolved by making all projectiles as if they were arrows; a long invisible shaft trails behind the bullet so that as the bullet teleports forward, the shaft is long enough to cover the gap between successive teleports of the bullet and collide with any object that might fit between the calculated frames.

Physics-based character animation in the past only used rigid body dynamics
Rigid body dynamics

In physics, rigid body dynamics is the study of the dynamics of rigid bodies. Unlike Point particle, which move only in three Degrees of freedom , rigid bodies occupy space and have geometrical properties, such as a center of mass, moment of inertia, etc., that characterize motion in six Degrees of freedom ....
 because they are faster and easier to calculate, but modern games and movies are starting to use soft body physics
Soft body dynamics

Soft body dynamics is an area of physics simulation software that focuses on accurate simulation of a Elasticity . That is, the object is deformation, meaning that the relative positions of points of the objects can change....
 now that it is possible. Soft body physics are also used for particle effects, liquids and cloth. Some form of limited Fluid dynamics
Fluid dynamics

In physics, fluid dynamics is the sub-discipline of fluid mechanics dealing with fluid flow — the natural science of fluids in motion....
 simulation is sometimes provided to simulate water and other liquids as well as the flow of fire and explosions through the air.

Physics Processing Unit (PPU)

February 2006 saw the release of the first dedicated Physics Processing Unit (PPU)
Physics processing unit

A physics processing unit is a dedicated microprocessor designed to handle the calculations of physics, especially in the physics engine of video games....
 from Ageia
AGEIA

Ageia, founded in 2002, was a fabless semiconductor company. Ageia invented PhysX ? a Physics Processing Unit chip capable of performing physics calculations much faster than general purpose Central processing unit; they also licensed out the PhysX Software development kit , a large physics middleware library for Computer game production....
 (later merged into nVidia
NVIDIA

Nvidia is a multinational corporation specializing in the manufacture of graphics processing unit technologies for workstations, desktop computers, and mobile devices....
), called PhysX
PhysX

PhysX is a proprietary software realtime physics engine middleware Software development kit originally developed by Ageia as the NovodeX SDK. The software was PhysX can also refer to a Physics processing unit add-in card designed by Ageia to accelerate PhysX-enabled video games....
, which functions in a similar manner to the Graphic Processing Unit (GPU) in a graphics card - off-loading the majority of the physics processing weight off the CPU and into a dedicated processor. The unit was most effective in accelerating particle systems
Particle Systems

Particle Systems Ltd. was a Video game Video game developer based in Sheffield, England. The company was founded by Glyn Williams and Michael Powell....
. Only a small performance improvement was measured for rigid body physics. The Ageia PPU is documented in depth in their US patent application #20050075849.

An early academic PPU research project named SPARTA (simulation of physics on a real-time architecture) was carried out at Penn State and University of Georgia. This was a simple FPGA based PPU that was limited to two dimensions. This project was extended into a considerably more advanced ASIC
Application-specific integrated circuit

An application-specific integrated circuit is an integrated circuit customized for a particular use, rather than intended for general-purpose use....
-based system named HELLAS.

Image:SPARTA_animation.jpg|Example SPARTA animation Image:SPARTA_board.jpg|SPARTA Printed circuit board
Printed circuit board

A printed circuit board, or PCB, is used to mechanically support and electrically connect electronic components using Conductor pathways, or signal traces, industrial etchinged from copper sheets laminated onto a non-conductive substrate....
Image:Hellas_die.jpg|Hellas die
Die (integrated circuit)

A die in the context of integrated circuits is a small block of semiconducting material, on which a given functional circuit is fabricated.Typically, integrated circuits are produced in large batches on a single wafer of electronic-grade silicon through processes such as photolithography....
 photo


General Purpose processing on Graphics Processing Unit (GPGPU)

GPGPU
GPGPU

General-purpose computing on graphics processing units is the technique of using a graphics processing unit, which typically handles computation only for computer graphics, to perform computation in applications traditionally handled by the central processing unit....
 ("General Purpose processing on Graphics Processing Unit") is another promising approach for realtime physics engines, including rigid body dynamics. ATI
Ati

As a word, Ati may refer to:* Ati, Chad, a town in Chad* Ati , a Negrito ethnic group in the Philippines** Ati-Atihan Festival, an annual celebration held in the Philippines...
 and NVIDIA
NVIDIA

Nvidia is a multinational corporation specializing in the manufacture of graphics processing unit technologies for workstations, desktop computers, and mobile devices....
 provide rigid body dynamics on their latest graphics cards. ATI claims that their X1900 XT should deliver 9 times the performance of an nVidia
NVIDIA

Nvidia is a multinational corporation specializing in the manufacture of graphics processing unit technologies for workstations, desktop computers, and mobile devices....
 PhysX
PhysX

PhysX is a proprietary software realtime physics engine middleware Software development kit originally developed by Ageia as the NovodeX SDK. The software was PhysX can also refer to a Physics processing unit add-in card designed by Ageia to accelerate PhysX-enabled video games....
 card.

NVIDIA
NVIDIA

Nvidia is a multinational corporation specializing in the manufacture of graphics processing unit technologies for workstations, desktop computers, and mobile devices....
's GeForce 8 Series
GeForce 8 Series

The GeForce 8 Series is the eighth generation of NVIDIA's GeForce graphics processing units. The series also represents the third fundamentally new GPU design developed at NVIDIA as well as the company's first Unified_shader_model#Unified_Shading_Architecture....
 supports a new GPU-based Newtonian physics acceleration technology named Quantum Effects Technology - which will compete directly with the PhysX
PhysX

PhysX is a proprietary software realtime physics engine middleware Software development kit originally developed by Ageia as the NovodeX SDK. The software was PhysX can also refer to a Physics processing unit add-in card designed by Ageia to accelerate PhysX-enabled video games....
 PPU
PPU

The three letter acronym PPU can refer to:*Palestine Polytechnic University - Hebron, West Bank*Pending Pick-Up - online classified ads followup info by person posting...
 hardware. NVIDIA provides an SDK Toolkit for what they call CUDA
Cuda

Cuda may refer to:* Plymouth Barracuda, a Chrysler automobile* CUDA, a computer processing technology* Cuda, a czechlosovakian last name...
 (Compute Unified Device Architecture) technology that offers both a low and high-level API to the GPU. Few technical details are available about the physics side of it, and it is not yet clear whether this is part of Havok FX SDK, and/or nVidia PhysX SDK, or a completely separate engine.

ATI
Ati

As a word, Ati may refer to:* Ati, Chad, a town in Chad* Ati , a Negrito ethnic group in the Philippines** Ati-Atihan Festival, an annual celebration held in the Philippines...
 & AMD offer a similar SDK for their ATI-based GPUs and that SDK
SDK

SDK may refer to:* Slovak Democratic Coalition* Software development kit...
 and technology is called CTM
CTM

CTM is an initialism that may stand for:...
 (Close to Metal
Close to Metal

Close To Metal is the name of a beta version of a low-level programming interface developed by ATI Technologies , aimed at enabling GPGPU computing....
) which provides a thin hardware interface. AMD has also announced the AMD Stream Processor product line which combines a CPU and GPU technology on one chip.

Real-time physics engines

Open source
  • Box2D
    Box2D

    Box2D is a freeware open source Dimension Physics engine game engine written in C++ by Erin Catto. It was used in Crayon Physics....
  • Bullet
    Bullet (software)

    Bullet is an open source software multi-threaded 3D Collision Detection, Soft Body and Rigid Body Dynamics Library . It is published under the zlib license making it free for commercial use....
  • Open Dynamics Engine
    Open Dynamics Engine

    The Open Dynamics Engine is a physics engine. Its two main components are a rigid body dynamics simulation engine and a collision detection engine....
  • OPAL
    OPAL (software)

    The Open Physics Abstraction Layer is an open source realtime physics engine API similar to PAL . It was originally supported only by Open Dynamics Engine, but should be extendable to run off of multiple engines....
  • PAL
  • SOFA (Simulation Open Framework Architecture)
    SOFA (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 algorithms, but can also be used as an efficient prototyping tool or as a physics engine....
  • Tokamak physics engine
    Tokamak physics engine

    The Tokamak Game Physics SDK is an open-source physics engine.At its beginnings, Tokamak was free for non commercial uses only. Since May 2007, it has become open sourced under a BSD licenses....
  • Farseer Physics Engine
    Farseer Physics Engine

    The Farseer Physics Engine is an open source physics engine for the Microsoft .net platform. They have official releases for Silverlight as well as Microsoft XNA, but also a general purpose class library....
     - 2D physics engine for Microsoft XNA
    Microsoft XNA

    Microsoft XNA is a set of tools with a managed runtime environment provided by Microsoft that facilitates Video game game development and management....
     and Silverlight
  • Physics2D.Net
    Physics2D.Net

    Physics2D.Net is two-dimensional rigid body physics engine written in C Sharp . It has quite a few features including: stacking, joints, gravity, water, and is highly optimized for a large number of objects....
     - 2D physics engine for the .NET Framework
    .NET Framework

    The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework....
     2.0 or greater.


Public domain
  • Phyz
    Phyz

    Phyz , is a public domain, 2D computer graphics physics engine with built-in editor and DirectX graphics and sound. In contrast to most other real-time physics engines, it is vertex based and stochastic....
     (Dax Phyz) - 2.5D physics simulator/editor.


Closed source/limited free distribution
  • Newton Game Dynamics
    Newton Game Dynamics

    Newton Game Dynamics is a free, but closed source physics engine for realistically simulating rigid bodies in games and other real-time applications....
  • PhysX
    PhysX

    PhysX is a proprietary software realtime physics engine middleware Software development kit originally developed by Ageia as the NovodeX SDK. The software was PhysX can also refer to a Physics processing unit add-in card designed by Ageia to accelerate PhysX-enabled video games....
     (formerly NovodeX and incorporating Meqon
    Meqon

    Meqon is a real-time physics engine for computer entertainment software.Meqon was developed by Meqon Research, a Swedish company that was acquired by AGEIA on September 1, 2005....
    )


Commercial
  • Havok
    Havok (software)

    Havok Physics is a physics engine developed by Irish company Havok . It is designed for computer game and video games by allowing interaction between objects or other characters in real-time and by giving objects physics-based qualities in three dimensions....
  • Simul-X . A Havok
    Havok

    Havok is a fictional Marvel Comics superhero, a member of the X-Men. He is the son of Corsair and brother of Cyclops and Vulcan .A Mutant , Havok generates powerful ?plasma blasts?, an ability he has had difficulty controlling....
     or Physx
    PhysX

    PhysX is a proprietary software realtime physics engine middleware Software development kit originally developed by Ageia as the NovodeX SDK. The software was PhysX can also refer to a Physics processing unit add-in card designed by Ageia to accelerate PhysX-enabled video games....
     add-on to enable advanced vehicle physics .


High precision physics engines
  • Working Model
    Working Model

    Working Model is an Simulation#Engineering, technology or process simulation software product. Virtual mechanical components, such as springs, ropes, and motors are combine with objects in a Two-dimensional working space....
     by Design Simulation Technologies


See also

  • Game physics
    Game physics

    Computer animation physics or game physics involves the introduction of the laws of physics into a simulation or game engine, particularly in 3D computer graphics, for the purpose of making the effects appear more real to the observer....
  • Ragdoll physics
    Ragdoll physics

    In computer physics engines, ragdoll physics are a type of procedural animation that is often used as a replacement for traditional static death animations....
  • Procedural animation
    Procedural animation

    A procedural animation is a type of computer animation, used to automatically generate animations in real-time to allow for a more diverse series of actions than could otherwise be created using predefined animations....
  • Rigid body dynamics
    Rigid body dynamics

    In physics, rigid body dynamics is the study of the dynamics of rigid bodies. Unlike Point particle, which move only in three Degrees of freedom , rigid bodies occupy space and have geometrical properties, such as a center of mass, moment of inertia, etc., that characterize motion in six Degrees of freedom ....
  • Soft body dynamics
    Soft body dynamics

    Soft body dynamics is an area of physics simulation software that focuses on accurate simulation of a Elasticity . That is, the object is deformation, meaning that the relative positions of points of the objects can change....
  • Physics processing unit
    Physics processing unit

    A physics processing unit is a dedicated microprocessor designed to handle the calculations of physics, especially in the physics engine of video games....
  • Cell microprocessor
    Cell microprocessor

    Cell is a microprocessor architecture jointly developed by Sony Computer Entertainment, Toshiba, and IBM, an alliance known as "STI". The architectural design and first implementation were carried out at the STI Design Center in Austin, Texas over a four-year period beginning March 2001 on a budget reported by IBM as approaching United States...


Further reading

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


External links

  • contains a comprehensive list of physics engines and rigid body dynamics resources (master thesis, links).
  • Google Video demonstration of calculation errors, in the virtual world Second Life.