collision detection l.
Download
Skip this Video
Download Presentation
Collision Detection

Loading in 2 Seconds...

play fullscreen
1 / 10

Collision Detection - PowerPoint PPT Presentation


  • 2154 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 Detection' - andrew


Download Now 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
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
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
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
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
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
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
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
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
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