Physics - Guest Lecture

  1. AABB (AxisAlignedBoundBox) and Ray Casting

  2. AABB: A rectangle box with the smallest possible measure is defined around the current object. When there is an overlap of the defined boxes which means the coordinates overlaps or intersects with each other, a collision is detected and the box is rendered to the nearest point at the other object.
    Ray Casting: Drawing (hidden) lines from an object to other objects within the world to detected collisions and this could also be used for measuring the distance between objects. This method can predict collisions in advance

1 Like
  1. Name 2 methods for detecting collisions in a game.
    AABB/Ray Casting

  2. Describe roughly how they work.
    Ray Casting calculates distances between objects
    AABB detects collisions when a box collides with an object

1 Like

AABB: checks collision between 2 bounding boxes of objects. Detects collision after it happened. RayCasting: calculate distances to objects. Detects potential collision before it happens

1 Like
  1. Name 2 methods for detecting collisions in a game.
    AABB Collision and Ray casting
  2. Describe roughly how they work.
    AABB Collision allows for detecting items like a bouncing ball hitting walls and floors in a game. Ray Casting helps anticipate a collision, as well as knowing if a character is off the ground or near a cliff.
  1. Name 2 methods for detecting collisions in a game.
    AABB (AxisAlignedBoundBox) and Ray casting

  2. Describe roughly how they work.
    RayCasting: calculate distances to objects. Detects potential collision before it happens.
    AABB: A rectangle box with the smallest possible measure is defined around the current object. When there is an overlap of the defined boxes which means the coordinates overlaps or intersects with each other, a collision is detected and the box is rendered to the nearest point at the other object.

  1. Name 2 methods for detecting collisions in a game.
    AABB and Ray casting
  2. Describe roughly how they work.
    AABB is based on the bonding box of the objects for simple overlay detection. Ray casting works by sending a ray to calculate the distance between the sprites and is good for anticipating the collision.
  1. Name 2 methods for detecting collisions in a game.
    AABB Collision & Ray Casting

  2. Describe roughly how they work.

  • AABB Collision: It’s an algorithm that detects an objects bounding box. These boxes are always aligned with the x and y real world axis. It’s only ideal for a game that needs rectangular collision.
  • Ray Casting: Projects a line with a given length from an object and check if it goes through anything. This is used to calculate distances between objects. Allows program to anticipate a collision.
  1. AABB and raycasting
  2. AABB uses hitbox detection that detect the moment they overlap with other hitboxes. Raycasting measures the distance between the object and other object.
1 Like

AABB collision algorithm: collision is detected when boxes overlap. Suitable for box-shaped objects.
Ray casting: this is basically all about calculating distances between objects. When a beam is sent from the object in all directions to see if it collides with(or is close) to an object.

1 Like
  1. Name 2 methods for detecting collisions in a game.

AABB and Ray Casting.

  1. Describe roughly how they work.

AABB triggers a collision when two objects overlap while ray casting approximate how far away the next collision is in pixels.

  1. Name 2 methods for detecting collisions in a game.
    1 AABB
    2 Ray Casting
  2. Describe roughly how they work.
    AABB uses collision detection by checking for overlapping sprites. Ray Casting uses the distance between sprites to anticipate and detect collisions.
  1. AABC, Ray Casting
  2. AABB triggered when one rectangular shape overlaps another,
    Ray Casting projects a line from an object and detects how far another object is and when collision will occur

AABB and raycast. AABB is simple collision detection at the moment it happens. Raycast measures the distance between objects and uses that to determine collisions.

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

Helpful and concise video!

AABB detects whether two objects overlap and.

Ray casting draws a line to determine distance between objects and predict if a collision will happen

  1. AABB and raycasting.
  2. AABB is a very lightweight colision system that checks if any entity hitboxes are intersecting with another.

A raycast is an invisible beam used to calculate distances between objects and it can be used to check for collisions more precisely then AABB.

  1. AABB and Ray Casting.
  2. The computer have to calculate if one object is overlapping another (AABB) or projecting lines to calculate the distance between objects.
1 Like
  • Name 2 methods for detecting collisions in a game.
    AABB collisions and Ray Casting

  • Describe roughly how they work.
    AABB checks if two objects overlap with one another
    Raycast anticipates collisions by measuring distance between objects.

  1. Name 2 methods for detecting collisions in a game.

AABB (Axis-Aligned Bounding Box) or Ray Casting.

  1. Describe roughly how they work.

AABB - works by comparing the x-axis and y-axis in relation to the object’s width and height respectively to establish whether a collision was made or not.

e.g. (Source: https://tutorialedge.net/gamedev/aabb-collision-detection-tutorial/)

if(player1.x < player2.x + player2.width &&
    player1.x + player1.width > player2.x &&
    player1.y < player2.y + player2.height &&
    player1.y + player1.height > player2.y)
{
    System.out.println("Collision Detected");
}

Ray Casting - projects a line (ray) from a given object and calculates the distance between this object to another that interacts with the line.

  1. Name 2 methods for detecting collisions in a game.
    AABB (Axis Aligned Bounding Box) and Ray Casting.

  2. Describe roughly how they work.

AABB = each object is thought to be inside a rectangular box aligned with the x & y axes. Width and height of the objects are also known so collisions can be detected easily.

Ray Casting - extend a straight line from an object and check if it collides with anything else. It allows to know about an upcoming collision before it actually happens.