Done already for your convenience!

Slides:



Advertisements
Similar presentations
AP Physics C Mechanics Review.
Advertisements

© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
GameCamp! and Game Davis Creating a 2D Platformer in Unity.
Done already for your convenience! Telerik School Academy Unity 2D Game Development.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
KINETIC ENERGY, WORK, PRINCIPLE OF WORK AND ENERGY
Useful Equations in Planar Rigid-Body Dynamics
Problem 8. Pebble skipping. Problem It is possible to throw a flat pebble in such a way that it can bounce across a water surface. What conditions must.
3.7. O THER G AME P HYSICS A PPROACHES Overview of other game engine physics approaches.
Introduction to virtual engineering László Horváth Budapest Tech John von Neumann Faculty of Informatics Institute of Intelligent Engineering.
Newton’s Laws - continued
UFCEKU-20-3Web Games Programming Unity 3D Physics Colliders and Object Collisions.
Spring Topic Outline for Physics 1 Spring 2011.
Chapter 9: Rotational Dynamics
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Collisions & Contact.
Newton’s Laws - continued Friction, Inclined Planes, N.T.L., Law of Gravitation.
Review for Test #3  Responsible for: - Chapters 9 (except 9.8), 10, and 11 (except 11.9) - The spring (6.2, 7.3, ) - Problems worked in class,
COSMOSMotion Slides.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Static Equilibrium and Elasticity
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Unity3D Physics April 3, 2015 Comp Game Design Michael Shah.
Kinematics of a Rubber Bouncy Ball A Simulation of a Rubber Bouncy Ball Yun Chung Lu Physics 210 Final Project Presentation Affiliation: University of.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 29 Soft Bodies and Rigid Bodies.
Physics 218 Lecture 8: Dynamics Alexei Safonov.
Game Development with Unity3D
Advanced Computer Graphics Rigid Body Simulation
Computational Geometry
2D Simulation of Rigid Bodies
Google APIs and Facebook API
Basic Math in 2D Game Development
Unity3D for Mobile Sprites, Camera, Physics
Unit Two: Dynamics Section 1: Forces.
2D Graphics and Animations in Unity 3D
Manipulator Dynamics 1 Instructor: Jacob Rosen
Mechanics Review – SEMESTER 1
Computer Animation Ying Zhu Georgia State University
EECE 478 Game Physics.
Binary, Decimal and Hexadecimal Numbers
Software Quality Assurance
Physics 111 Practice Problem Solutions 05 Force and Motion II – Friction, Circular Motion SJ 8th Ed.: Ch. 5.8, 6.1 – 6.3 Contents: 6-4E, 6-5E*, 6-19P,
Newton’s Laws - continued
3.7. Other Game Physics Approaches
RECTANGULAR COORDINATES
Chapter 6 Force and Motion II
Projectiles in Unreal Engine 4
Manipulator Dynamics 2 Instructor: Jacob Rosen
Creating & Using Sprites Adding Colliders
Week 6: Time and triggers!
Two-Dimensional Rotational Kinematics 8.01 W09D1
Two-Dimensional Rotational Kinematics W09D1 Young and Freedman: 1
Computer Animation Algorithms and Techniques
Newton’s Laws - continued
Fundaments of Game Design
Motion and Force. Motion and Force Chapter Four: Forces 4.1 Forces 4.2 Friction 4.3 Forces and Equilibrium.
Newton’s Laws - continued
Advanced Games Development Game Physics
Newton’s Laws - continued
Newton’s Laws - continued
CO Games Concepts Week 12 Collision Detection
Rigid Body: Rotational and Translational Motion; Rolling without Slipping 8.01 W11D1 Today’s Reading Assignment Young and Freedman: 10.3.
Newton’s Laws - continued
Motion and Force. Motion and Force Chapter Four: Forces 4.1 Forces 4.2 Friction 4.3 Forces and Equilibrium.
A general method for solving problems involving forces
Rigid Body: Rotational and Translational Motion; Rolling without Slipping 8.01 W11D1 Today’s Reading Assignment Young and Freedman:
GPAT – Chapter 7 Physics.
A Gentle Introduction to Unity 2D Game Programming
Presentation transcript:

Done already for your convenience! 2D Physics Engine Done already for your convenience! Unity 2D Game Development Telerik Academy Plus http://academy.telerik.com

Three Seminars Part 1 Part 2 Part 3 * Three Seminars Part 1 Intro to Unity 3D and 2D Game Development Basic Math for 2D Game Development 2D Graphics and Animations Part 2 2D Physics Engine Game Scripting with C# UI and Audio Part 3 Building a 2D Game (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Table of Contents 2D Physics Overview RigidBody 2D Colliders 2D Forces * Table of Contents 2D Physics Overview RigidBody 2D Colliders 2D Circle Collider 2D Box Collider 2D Polygon Collider 2D Edge Collider 2D Forces (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Rigidbodies, Colliders, Joints, etc. * 2D Physics Overview Rigidbodies, Colliders, Joints, etc. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview All physics elements are normal components * 2D Physics Overview All physics elements are normal components Just add them to a game object Set all needed properties The physics engine will start using them Enjoy the effects  (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Rigidbodies * 2D Physics Overview Rigidbodies Main component for the Physics Engine to start With Rigidbody the object will start to respond to gravity If you enable Rigidbody, you should not try to change the Transform part of the object Instead, you should apply forces and let the engine do the heavy lifting If you need non-moving by the engine Rigidbody, check “Is Kinematic” option (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Colliders * 2D Physics Overview Colliders Define the shape of an object in terms of physical collisions Most of the time invisible Use Box Collider and Circle Collider whenever possible for performance reasons Otherwise use Polygon Collider Colliders with Rididbody are dynamic colliders Colliders without Rigidbody are the static environment in your game – walls, floor, etc. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Physic Materials * 2D Physics Overview Physic Materials Materials define the physics collision effect For example – ice is slippery, rubber has friction Usually parameters are found by trial-error In 2D there are two parameters Friction – friction coefficient Bounciness – the degree to which collisions rebound from the surface 0 – no bounce effect 1 – full bounce effect with no loss of energy (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Joints Attaching two rigidbodies to a fixed point * 2D Physics Overview Joints Attaching two rigidbodies to a fixed point Allow restricted movement Rotation by the three axes Translation by the three axes Stretching like a spring You can set joint to break if certain force is applied (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Different Types of Colliders * 2D Physics Overview Different Types of Colliders Trigger Collider – does not respond to physics calculations but sends event to which you can subscribe from the scripts OnCollisionEnter2D / OnTriggerEnter2D – when two colliders starts colliding for the first time OnCollisionStay2D / OnTriggerStay2D – when two colliders are colliding OnCollisionExit2D / OnTriggerExit2D – when colliders are no longer colliding Simply select “Is Trigger” (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Different Types of Colliders * 2D Physics Overview Different Types of Colliders Static Collider – object with collider but no Rigidbody Used for level geometry and should never move Should not be disabled or enabled If you do, major performance decrease may occur Also – calculation errors in the engine may occur If you want to alter it – add Rigidbody to it (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Different Types of Colliders * 2D Physics Overview Different Types of Colliders Rigidbody Collider – object with collider and Rigidbody Most common case Fully simulated by the physics engine Reacts to collisions Reacts to forces from script Collide with all other objects (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Overview Different Types of Colliders * 2D Physics Overview Different Types of Colliders Kinematic Rigidbody Collider – object with collider and Kinematic Rigidbody Has “Is Kinematic” property set Does not react to collisions and forces from the engine Should be moved by a script They behave like static colliders but can be enabled/disabled/moved when needed (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

RigidBody 2D How to use it? * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

RigidBody 2D Rigidbody 2D * RigidBody 2D Rigidbody 2D Attach it to objects controlled by the physics In 2D only the XY plane takes effect for translation and the Z axis for rotation (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

RigidBody 2D Properties of RidigBody 2D Mass – mass of the object * RigidBody 2D Properties of RidigBody 2D Mass – mass of the object Linear Drag / Angular Drag – coefficient for movements Gravity Scale – whether the gravity should be more or less on this object Fixed Angle – can be rotated or not? Is Kinematic – is the body moved by forces and collisions (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Box Collider 2D How to use it? * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Box Collider 2D Box Collider 2D Rectangular shaped collider * Box Collider 2D Box Collider 2D Rectangular shaped collider Attached to an game object With or without a sprite (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Box Collider 2D Properties of Box Collider 2D * Box Collider 2D Properties of Box Collider 2D Material – the material to use for the collider Is Trigger – whether events should be sent Offset – local offset of the collider geometry Size – the size of the rectangular shape (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Circle Collider 2D How to use it? * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Circle Collider 2D Circle Collider 2D Circular shaped collider * Circle Collider 2D Circle Collider 2D Circular shaped collider Attached to an game object With or without a sprite (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Circle Collider 2D Properties of Circle Collider 2D * Circle Collider 2D Properties of Circle Collider 2D Material – the material to use for the collider Is Trigger – whether events should be sent Offset – local offset of the collider geometry Radius – the radius of the circular shape (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Polygon and Edge Colliders 2D * Polygon and Edge Colliders 2D How to use them? (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Polygon and Edge Colliders 2D * Polygon and Edge Colliders 2D Polygon Collider 2D and Edge Collider 2D Complex shaped collider Attached to an game object With or without a sprite Difficult to compute – performance impact (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Circle Collider 2D Properties of Polygon Collider 2D and Circle Collider 2D Material – the material to use for the collider Is Trigger – whether events should be sent Offset – local offset of the collider geometry (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Forces How to use them? (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Forces Two types of forces They both are added to a Rigidbody 2D * Forces Two types of forces Constant Force 2D Effectors (Area Effector 2D for example) They both are added to a Rigidbody 2D Applied every Update of the game Good for in-game mechanics Have acceleration options (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Summary Rigidbody – component used by the physics engine for calculations Colliders – components to register any colliding objects in the game Different types of colliders – static, kinematic, etc. Other physics elements – joint, forces, etc. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Physics Engine http://academy.telerik.com

Free Trainings @ Telerik Academy C# Programming @ Telerik Academy csharpfundamentals.telerik.com Telerik Software Academy academy.telerik.com Telerik Academy @ Facebook facebook.com/TelerikAcademy Telerik Software Academy Forums forums.academy.telerik.com