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.
- Name 2 methods for detecting collisions in a game.
- Describe roughly how they work.
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.
**Name 2 methods for detecting collisions in a game.
AABB collision and Ray casting
** Describe roughly how they work.
AABB
Ray casting
Name 2 methods for detecting collisions in a game.
AABB Collisions and Ray Casting are the two methods.
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
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.
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
Describe roughly how they work.
they both work by checking if there is any overlap between the shapes
Name 2 methods for detecting collisions in a game.
AABB and Ray Casting are the two methods used in 2D games for collision detection.
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.
AABB & Ray Casting.
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:
AABB: AABB surrounds each objects with a rectangle and checks for edge collisions (overlap) based on the game’s frame rate.
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
Overlapping and Ray casting.
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
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.
Two methods of detecting collisions in a game are AABB and Ray Casting.
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.
Two types of collision detection are Ray Casting and Separation Axis Theorem (SAT).
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.
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