Collision Detection and Bouncing

Similar documents
Collision Detection and Bouncing

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate

Name Solutions to Test 3 November 8, 2017

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Math 8 Winter 2015 Applications of Integration

Physics 9 Fall 2011 Homework 2 - Solutions Friday September 2, 2011

Improper Integrals, and Differential Equations

7.1 Integral as Net Change and 7.2 Areas in the Plane Calculus

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

JURONG JUNIOR COLLEGE

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

Forces from Strings Under Tension A string under tension medites force: the mgnitude of the force from section of string is the tension T nd the direc

First midterm topics Second midterm topics End of quarter topics. Math 3B Review. Steve. 18 March 2009

DIRECT CURRENT CIRCUITS

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

PhysicsAndMathsTutor.com

Infinite Geometric Series

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

13: Diffusion in 2 Energy Groups

CHM Physical Chemistry I Chapter 1 - Supplementary Material

Chapter 0. What is the Lebesgue integral about?

Sample Problems for the Final of Math 121, Fall, 2005

Ch AP Problems

HW3, Math 307. CSUF. Spring 2007.

Chapter 1: Fundamentals

University of Alabama Department of Physics and Astronomy. PH126: Exam 1

Lesson Notes: Week 40-Vectors

Line Integrals. Partitioning the Curve. Estimating the Mass

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

APPLICATIONS OF THE DEFINITE INTEGRAL

Log1 Contest Round 3 Theta Individual. 4 points each 1 What is the sum of the first 5 Fibonacci numbers if the first two are 1, 1?

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Review of Gaussian Quadrature method

Recitation 3: More Applications of the Derivative

We divide the interval [a, b] into subintervals of equal length x = b a n

Physics Jonathan Dowling. Lecture 9 FIRST MIDTERM REVIEW

13.3 CLASSICAL STRAIGHTEDGE AND COMPASS CONSTRUCTIONS

Math 1102: Calculus I (Math/Sci majors) MWF 3pm, Fulton Hall 230 Homework 2 solutions

INTRODUCTION TO LINEAR ALGEBRA

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

Model Solutions to Assignment 4

Chapter 2. Vectors. 2.1 Vectors Scalars and Vectors

Exam 1 Solutions (1) C, D, A, B (2) C, A, D, B (3) C, B, D, A (4) A, C, D, B (5) D, C, A, B

Higher Checklist (Unit 3) Higher Checklist (Unit 3) Vectors

Consequently, the temperature must be the same at each point in the cross section at x. Let:

Things to Memorize: A Partial List. January 27, 2017

DEFINITION OF ASSOCIATIVE OR DIRECT PRODUCT AND ROTATION OF VECTORS

AP Physics 1. Slide 1 / 71. Slide 2 / 71. Slide 3 / 71. Circular Motion. Topics of Uniform Circular Motion (UCM)

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b.

Special Relativity solved examples using an Electrical Analog Circuit

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

Chapter 1: Logarithmic functions and indices

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

PROPERTIES OF AREAS In general, and for an irregular shape, the definition of the centroid at position ( x, y) is given by

2.4 Linear Inequalities and Interval Notation

INTRODUCTION. The three general approaches to the solution of kinetics problems are:

Main topics for the Second Midterm

Is there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them!

5.2 Volumes: Disks and Washers

Designing Information Devices and Systems I Discussion 8B

Mathematics of Motion II Projectiles

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Line Integrals. Chapter Definition

Polynomials and Division Theory

ragsdale (zdr82) HW2 ditmire (58335) 1

STRAND J: TRANSFORMATIONS, VECTORS and MATRICES

PHYS 4390: GENERAL RELATIVITY LECTURE 6: TENSOR CALCULUS

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

Shape and measurement

13.4 Work done by Constant Forces

1 1D heat and wave equations on a finite interval

CONIC SECTIONS. Chapter 11

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

Physics Honors. Final Exam Review Free Response Problems

Motion. Acceleration. Part 2: Constant Acceleration. October Lab Phyiscs. Ms. Levine 1. Acceleration. Acceleration. Units for Acceleration.

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

/ 3, then (A) 3(a 2 m 2 + b 2 ) = 4c 2 (B) 3(a 2 + b 2 m 2 ) = 4c 2 (C) a 2 m 2 + b 2 = 4c 2 (D) a 2 + b 2 m 2 = 4c 2

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

Thomas Whitham Sixth Form

Equations and Inequalities

Mathematics Extension 1

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Section 4.8. D v(t j 1 ) t. (4.8.1) j=1

Equations, expressions and formulae

Lecture 5. Today: Motion in many dimensions: Circular motion. Uniform Circular Motion

On the diagram below the displacement is represented by the directed line segment OA.

Bridging the gap: GCSE AS Level

BME 207 Introduction to Biomechanics Spring 2018

Physics 1402: Lecture 7 Today s Agenda

Definition of Continuity: The function f(x) is continuous at x = a if f(a) exists and lim

Main topics for the First Midterm

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

MATH STUDENT BOOK. 10th Grade Unit 5

Identify graphs of linear inequalities on a number line.

fractions Let s Learn to

Math 0230 Calculus 2 Lectures

10. AREAS BETWEEN CURVES

The Wave Equation I. MA 436 Kurt Bryan

Transcription:

Collision Detection nd Bouncing Mike Biley mjb@cs.oregonstte.edu collision-bouncing.pptx

Collisions re Hndled in Two Prts 1. Detecting the collision 2. Hndling the physics of the collision

If You re Lucky, You Cn Detect the Collision Directly (i.e., s closed-form solution) We need to nswer the question: Wht will cuse the bll to stop flying freely through the ir? XLEFT (x,y) (vx,vy) XRIGHT The nswer is it will hit wll or the floor. From our rules of physics, the next bounce will hppen t one of the solutions to these equtions: XRIGHT RADIUS x v x t XLEFT RADIUS x v x t 1 YBOTTOM RADIUS y vyt gt 2 2 YBOTTOM Note: g < 0.

If You re Lucky, You Cn Compute the Collision Directly The next bounce will hppen t one of the solutions to these equtions: XRIGHT RADIUS x v x t t 1 XRIGHT RADIUS x v x XLEFT RADIUS x v x t t 2 XLEFT RADIUS x v x 1 YBOTTOM RADIUS y vyt gt 2 2 1 2 ( ) 0 2 gt vyt y YBOTTOM RADIUS t, t 3 4 2 y y v v 2 g( y YBOTTOM RADIUS) g How do you know which of the 4 t vlues is the one tht you should use?

In the Generl Cse, there re Two Types of Collision Detection 1. Discrete A B 2. Continuous A B A

Detecting Collisions Between Two Objects 1. Do s mny fst rejections s you cn 2. Do hierrchicl fst rejections 3. Discrete: compre ll edges of Object A ginst ll fces of Object B 3. Continuous: crete pseudo-edges by connecting respective points in Object A cross the time step, then compre ll these pseudo-edges of Object A ginst ll fces of Object B

Try to Simplify the Intersection Test Brek the Scene into Grid Discrete: You only hve to do intersection tests ginst objects tht live in the sme grid squre.

Try to Simplify the Intersection Test-- A Bounding Sphere

Try to Simplify the Intersection Test- Bounding Spheres R 2 R 1 C 2 C 1 2 These spheres overlp if: Distnce(C 1,C 2 ) < R 1 +R 2 1 To void the squre root: Distnce 2 (C 1,C 2 ) < (R 1 +R 2 ) 2

Try to Simplify the Intersection Test-- A Bounding Box Ymx Xmin Xmx Ymin

Try to Simplify the Intersection Test- Bounding Boxes Quickly compre two objects by fitting ech with bounding box nd then compring the two bounding boxes. 1 2 2 1 These boxes do not overlp if: Xmx 1 < Xmin 2 Ymx 1 < Ymin 2 Xmx 2 < Xmin 1 Ymx 2 < Ymin 1 2 1 These boxes do overlp if: Xmx 1 > Xmin 2 && Ymx 1 > Ymin 2 && Xmx 2 > Xmin 1 && Ymx 2 > Ymin 1

Try to Simplify the Intersection Test- -- Two Types of Bounding Boxes Axis-Aligned Bounding Box (AABB) Check for overlp by looking for overlp in just X, then just Y, then just Z Arbitrry-Oriented Bounding Box (AOBB) This is tighter fit round the object, but the overlp comprison is more involved

A Hierrchy of Bounding Boxes

Discrete -- You Cn Esily Tell if Point is Inside Convex Polyhedron Assume tht ll surfce normls point outwrds (usul convention). Use the Distnce-from--Point-to--Plne formul for ech fce of the polyhedron. If ll distnces re negtive, the point is inside the convex polyhedron Wht if the polyhedron is not convex? Put Convex Hull round the polyhedron nd test ginst tht. If the point is not inside the convex hull, then it is not inside the polyhedron either. If it is inside the convex hull, then more detiled nlysis is needed.

P d Distnce from Point to Plne nˆ Q The eqution of the plne is: x,y,z Q,Q,Q (n,n,n ) 0 which expnds out to become the more fmilir Ax + By + Cz + D = 0 x y z x y z The distnce from the point P to the plne is bsed on the plne eqution: d PQ nˆ The dot product is nswering the question How much of (P-Q) is in the norml direction?. Note tht this gives signed distnce. If d > 0., then P is on the sme side of the plne s the norml.

Discrete nd Continuous Compring n Edge on Object A ginst Fce on Object B P 1 nˆ Q P The eqution of the line segment is: P (1 tp ) tp 0 1 If point P wnts to be point in the plne, then: P,P,P Q,Q,Q (n,n,n ) 0 x y z x y z x y z If we substitute the prmetric expression for P into the plne eqution, then the only thing we don t know in tht eqution is t. Knowing t* will let us compute the (x,y,z) of the ctul intersection using the line eqution. If t* hs zero in the denomintor, then tht tells us tht t*=, nd the line must be prllel to the plne. This gives us the point of intersection with the infinite plne. We would now use the method covered few slides go to see if P lies inside the tringle in question. P 0

Is Point inside Tringle? n S Let: n ( RQ) ( S Q) Q P R n ( RQ) ( PQ) q n ( SR) ( PR) r n ( QS) ( PS) s If ( nn ),( nn ), nd( nn ) q r s re ll positive, then P is inside the tringle QRS

If Find Discrete Interference Do binry serch cross the time step until you find the time of collision

If Find Continuous Interference Connect ll points cross time nd look for the minimum t in n intersection with the boundry

The Physics of Collisions -- Definitions Line of Impct If the objects velocities re prllel to the Line of Impct, this is Direct Impct If the objects velocities re perpendiculr to the Line of Impct, this is Tngentil Impct A combintion of the two is clled n Oblique Impct Direct Impct Tngentil Impct Oblique Impct (both direct nd tngentil)

The Physics of Collisions Fundmentl Quntities The momentum of n object is defined s its mss multiplied by its velocity: Momentum mv The energy of n object is defined s one hlf of its mss multiplied by its velocity squred: Energy 1 2 mv 2

The Physics of Collisions Conservtion of Momentum In collision, the totl momentum fter the impct is equl to the totl momentum before the impct. Alwys. b mv mv mv mv b b b b where the primes refer to velocities fter the impct This is referred to s the Conservtion of Momentum Lw Momentum is lwys conserved through ny collision

Conservtion of Momentum s Explined by Newton s Crdle http://www.grnd-illusions.com/ctlog/newtons_crdle.html And, of course, where would ny topic be without kittens? http://dsc.discovery.com/videos/mythbusters-newtons-crne-crdle/ http://www.buzzfeed.com/koolnewsblog/cts-for-the-love-of-physics-1dgl

The Physics of Collisions Coefficient of Restitution In collision, energy is conserved in the entire system, but not necessrily in the form of velocities. (It cn become permnent deformtion, het, light, etc..) This loss of velocity is expressed s the Coefficient of Restitution (COR). The COR, e, is how much less the reltive velocities of the objects re fter impct thn they were before impct: b v v e( v v ) b b (the negtive sign is there to indicte the bounce )

The Physics of Collisions Combining Momentum nd Restitution Lws b Strting with these two equtions: mv mv mvmv b b b b v v e( v v ) b b Tret the two initil velocities s inputs nd solve for the two resulting velocities. This gives: v v b mv mv em( v v) b b b b m m mv mv em( v v) b b b m m b b

The Physics of Collisions with Immoveble Objects To tret the cse of mss b being n immoveble object, such s the ground or solid wll, solve for the resulting velocities tking the limit: lim m b v mv mv em( v v) b b b b m m b mv mv b b emb( vb v) lim mb m mb m mb m mb 0 v e( v v ) b b lim mb Since mss b is immoveble, its velocity is zero, so tht s post-collision velocity is: v ev

Collisions Experimentlly Determining the Coefficient of Restitution Velocities re hrd to mesure live, but distnces re not. So, drop the object from height h, nd mesure its bounce to height h : v Before the bounce: After the bounce: gh 2 2 0 v 2gh 2 2 2 0 2 v 2gh v 2gh v e v e v 2gh v 2gh h h

Collisions Some Coefficients of Restitution of Blls Bounced on Concrete Surfce Bll Mteril CoR rnge golf bll 0.858 tennis bll 0.712 billird bll 0.804 hnd bll 0.752 wooden bll 0.603 steel bll bering 0.597 glss mrble 0.658 bll of rubber bnds 0.828 hollow, hrd plstic bll 0.688 http://hypertextbook.com/fcts/2006/restitution.shtml

The Physics of Collisions Totlly Plstic Collisions v v b mv mv em( v v) b b b b m m mv mv em( v v) b b b m m b b If e=0, then the two objects stick together nd end up with the sme resulting velocity: v v b mv b b m mv m b

One of my Jury Duties: Two vehicles collide. One is very dmged, the other hrdly t ll. Wht hppened? Who s right? Very dmged B 25 mph Hrdly dmged A 0 mph vb evb 11.2(1.3) v 4.9 m/ sec m m 3 b mv b b emv b 11.2(1.3* 2) v b 1.5 m/ sec m m 3 v = 0. mph v b = 25 mph = 11.2 m/sec m = 2.0 m b = 1.0 e =.30 b How much velocity chnge did ech cr undergo? (Δv is n pproximte mesure of dmge.) Δv = 4.9 0. = 4.9 m/sec = 11.0 mph Δv b = 1.5 11.2 = 9.7 m/sec = 21.7 mph

The Physics of Collisions Totlly Elstic Collisions Wht hppens when e=1? The two fundmentl equtions re mv mv mv mv b b b b v v e( v v ) ( v v ) b b b Rerrnging: m v v m v v b b b v v v v b b

The Physics of Collisions Elstic Collisions m v v m v v b b b v v v v b b Then, multiplying the two together gives: Or: mv mv mv mv 2 2 2 2 b b b b 1 1 1 1 mv mv mv mv 2 2 2 2 2 2 2 2 b b b b This shows tht energy is conserved when the Coefficient of Restitution is 1.0

The Physics of Collisions Oblique Impcts Oblique Impcts re then hndled by using vector mth to determine the direct nd tngentil velocity components with respect to the Line of Impct. b The direct components re chnged using the equtions we just derived. The tngentil components re left unchnged. (This ssumes no friction.) The new components re then combined to produce the resulting velocity vectors.

Voxeliztion nother wy to do Collision Detection? Rndy Ruwendl