Collision detection
Download
1 / 10

collision.ppt - PowerPoint PPT Presentation


  • 2153 Views
  • Uploaded on

Collision Detection Kaboom! The Plan What is collision detection? Why is collision detection important? Classification of collision detection Tools for finding collisions How and where collision detection is implemented in the video game package What is collision detection?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'collision.ppt' - andrew


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

The plan l.jpg
The Plan

  • What is collision detection?

  • Why is collision detection important?

  • Classification of collision detection

  • Tools for finding collisions

  • How and where collision detection is implemented in the video game package


What is collision detection l.jpg
What is collision detection?

Collision detection is determining the time and/or location of the intersection of two or more objects.

Kaboom!


Why is collision detection important l.jpg
Why is collision detection important?

  • Simulations

    • air traffic control

    • physics

    • video games

  • Modeling

    • molecular models

    • packing algorithms

    • Computer Aided Design (CAD)


Classification of collision detection l.jpg
Classification of Collision Detection

  • Type of objects

    • convexity/concavity

    • rigid/deformable

    • polygons/curves

    • 1-Dimensional/2D/3D/N-D

    • static/dynamic

  • Time of collision

    • discrete/continuous

    • static/dynamic

    • exact/approximate

  • Motion of objects

    • linear/non-linear

    • predictable/dynamic

    • bounded/unbounded

    • angular motion

  • Other factors

    • realtime/off-line

    • number of objects

    • allowable error margin

    • frame vs. path


Tools for finding collisions l.jpg
Tools for finding collisions

  • Bounding boxes/circles/spheres

  • Constructive Area Geometry

  • Spacial separation trees

  • Tile maps

  • Numerical analysis methods


Collision detection in the video game package l.jpg
Collision Detection in theVideo Game Package

  • Default uses a single bounding box

  • Images must use a bounding box

  • CAG used for approximations

  • All objects are polygons (or approximated by polygons)

  • No pruning other than use of bounding box for first approximation


Collision detection in the video game package8 l.jpg
Collision Detection in theVideo Game Package

For pair (j, k) of Sprites:

  • if the boundingBox(j) does not intersect boundingBox(k), return no intersection

  • let m be the intersection of j and k

  • if m is empty, return no intersection

  • otherwise, return intersection

  • This algorithm uses a simple test for intersection when possible (intersection of bounding boxes), and a more exact test when the bounding box fails to determine intersection.


  • Collision detection in the video game package9 l.jpg
    Collision Detection in theVideo Game Package

    What this collision detection is not good at doing:

    • determining path intersections (important for fast moving objects or low model frame rates)

    • determining time/location of first intersection

    • predicting intersections

    • handling a large number of Sprites


    Collision detection in the video game package10 l.jpg
    Collision Detection in theVideo Game Package

    Location & Response of collision detection

    • Sprite

      • public void setUseBoundingBox(boolean box)

      • public boolean intersects(Sprite sprite)

      • public static double getNormalVector(Shape stationary, Shape moving)

    • ProjectileTracker

      • public void bounce(double normal)


    ad