Physics - Guest Lecture

Welcome to this assignment. Please answer the following questions from the lecture. Feel free to ask questions here as well if you need the help.

  1. Name 2 methods for detecting collisions in a game.
  2. Describe roughly how they work.
1 Like
  1. Two methods for detecting collisions are AABB or Ray Casting
  2. AABB is box method based on x/y axis. Good for simple collision detection.
    Ray Casting is a method where you calculate the distance between each objects by extending a line from one object to another. Ray Casting can anticipate a collision where AABB only knows the frame it happens.
2 Likes

**Name 2 methods for detecting collisions in a game.
AABB collision and Ray casting
** Describe roughly how they work.
AABB

  • used for rectangle object
  • when the position of two object is overlapped, program knows that collision happened and send the moving object to the new position
  • good for simple collision

Ray casting

  • sending a ray to calculate the distance between the main object to the surrounding
  • anticipating collision
1 Like
  1. Name 2 methods for detecting collisions in a game.
    AABB Collisions and Ray Casting are the two methods.

  2. Describe roughly how they work.
    AABB uses rectangular bounding boxes to determine if an overlap of sprites exist as it happens.
    Ray casting determines the distance between sprites as measured straight from one sprite outward. This allows for anticipating collisions as opposed to AABB as it happens noticing.

AABB - simple rectangular box collision detection and adjustment
Ray Casting - collisions with reference to sprite distances calculated in anticipation of a collision

  1. Name 2 methods for detecting collisions in a game.
    Ray casting, and intersection/overlap
  2. *Describe roughly how they work.
    Ray casting is measuring distances to other objects, overlap (AABB mentioned though spherical can be useful as well) is determining when the bounding boxes of two objects overlap/intersect.

Name 2 methods for detecting collisions in a game & describe roughly how they work.
Ray casting - where a beam is sent from the character in a direction to see if it collides with or is close to an object.
AABB collision - where the boxes overlap and this is when a collision is detected.

  1. Name 2 methods for detecting collisions in a game.
    AABB (axis aligned bounding box) : for rectangular shapes without rotation
    separating axis theorem (SAT): used for convex shapes

  2. Describe roughly how they work.
    they both work by checking if there is any overlap between the shapes

  1. Name 2 methods for detecting collisions in a game.
    AABB and Ray Casting are the two methods used in 2D games for collision detection.

  2. Describe roughly how they work.
    AABB detects when the position of two rectangular objects are overlapped
    Ray Casting anticipates collisions between objects by projecting a ray which measures how far away another object is in all directions.

  1. AABB & Ray Casting.

  2. AABB is used for simple rectangular objects that overlap. Ray Casting is used for collisions between objects. It does this by using a ray to measure how far away an object is in all directions.

The two methods are:

  1. AABB: AABB surrounds each objects with a rectangle and checks for edge collisions (overlap) based on the game’s frame rate.

  2. Ray casting: Ray casting is used to project distance from other objects based on lines projecting from the current object. Ray casting can be used to anticipate a collision while AABB can only tell you if a collision occurred.

1.) AABB and raycasting are 2 examples of handle/detecting collisions
2.) Both methods have (dis)advantages - AABB is simple and fast, by checking the bounding box surrounding the sprite(s), only coordinates (position) and dimension (height/width) of sprites/walls, etc. are used and easy calculated. Raycasting sends “beams” from the sprite to determine the distance to other sprites, walls, etc. So it’s possible to get more/better informations about postitions and distances, esp. when using more rays. But it possible will cost more time to calulate.

Remark: Collision detection is sometimes hard to do (esp. in complex scenes) und can produce glitches in the game :slight_smile:

  1. Overlapping and Ray casting.

    1. With overlapping the collision is detected as soon as two objects overlap. Then the rendering engine puts the active object at a predefined position and predefined reaction is activated - bouncing, etc.
    1. Ray casting is a more precise way to tell whether and where the collisions might occur. It works by calculating distances to the objects and we can know possible collision outcomes in advance/
  1. Two methods are AABB, or Ray Casting
  2. AABB actually lets the collision happen and is very simple. Ray Casting calculates distances around the object and projects collisions before they happen.

AABB collisions and Ray Casting

AABB collisions:
Collisions are detected by boxing up the sprites and judging whether they collide in each other or not

Ray Casting:
Sends out lines from the model to measure the distance between another model. It is possible to anticipate collisions

  1. AABB (Axis - Aligned Bounding Box) and SAT (Separating Axis Theorem)
  2. AABB means that any space between to objects means there will be no collision, for example, if you have two rectangles there will be no collision until the moment the edges of each rectangle touch each other. Any gap means no collision.

SAT is a method to determine if two convex shapes are intersecting. SAT is a fast generic algorithm that can remove the need to have collision detection code for each shape type pair thereby reducing code and maintenance.

  1. AABB Collisions and Ray Casting.
  2. AABB uses rectangular bounding boxes to determine if an overlap of sprites exist as it happens.
    Ray casting determines the distance between sprites as measured straight from one sprite outward.
    This allows for anticipating collisions as opposed to AABB as it happens noticing.
  1. Two methods of detecting collisions in a game are AABB and Ray Casting.

  2. AABB stands for Access Align Bounding Box. This simply means that we check for the position of the game objects bounding boxes. These angles are always aligned with the X and Y works axis’. It is ideal for a game where you only need rectangular colliders.

Ray Casting is where a line is projected from out of an object to determine if it collides with anything else and at what distance. This can be used to determine the characters position in the game. Rays allow you find the distance of an object and the closest edge of another.

  1. Two types of collision detection are Ray Casting and Separation Axis Theorem (SAT).

  2. Ray Casting detects collisions by utilizing a ray cast from game objects, allowing collisions to be anticipated.
    Seperation Axis Theorem detects the overlap of convexed polygons. Best used with 3D games, as oppesed to Axis Aligned Bounding Boxes (AABB) which only detects collisions after that have occurred during a frame.

2 Likes
1. Name 2 methods for detecting collisions in a game.
	a. AABB
	b. Ray Casting
2. Describe roughly how they work.
	a. AABB detects collision when the bounding box collide with an object
	b. ray casting calculate distances between objects
1 Like