Computer Game Design and Development Collision Detection Havok Destruction.

Slides:



Advertisements
Similar presentations
Area Under a Curve (Linear). Find the area bounded by the x-axis, y = x and x =1. 1. Divide the x-axis from 0 to 1 into n equal parts. 2. Subdividing.
Advertisements

Making Math Work Algebra Tiles
- Volumes of a Solid The volumes of solid that can be cut into thin slices, where the volumes can be interpreted as a definite integral.
Sprites A sprite is a 2D image or animation that is integrated into a larger scene. Originally, sprites were created by special hardware that would super-impose.
Chapter 5 Integrals 5.1 Areas and Distances
2.3. B OUNDING V OLUMES Bounding volumes of use for collision detection.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Computer Science – Game DesignUC Santa Cruz Today Homework Bounding Boxes Quadtrees Per-pixel collision Drawing text (if we have time)
Computer Science – Game DesignUC Santa Cruz CMPS 20: Game Design Experience Gforge SVN Collision Detection and Resolution.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
CS223B Assignment 1 Recap. Lots of Solutions! 37 Groups Many different approaches Let’s take a peek at all 37 results on one image from the test set.
APPLICATIONS OF INTEGRATION
CSCE 590E Spring 2007 Collision Detection By Jijun Tang.
Using Areas to Approximate to Sums of Series In the previous examples it was shown that an area can be represented by the sum of a series. Conversely the.
Collision Detection Michael Fuller. Overlap testing Most Common Technique Most Error Prone Test if two bodies overlap.
Collision Detection David Johnson Cs6360 – Virtual Reality.
7.1 Area of a Region Between Two Curves.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
CS 4730 Collision Detection CS 4730 – Computer Game Design.
Guide to Programming with Python
Fluid Animation CSE 3541 Matt Boggus. Procedural approximations – Heightfield fluids Mathematical background – Navier-Stokes equation Computational models.
2D Collision Detection For CSE 3902 By: Matt Boggus.
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
Section 1.5.
User Input and Collisions COSC 315 Fall 2014 Bridget M. Blodgett.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Computer Game Design and Development Mathematics, Collision, and Physics Havok Destruction.
LINEAR SYSTEMS of INEQUALITIES – Graphing Method When graphing a set of linear inequalities, the solution set will be a “shared” space where the two solutions.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
User Interface Interface: web room planner. User Interface Inspiration: Google SketchUp.
Neo-Breakout Sonhui Schweitzer CS 470 Spring 2005.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
CSE 380 – Computer Game Programming Player Controls & Scrolling Mega Man, by Capcom, released 1988.
Sorting & Searching Review. Selection Sort 1. Find the smallest element 2. Move to the front of the array (swap with front) 3. Repeat Steps 1&2, but ignoring.
XNA Basic Displaying Image & Collision Detect. What’s format image that XNA support? XNA support only.bmp.png and.jpg image..PNG have transparent region.
Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu.
Computer Game Design and Development
1 Sage Demo 4 Collisions SAGE Lecture Notes Ian Parberry University of North Texas.
Essential components of the implementation are:  Formation of the network and weight initialization routine  Pixel analysis of images for symbol detection.
Game Programming 13 Physics in Games (cont.) 2010 년 2 학기 디지털콘텐츠전공.
6.1 Areas Between Curves In this section we learn about: Using integrals to find areas of regions that lie between the graphs of two functions. APPLICATIONS.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
In this chapter, we explore some of the applications of the definite integral by using it to compute areas between curves, volumes of solids, and the work.
2D Collision Detection For CSE 3902 By: Matt Boggus.
Introduction to Collision Detection
9. Drawing.
Intro & Point-to-Box, Circle-to-Circle, Point-to-Circle
Collision Detection Box-to-Box.
9. Drawing Let's Learn Python and Pygame
Ch. 6 – The Definite Integral
Parts of these slides are based on
Sketch the region enclosed by {image} and {image}
Sketch the region enclosed by {image} and {image}
Chapter 4.2 Collision Detection and Resolution
Computational Geometry for the Tablet PC
Find the volume of the solid obtained by rotating about the x-axis the region under the curve {image} from x = 2 to x = 3. Select the correct answer. {image}
Find the volume of the solid obtained by rotating the region bounded by {image} and {image} about the x-axis. 1. {image}
Player preferences, Loading Scenes, Activating and Enabling
Skill Check after HW Check
2D Arrays Just another data structure Typically use a nested loop
Collision Detection.
The coordinate system Susan Ibach | Technical Evangelist
(Finding area using integration)
Collisions with Static Objects
Online Pogo Game Customer Service
Pogo Game Customer Care Helpline Number

Call Pogo Contact Phone Number and Enjoy Pogo Game
Presentation transcript:

Computer Game Design and Development Collision Detection Havok Destruction

Overlap Bisection

Limitations of Overlap Testing

Intersection Testing

Collision Approximations Minkowski Sum – sweep origin of X across Y

Performance Possible collision between R and B since overlap in all axis (2 in this case) Subdivide such that on average one object in each cell.

Per-Pixel Collision // The color data for the images; used for per-pixel collision Color[] personTextureData; Color[] rocketTextureData; // Load textures rocketTexture = Content.Load (“Rocket"); personTexture = Content.Load ("Person"); // Extract collision data rocketTextureData = new Color[rocketTexture.Width * rocketTexture.Height]; rocketTexture.GetData(rocketTextureData); personTextureData = new Color[personTexture.Width * personTexture.Height]; personTexture.GetData(personTextureData);

Per-Pixel Collision (cont) static bool IntersectPixels(Rectangle rectangleA, Color[] dataA, Rectangle rectangleB, Color[] dataB) { // Find the bounds of the rectangle intersection int top = Math.Max(rectangleA.Top, rectangleB.Top); int bottom = Math.Min(rectangleA.Bottom, rectangleB.Bottom); int left = Math.Max(rectangleA.Left, rectangleB.Left); int right = Math.Min(rectangleA.Right, rectangleB.Right); // Check every point within the intersection bounds for (int y = top; y < bottom; y++) for (int x = left; x < right; x++) { // Get the color of both pixels at this point Color colorA = dataA[(x - rectangleA.Left) + (y - rectangleA.Top) * rectangleA.Width]; Color colorB = dataB[(x - rectangleB.Left) + (y - rectangleB.Top) * rectangleB.Width]; // If both pixels are not completely transparent, if (colorA.A != 0 && colorB.A != 0) // then an intersection has been found return true; } // No intersection found return false; }

Bounding Volumes AABBOBB

Terrain Collision Heightmap information Look up terrain height 3 LERPs – Linear Interpretation between points – X – Z – Between x and z

Resolving Collision Gross collision & subdivide if needed Three phases – Prologue – ignore or trigger other events – Collision – point of impact, new velocities – Epilogue – destroy object, effects, damage