Game Physics

Total Page:16

File Type:pdf, Size:1020Kb

Game Physics 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 3D video games Game Physics Marco Tarini Animation in games but, a caveat on terminology: in some context procedural means “produced by a simple procedure” as opposed to “physically simulated” Non procedural Procedural Assets! Physics engine Fully controlled by Less control artist/designer (dramatic effects!) Realism: depends on Physics-driven artist’s skill realism Does not adapt to Auto adaptation context to context Repetition artefacts Naturally repretition free Game Physics - 1 1 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Physics simulation in videogames 3D, or 2D “soft” real-time efficiency 1 frame = 33 msec (at 30 FpS) physics = 5% - 30% max of computation time plausibility (not necessarily realism) robustness (should almost never “explode”) Physics engine: intro Game engine module executed at game run time An high-demanding computation on a very limited time budget! …but highly parallelizable “embarrassingly parallel” ==> good fit for hardware support ( just like the Rendering Engine) Game Physics - 1 2 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Game engine tasks: (Physics simulation!) Dynamics (Newtonian) for object types such as: Rigid bodies Soft bodies “ragdolling” Free-form deformation bodies: Specific solutions for Ropes Cloth Hair… Fluids Air (e.g. wind) etc Collision handling Collision detection Collision response Hardware for Physics engine To exploit a strong parallelism, you need a strongly parallel hardware! Recently: PPU “Physical Processing Unit” HW unit specialized on physics More recently: GP-GPU “General Purpose Graphics Processing Unit” Use of the graphics card for generic tasks (not related with 3D computer graphics) Ex.: Cuda (nVidia) Game Physics - 1 3 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Software: libraries / SDK HW accelerated (CUDA) HW accelerated (OpenCL) by open source, free, HW accelerated open source, free 2D! open source, free PhysX … Game Physics - 1 4 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Physics in games: cosmetics or gameplay? Just a graphic accessory? (for realism!) e.g.: particle effects (w/o feedback) secondary animations Ragdolling Or a gameplay component? e.g. physics based puzzles Popular approach in 2D (since always!) Physics in games: cosmetics or gameplay? Just a graphic accessory? (for realism!) e.g.: particle effects (w/o feedback) secondary animations Ragdolling Or a gameplay component? e.g. physics based puzzles Rising trend in 3D Game Physics - 1 5 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Physics engine: Dynamics Physics simulation (Newtonian) Revision: object = mass Object state: . position and derivative: velocity . (and momentum) . direction and angular velocity . (and angular momentum) State change: . forces => acceleration, torque Reminder: Spatial location of an object 2D Physics 3D Physics Position: Position: (x,y) (x,y,z) Orientation: Orientation: (α) – angle (scalar) quaternion or axis,angle or axis x angle or 3x3 matrix or Euler angles Game Physics - 1 6 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Newtonian dynamics: summary Actual Rate of change “with mass” What changes the “with mass” object of rate of change location (momentum) 2 2 (d / dt ) (d / dt ) Position 푝 Velocity 푣⃗ Momentum Acceleration Force 푓⃗ ̇ 푝 = (x,y,z) 푣⃗ = 푝̇ 푣⃗ 푚 푎⃗ = 푣⃗ = 푝̈ 푓⃗ = 푎⃗ 푚 ( |푣⃗| = “speed” ) Orientation Angular velocity 휔 Angular momentum Angular acc. α Torque τ (e.g. quaternion) 휔 퐼 τ = 푎⃗ 퐼 퐼 = moment of inertia (for axis) (“mechanic (“rotational inertia”) momentum”) state (is kept! inertia!) Change the state (changes, but only continuously) (no memory) A few constants per object A few quantities associated to each object constants: they don’t (usually) change input of the physical simulation, not output Mass: resistance to change of velocity Moment of Inertia: resistance to change of angular velocity Barycenter: the center of mass Game Physics - 1 7 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Mass resistance to change of velocity inertial mass also, incidentally: ability to attract every other object gravitational mass happens to be the same what you measure with a scale Unity of measure: kg, g… Moment of inertia Resistance to change of angular velocity low high (an object rotates around its barycenter) Game Physics - 1 8 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Moment of inertia Scalar moment of inertia Resistance to change of angular velocity Depends on the mass, and on its distribution the farthest one sub-mass from the axis, the > the resistance In 3D: its different for each axis of rotation It can be computed for any axis, thanks to… Moment of inertia as a 3x3 Matrix a matrix A used to extract the scalar, for any given axis given an axis a (a = unit vector), the moment of inertia is aT A a matrix A can be computed once and for all for a rigid object how: that’s beyond this course in practice: use given formulas for common shapes or sum the contributions for each sub-mass Barycenter Aka the center of mass (a position) In the discrete setting: simply the weighted average of the positions of the subparts composing an object (literally “weighted”: with their masses) Does not necessarily coincide with the origin of the local frame of that object (but it can) Game Physics - 1 9 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 State of an object Point position current Rotation orientation updated by Vector velocity physics current rates of change Rotation angular_velocity Scalar mass Matrix moment_of_inertia setup at initialization, Point barycenter constants (rarely) changed Scalar drag e.g. by scripts frictions; … see later Note: acceleration/forces/torques are not part of the state In Point position part of Transform component Rotation orientation Vector velocity the RigidBody component Rotation angular_velocity Scalar mass Matrix moment_of_inertia Adding a “RigidBody” component to a Game Object is to say: Point barycenter “please let the Phys. engine take care of this object” Scalar drag … Game Physics - 1 10 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 In (using Unity terminology) note: they are the components of the global transformation! Vector3 position part of Transform component Quaternion rotation note: speed = velocity.magnitude Vector3 velocity the RigidBody component Quaternion angularVelocity per second float mass (not per frame) Vector3 inertiaTensor Quaternion inertiaTensorRotation Vector3 centerOfMass moment of inertia matrix the Vector3 = a diagonal matrix D float drag by rotating it RTDR the final matrix … the barycenter (in object space) State of a point-particle Point position not used ! Rotation orientation Vector velocity Rotation angular_velocity Scalar mass One trend in game phys engines Matrix moment_of_inertia is to simulate point-particles only. Much simpler! Point barycenter E.g. no rotation needed! Scalar drag We will see later how to still get complex objects back (with “PBD”) … For now, we focus on this simpler case. Game Physics - 1 11 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Dynamics (Newtonian) describe the forces given the particle positions (and more) f function( p ,...) a fm/ v v adt 0 p p v dt 0 Dynamics (Newtonian) f fun( p,...) forces a f / m v v a dt 0 positions acceler. p p v dt 0 velocity Game Physics - 1 12 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 An (obvious) precisation tC = virtual time != real time e.g.: game paused t costant. Fast forward, replay, rallenty, reverse change of speed/flow direction of t occasionally, gameplay exploit this difference in spectacular ways! PoP – the sands of times serie (Ubisoft, 2003-…) Braid (Jonathan Blow, 2008) Computing physics evolution Analytical solutions: Numerical solutions: state = function( t ) 1. state( t = 0) init 2. state( t + 1) Given force functions (and acc), find the functions (pos, vel,…) in the specified relations: evolve( state ) t f (t ) funz( p(t ),...) C C 3. goto 2 a(tC ) f (tC ) / m tC v(t ) v a(t)dt C 0 0 tC p(t ) p v(t) dt C 0 0 Game Physics - 1 13 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 Analytical solutions ft(C ) function( pt ( C ),...) at() ft ()/ m C C pos, acc, vel, forces: t in function of C current time t vt() v atdt () C C 0 0 tC p() t p v () t dt C 0 0 Analytical solutions that is, find position as function p of time s.t. pt( ) function( pt ( )) / m with sometimes, of other things too (e.g. velocity). p(0) v0 Even harder! p(0) p0 Game Physics - 1 14 3D video gaming - Marco Tarini 2019-03-21 Univ Milano 2019/2020 «ballistic shooting» Simple example: of a mass, analytical solution in 2D, ignoring friction... 0 a is in this specific case: y f m one constant, 9.8 does not depend on pos v v x 0 vy x 0 p0 0 Simple example: analytical solution Solving… f (tC ) fun( p(tC ),...) a(tC ) f (tC ) / m 0 tC f (t ) m v(t ) v a(t) dt C C 0 9.8 0 tC p(t ) p v(t)dt 0 C 0 a(tC ) f (tC ) / m 0 9.8 v tC 0 v v(t ) x dt x C v v 9.8t y 0 9.8 y C tC 0 tC v v t p(t ) p v(t)dt x dt x C C 0 v 9.8t v t 9.8/ 2t 2 0 0 0 y y C C Game Physics - 1 15 3D video gaming - Marco Tarini 2019-03-21 Univ
Recommended publications
  • Agx Multiphysics Download
    Agx multiphysics download click here to download A patch release of AgX Dynamics is now available for download for all of our licensed customers. This version include some minor. AGX Dynamics is a professional multi-purpose physics engine for simulators, Virtual parallel high performance hybrid equation solvers and novel multi- physics models. Why choose AGX Dynamics? Download AGX product brochure. This video shows a simulation of a wheel loader interacting with a dynamic tree model. High fidelity. AGX Multiphysics is a proprietary real-time physics engine developed by Algoryx Simulation AB Create a book · Download as PDF · Printable version. AgX Multiphysics Toolkit · Age Of Empires III The Asian Dynasties Expansion. Convert trail version Free Download, product key, keygen, Activator com extended. free full download agx multiphysics toolkit from AYS search www.doorway.ru have many downloads related to agx multiphysics toolkit which are hosted on sites like. With AGXUnity, it is possible to incorporate a real physics engine into a well Download from the prebuilt-packages sub-directory in the repository www.doorway.rug: multiphysics. A www.doorway.ru app that runs a physics engine and lets clients download physics data in real Clone or download AgX Multiphysics compiled with Lua support. Agx multiphysics toolkit. Developed physics the was made dynamics multiphysics simulation. Runtime library for AgX MultiPhysics Library. How to repair file. Original file to replace broken file www.doorway.ru Download. Current version: Some short videos that may help starting with AGX-III. Example 1: Finding a possible Pareto front for the Balaban Index in the Missing: multiphysics.
    [Show full text]
  • Physics Simulation Game Engine Benchmark Student: Marek Papinčák Supervisor: Doc
    ASSIGNMENT OF BACHELOR’S THESIS Title: Physics Simulation Game Engine Benchmark Student: Marek Papinčák Supervisor: doc. Ing. Jiří Bittner, Ph.D. Study Programme: Informatics Study Branch: Web and Software Engineering Department: Department of Software Engineering Validity: Until the end of summer semester 2018/19 Instructions Review the existing tools and methods used for physics simulation in contemporary game engines. In the review, cover also the existing benchmarks created for evaluation of physics simulation performance. Identify parts of physics simulation with the highest computational overhead. Design at least three test scenarios that will allow to evaluate the dependence of the simulation on carefully selected parameters (e.g. number of colliding objects, number of simulated projectiles). Implement the designed simulation scenarios within Unity game engine and conduct a series of measurements that will analyze the behavior of the physics simulation. Finally, create a simple game that will make use of the tested scenarios. References [1] Jason Gregory. Game Engine Architecture, 2nd edition. CRC Press, 2014. [2] Ian Millington. Game Physics Engine Development, 2nd edition. CRC Press, 2010. [3] Unity User Manual. Unity Technologies, 2017. Available at https://docs.unity3d.com/Manual/index.html [4] Antonín Šmíd. Comparison of the Unity and Unreal Engines. Bachelor Thesis, CTU FEE, 2017. Ing. Michal Valenta, Ph.D. doc. RNDr. Ing. Marcel Jiřina, Ph.D. Head of Department Dean Prague February 8, 2018 Bachelor’s thesis Physics Simulation Game Engine Benchmark Marek Papinˇc´ak Department of Software Engineering Supervisor: doc. Ing. Jiˇr´ıBittner, Ph.D. May 15, 2018 Acknowledgements I am thankful to Jiri Bittner, an associate professor at the Department of Computer Graphics and Interaction, for sharing his expertise and helping me with this thesis.
    [Show full text]
  • Locotest: Deploying and Evaluating Physics-Based Locomotion on Multiple Simulation Platforms
    LocoTest: Deploying and Evaluating Physics-based Locomotion on Multiple Simulation Platforms Stevie Giovanni and KangKang Yin National University of Singapore fstevie,[email protected] Abstract. In the pursuit of pushing active character control into games, we have deployed a generalized physics-based locomotion control scheme to multiple simulation platforms, including ODE, PhysX, Bullet, and Vortex. We first overview the main characteristics of these physics engines. Then we illustrate the major steps of integrating active character controllers with physics SDKs, together with necessary implementation details. We also evaluate and compare the performance of the locomotion control on different simulation platforms. Note that our work only represents an initial attempt at doing such evaluation, and additional refine- ment of the methodology and results can still be expected. We release our code online to encourage more follow-up works, as well as more interactions between the research community and the game development community. Keywords: physics-based animation, simulation, locomotion, motion control 1 Introduction Developing biped locomotion controllers has been a long-time research interest in the Robotics community [3]. In the Computer Animation community, Hodgins and her col- leagues [12, 7] started the many efforts on locomotion control of simulated characters. Among these efforts, the simplest class of locomotion control methods employs re- altime feedback laws for robust balance recovery [12, 7, 14, 9, 4]. Optimization-based control methods, on the other hand, are more mathematically involved, but can incor- porate more motion objectives automatically [10, 8]. Recently, data-driven approaches have become quite common, where motion capture trajectories are referenced to further improve the naturalness of simulated motions [14, 10, 9].
    [Show full text]
  • Physics Engine Design and Implementation Physics Engine • a Component of the Game Engine
    Physics engine design and implementation Physics Engine • A component of the game engine. • Separates reusable features and specific game logic. • basically software components (physics, graphics, input, network, etc.) • Handles the simulation of the world • physical behavior, collisions, terrain changes, ragdoll and active characters, explosions, object breaking and destruction, liquids and soft bodies, ... Game Physics 2 Physics engine • Example SDKs: – Open Source • Bullet, Open Dynamics Engine (ODE), Tokamak, Newton Game Dynamics, PhysBam, Box2D – Closed source • Havok Physics • Nvidia PhysX PhysX (Mafia II) ODE (Call of Juarez) Havok (Diablo 3) Game Physics 3 Case study: Bullet • Bullet Physics Library is an open source game physics engine. • http://bulletphysics.org • open source under ZLib license. • Provides collision detection, soft body and rigid body solvers. • Used by many movie and game companies in AAA titles on PC, consoles and mobile devices. • A modular extendible C++ design. • Used for the practical assignment. • User manual and numerous demos (e.g. CCD Physics, Collision and SoftBody Demo). Game Physics 4 Features • Bullet Collision Detection can be used on its own as a separate SDK without Bullet Dynamics • Discrete and continuous collision detection. • Swept collision queries. • Generic convex support (using GJK), capsule, cylinder, cone, sphere, box and non-convex triangle meshes. • Support for dynamic deformation of nonconvex triangle meshes. • Multi-physics Library includes: • Rigid-body dynamics including constraint solvers. • Support for constraint limits and motors. • Soft-body support including cloth and rope. Game Physics 5 Design • The main components are organized as follows Soft Body Dynamics Bullet Multi Threaded Extras: Maya Plugin, Rigid Body Dynamics etc. Collision Detection Linear Math, Memory, Containers Game Physics 6 Overview • High level simulation manager: btDiscreteDynamicsWorld or btSoftRigidDynamicsWorld.
    [Show full text]
  • Physics Application Programming Interface
    PHI: Physics Application Programming Interface Bing Tang, Zhigeng Pan, ZuoYan Lin, Le Zheng State Key Lab of CAD&CG, Zhejiang University, Hang Zhou, China, 310027 {btang, zgpan, linzouyan, zhengle}@cad.zju.edu.cn Abstract. In this paper, we propose to design an easy to use physics applica- tion programming interface (PHI) with support for pluggable physics library. The goal is to create physically realistic 3D graphics environments and inte- grate real-time physics simulation into games seamlessly with advanced fea- tures, such as interactive character simulation and vehicle dynamics. The actual implementation of the simulation was designed to be independent, interchange- able and separated from the user interface of the API. We demonstrate the util- ity of the middleware by simulating versatile vehicle dynamics and generating quality reactive human motions. 1 Introduction Each year games become more realistic visually. Current generation graphics cards can produce amazing high-quality visual effects. But visual realism is only half the battle. Physical realism is another half [1]. The impressive capabilities of the latest generation of video game hardware have raised our expectations of not only how digital characters look, but also they behavior [2]. As the speed of the video game hardware increases and the algorithms get refined, physics is expected to play a more prominent role in video games. The long-awaited Half-life 2 impressed the players deeply for the amazing Havok physics engine[3]. The incredible physics engine of the game makes the whole game world believable and natural. Items thrown across a room will hit other objects, which will then react in a very convincing way.
    [Show full text]
  • Systematic Literature Review of Realistic Simulators Applied in Educational Robotics Context
    sensors Systematic Review Systematic Literature Review of Realistic Simulators Applied in Educational Robotics Context Caio Camargo 1, José Gonçalves 1,2,3 , Miguel Á. Conde 4,* , Francisco J. Rodríguez-Sedano 4, Paulo Costa 3,5 and Francisco J. García-Peñalvo 6 1 Instituto Politécnico de Bragança, 5300-253 Bragança, Portugal; [email protected] (C.C.); [email protected] (J.G.) 2 CeDRI—Research Centre in Digitalization and Intelligent Robotics, 5300-253 Bragança, Portugal 3 INESC TEC—Institute for Systems and Computer Engineering, 4200-465 Porto, Portugal; [email protected] 4 Robotics Group, Engineering School, University of León, Campus de Vegazana s/n, 24071 León, Spain; [email protected] 5 Universidade do Porto, 4200-465 Porto, Portugal 6 GRIAL Research Group, Computer Science Department, University of Salamanca, 37008 Salamanca, Spain; [email protected] * Correspondence: [email protected] Abstract: This paper presents a systematic literature review (SLR) about realistic simulators that can be applied in an educational robotics context. These simulators must include the simulation of actuators and sensors, the ability to simulate robots and their environment. During this systematic review of the literature, 559 articles were extracted from six different databases using the Population, Intervention, Comparison, Outcomes, Context (PICOC) method. After the selection process, 50 selected articles were included in this review. Several simulators were found and their features were also Citation: Camargo, C.; Gonçalves, J.; analyzed. As a result of this process, four realistic simulators were applied in the review’s referred Conde, M.Á.; Rodríguez-Sedano, F.J.; context for two main reasons. The first reason is that these simulators have high fidelity in the robots’ Costa, P.; García-Peñalvo, F.J.
    [Show full text]
  • Physics Tutorial 1: Introduction to Newtonian Dynamics
    Physics Tutorial 1: Introduction to Newtonian Dynamics Summary The concept of the Physics Engine is presented. Linear Newtonian Dynamics are reviewed, in terms of their relevance to real time game simulation. Different types of physical objects are introduced and contrasted. Rotational dynamics are presented, and analogues drawn with the linear case. Importance of environment scaling is introduced. New Concepts Linear Newtonian Dynamics, Angular Motion, Particle Physics, Rigid Bodies, Soft Bodies, Scaling Introduction The topic of this set of tutorials is simulating the physical behaviour of objects in games through the development of a physics engine. The previous module has taught you how to draw objects in complex scenes on the screen, and now we shift our focus to moving those objects around and enabling them to interact. Broadly speaking a physics engine provides three aspects of functionality: • Moving items around according to a set of physical rules • Checking for collisions between items • Reacting to collisions between items Note the use of the word item, rather than object this is intended to suggest that physics can be applied to any and all elements of a game scene { objects, characters, terrain, particles, etc., or any part thereof. An item could be a crate in a warehouse, the floor of the warehouse, the limb of a jointed character, the axle of a racing car, a snowflake particle, etc. 1 A physics engine for games is based around Newtonian mechanics which can be summarised as three simple rules of motion that you may have learned at school. These rules are used to construct differential equations describing the behaviour of our simulated items.
    [Show full text]
  • Physics-Based Simula1on
    Physics-based Simula1on • simple (independent par1cles), or complex (robust colliding, stacking, sliding 3D rigid bodies) • many many simulators! – PhysX (Unity, Unreal), Bullet, Open Dynamics Engine, MuJoCo, Havok, Box2D, Chipmunk, OpenSim, RBDL, Simulink (MATLAB), ADAMS, SD/FAST, DART, Vortex, SOFA, Avatar, Project Chrono, Cannon.js, … – many course projects, theses, abandon-ware Resources • hUps://processing.org/examples/ see “Simulate”; 2D par1cle systems • Non-convex rigid bodies with stacking 3D collision processing and stacking hUp://www.cs.ubc.ca/~rbridson/docs/rigid_bodies.pdf • Physically-based Modeling, course notes, SIGGRAPH 2001, Baraff & Witkin hUp://www.pixar.com/companyinfo/research/pbm2001/ • Doug James CS 5643 course notes hUp://www.cs.cornell.edu/courses/cs5643/2015sp/ • Rigid Body Dynamics, Chris Hecker hUp://chrishecker.com/Rigid_Body_Dynamics • Video game physics tutorial hUps://www.toptal.com/game/video-game-physics-part-i-an-introduc1on-to-rigid-body-dynamics • Box2D javascript live demos hUp://heikobehrens.net/misc/box2d.js/examples/ • Rigid body collisions javascript demo hUps://www.myphysicslab.com/engine2D/collision-en.html • Rigid Body Collision Reponse, Michael Manzke, course slides hUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf • Rigid Body Dynamics Algorithms. Roy Featherstone, 2008 • Par1cle-based Fluid Simula1on for Interac1ve Applica1ons, SCA 2003, PDF • Stable Fluids, Jos Stam, SIGGRAPH 1999. interac1ve demo: hUps://29a.ch/2012/12/16/webgl-fluid-simula1on Simula1on
    [Show full text]
  • Physically Based Character Simulation – Rag Doll Behaviour in Computer Games
    Physically Based Character Simulation – Rag Doll Behaviour in Computer Games Johan Gästrin TRITA-NA-E04008 NADA Numerisk analys och datalogi Department of Numerical Analysis KTH and Computer Science 100 44 Stockholm Royal Institute of Technology SE-100 44 Stockholm, Sweden Physically Based Character Simulation – Rag Doll Behaviour in Computer Games Johan Gästrin TRITA-NA-E04008 Master’s Thesis in Computer Science (20 credits) at the School of Computer Science and Engineering, Royal Institute of Technology year 2004 Supervisor at Nada was Kai-Mikael Jää-Aro Examiner was Lars Kjelldahl Abstract The focus of this thesis is the feature known in the games industry as rag doll behaviour. Rag doll is the feature that, in a computer game, lets a character be influenced by actual physical laws. This enables the computer game characters to move in a more realistic way. It also gives the characters an infinite amount of possible motion patterns in contrast to animated motion. The interaction with the environment also enables more realism and better feedback. Rag doll behaviour and the techniques necessary for implementation in real-time 3D simulation are investigated. Many different approaches have been used during the last few years to simulate physics in computer games. Some are more physically correct than others. We describe and discuss benefits and drawbacks of the most accepted and used techniques that are suitable for simulation in real time, i.e. a computer game. We will furthermore investigate how vertex blending can be used to mix standard animations with physical calculations to enhance computer games. Fysikbaserad figursimulering ’Rag Doll’-beteende i dataspel Sammanfattning Detta examensarbete fokuserar på den egenskap som inom dataspels- industrin är känd som rag doll-beteende.
    [Show full text]
  • 10: Multiple Contact Resolution 22/02/2016
    10: MULTIPLE CONTACT RESOLUTION 22/02/2016 CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 2 Image © 2003 E. Guendelman, R. Bridson and R. Fedkiw CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 3 COMPLEX CONTACT MANIFOLDS Most contacts usually not just a single point colliding but contact manifold Contact Force and Equivalence Principle [Erleben05] : Equivalent forces or impulses exist such that when they are applied to the convex hull of the contact region, the same resulting motion is obtained, which would have resulted from integrating the true contact force or impulse over the actual contact region [Erleben05] Erleben, K., Sporring, J., Henriksen, K., and Dohlman, H., Physics Based Animation. Charles River Media, August 9, 2005. CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE Images © 2014 John Dingliana 22/02/2016 4 CONTACT REDUCTION Contacts reduced to those on the convex hull of the manifold. Use K-means clustering Then further reduce those that and cluster reduction cause minimal change to the hull area Pre-process features in a scene making edges inactive if not important for collisions e.g. interior edges, concave edges Use initial guess and then warm starting in subsequent frames exploiting temporal coherency. [Morvanszky04] Morvanszky and Terdiman. Fast Contact Reduction for Dynamics Simulation. Game Programming Gems 4. Charles River Media. 2004. pp 253-263 CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 5 PENALTY METHODS Amongst the earliest solutions and still widely used Easy to implement compared to other methods Some problems for rigid objects Objects too springy → not plausible Increase stiffness → leads to instability for large time steps Increase # timesteps → computationally expensive Images © Erleben et al & Charles River Media 2005.
    [Show full text]
  • Physics-Based Simulabon
    Physics-based Simulaon • simple (independent par1cles), or complex (robust colliding, stacking, sliding 3D rigid bodies) • many many simulators! – PhysX (Unity, Unreal), Bullet, Open Dynamics Engine, MuJoCo, Havok, Box2D, Chipmunk, OpenSim, RBDL, Simulink (MATLAB), ADAMS, SD/FAST, DART, Vortex, SOFA, Avatar, Project Chrono, Cannon.js, … – many course projects, theses, abandon-ware Resources • hUps://processing.org/examples/ see “Simulate”; 2D par1cle systems • Non-convex rigid bodies with stacking 3D collision processing and stacking hUp://www.cs.ubc.ca/~rbridson/docs/rigid_bodies.pdf • Physically-based Modeling, course notes, SIGGRAPH 2001, Baraff & Witkin hUp://www.pixar.com/companyinfo/research/pbm2001/ • Doug James CS 5643 course notes hp://www.cs.cornell.edu/courses/cs5643/2015sp/ • Rigid Body Dynamics, Chris Hecker hUp://chrishecker.com/Rigid_Body_Dynamics • Video game physics tutorial hUps://www.toptal.com/game/video-game-physics-part-i-an-introduc1on-to-rigid-body-dynamics • Box2D javascript live demos hUp://heikobehrens.net/misc/box2d.js/examples/ • Rigid body collisions javascript demo hUps://www.myphysicslab.com/engine2D/collision-en.html • Rigid Body Collision Reponse, Michael Manzke, course slides hUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf • Rigid Body Dynamics Algorithms. Roy Featherstone, 2008 • Par1cle-based Fluid Simulaon for Interac1ve Applicaons, SCA 2003, PDF • Stable Fluids, Jos Stam, SIGGRAPH 1999. interac1ve demo: hUps://29a.ch/2012/12/16/webgl-fluid-simulaon Simulaon Basics
    [Show full text]
  • Physics and Motion the Pedagogical Problem
    the gamedesigninitiative at cornell university Lecture 17 Physics and Motion The Pedagogical Problem Physics simulation is a very complex topic No way I can address this in a few lectures Could spend an entire course talking about it CS 5643: Physically Based Animation This is why we have physics engines Libraries that handle most of the dirty work But you have to understand how they work Examples: Farseer, Box2D, Bullet the gamedesigninitiative 2 Physics and Motion at cornell university The Compromise Best can do is give the problem description Squirrel Eiserloh’s Problem Overview slides http://www.essentialmath.com/tutorial.htm Hopefully allow you to read engine APIs Understand the limitations of physics engines Learn where to go for other solutions Will go more in depth on a few select topics Example: Collisions and restitution the gamedesigninitiative 3 Physics and Motion at cornell university Physics in Games Moving objects about the screen Kinematics: Motion ignoring external forces (Only consider position, velocity, acceleration) Dynamics: The effect of forces on the screen Collisions between objects Collision detection: Did a collision occur? Collision resolution: What do we do? the gamedesigninitiative 4 Physics and Motion at cornell university Take Away for Today Difference between kinematics and dynamics How do each of them work? When is one more appropriate than another? What dynamics do physics engines provide? What is a particle system? When is it used? What is a constraint solver? When is it
    [Show full text]