Presentation is loading. Please wait.

Presentation is loading. Please wait.

Physically Based Simulations For Games

Similar presentations


Presentation on theme: "Physically Based Simulations For Games"— Presentation transcript:

1 Physically Based Simulations For Games
Görkem Gençay

2 Introduction Dynamics Collision Detection Rigid Body Dynamics
Soft Body Mass Spring Systems The Finite Element Method Position Based Dynamics Collision Detection Broad Phase Narrow Phase

3 Introduction Although classic phyics is very old, real time phyics is a new area. It is an interdisciplinary area Computational Mechanics Computer Science Robotics Computational Geometry For games and movies it should feel realistic, not always have to be accurate!

4 Dynamics - Linear Motion
Particle Has Mass, Position and Velocity No Rotation Equation of motion for a particle Newton’s Famous Law So how to calculate motion from these equations?

5 Numerical Integration
Euler’s Method Euler method is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value

6 Euler’s Method Explicit Euler integration Implicit Euler integration
Symplectic Euler integration (better then explicit euler)

7 Numerical Stability Numeric stability is one of most important challanges in physics engines. Step Size Step size is the most important factor the improves accuracy and stability. Never drop step size too much. You may need to call more than once in each frame if fps drops too much. Use double if possible.

8 Rigid Body Rigid Body has mass, velocity of cm, position of cm
Also has angular effects. Force is analogic Torque. Mass is analogic Inertia Tensor. Velocity is analogic Angular Velocity. Position is analogic Orientation of Body. Inertia tensor and Orientation(Rotation) is a 3x3 matrix!

9 Rigid Body Velocity of a point moving on a rigid body Torque :
Angular momentum is used as a state rather than anguler velocity because angular velocity is not conserved!

10 Inertia Tensor Inertia Tensor is not constant!
It depends on the orientation of the body. But each object has an constant tensor at body frame

11 Integration of Angular Effects
How to use Euler’s method on angular states? We need to find dR and dL P=mv, dP=F and for angular momentum dL=Torque = r x F dR=skew(w)*R

12 Inverse of Inertia Tensor is used to avoid expensive matrix inversions.
Need to reorhogonalize rotation matrix. Integration slowly deteriorates ortogonality constraint of rotation matrix.

13 Collision Detection Need heavy optimizations Broad phase Narrow phase
Use primitives(circle, square, cylinder etc.) Convex objects are composition of convex objects. Avoid concave objects. Objects move very slowly each frame.(dt is small) Broad phase Sweep and Prune Boundary Volume Hierarchy Spatial Hashing Narrow phase

14 Collision Response Impulsive Behavior

15 Collision Response Impulse for linear motion is
In 3d with angular effects

16 Collision Response with Friction
Colomb’s friction law. Nonconvex Rigid Bodies with Stacking Impulsed based Dynamic Simulation of Rigid Body Systems Resting Contact

17 Constrained Dynamics Constraint solving methods for contacts
Penalty methods, force/acceleration based Impulse based methods, Brian Mirtich Featherstone, reduced coordinates Works well in robotics, animation Constraint based methods solving an LCP Or more generally a mixed LCP or NCP Direct LCP solutions, Dantzig, Lemke Iterative LCP solutions, NNCG, Projected Gauss Seidel (PGS), Successive Over Relaxation (SOR)

18 Other Articulated Bodies Fluids : Liquids and Gases Soft Body Fracture
Cloth Deformable bodies Fracture

19 References http://chrishecker.com/Rigid_body_dynamics


Download ppt "Physically Based Simulations For Games"

Similar presentations


Ads by Google