Physics Engines for Games - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Physics Engines for Games

Description:

It can simulate and predict effects under different conditions that would ... This may be a bounding box, sphere, or convex hull. ... – PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 16
Provided by: kath380
Category:
Tags: engines | games | hull | physics

less

Transcript and Presenter's Notes

Title: Physics Engines for Games


1
Physics Engines for Games
  • Topics in Computer Science
  • Math Physics of Games
  • Fall 2009

2
Physics in a Game
  • A physics engine is a computer program that
    simulates physics models, using variables such as
  • mass
  • velocity
  • friction
  • wind resistance
  • It can simulate 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.

3
Classes of Physics Engines
  • There are generally two classes of physics
    engines, real-time 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.

4
Pretty Good Physics
  • Computer games use physics engines to improve
    realism.
  • 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.

5
Core Components
  • Physics engines have two core components,
  • a collision detection system
  • the dynamics simulation responsible for resolving
    the forces affecting the simulated objects.
  • Modern physics engines may also contain
  • fluid simulations
  • animation control systems
  • asset integration tools.

6
Scientific Engines - ENIAC
  • 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.

7
Scientific Engines - Supercomputers
  • 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.
  • This is known as computational fluid dynamics
    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.

8
Simulations of Physical Events
  • 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 not modeled in the simulation can
    drastically change the predicted results after
    several days.
  • Chaos Theory
  • Initial State is the elusive component to weather
    simulation models.
  • 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 testing.

9
Michelin Man
  • 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.
  • Electronics manufacturers use fluid dynamic
    modeling to examine how cooling air will flow
    through the computer case, to locate thermal
    hotspots that may need additional cooling.

10
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.
  • For purposes of speed, a second highly simplified
    invisible mesh is used to represent the object to
    the physics engine.

11
Pretty Good Physics and Fidelity
  • 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 a vase, because the physics engine does not
    know the handles exist and only processes the
    rough cylindrical shape.

12
Pretty Good Physics Fidelity
  • 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.

13
Real Physics and Limitations for Games
  • 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 unnecessary and a waste of the
    limited CPU power.
  • 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.
  • Another unusual aspect of physics precision
    involves the frame rate, or the number of moments
    in time per second when physics is calculated.

14
Advanced Physics in Animation
  • Physics-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
    now that it is possible.
  • 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.

15
Tokamak Open Source Physics Engine
  • http//www.tokamakphysics.com
  • Written in C
  • We will update this to C for XNA
  • Todays job is to figure what is in it.
  • Download and look around.
Write a Comment
User Comments (0)
About PowerShow.com