diff --git a/coresdk/src/coresdk/collisions.h b/coresdk/src/coresdk/collisions.h index ad2f428e..c03d5699 100644 --- a/coresdk/src/coresdk/collisions.h +++ b/coresdk/src/coresdk/collisions.h @@ -17,6 +17,45 @@ #include "types.h" namespace splashkit_lib { + + /** + * Tests if a bitmap drawn at x,y would draw a pixel at the passed in point. Use + * to check collisions between a point and a bitmap. + * + * @param bmp The bitmap to test. + * @param bmp_x The x location where the bitmap is drawn + * @param bmp_y The y location where the bitmap is drawn + * @param x The x location of the point to test + * @param y The y location of the point to test + * @returns True if drawing the bitmap, at the indicated location, + * will draw a pixel at the indicated point. + * + * @attribute class bitmap + * @attribute method point_collision + */ + bool bitmap_point_collision(bitmap bmp, double bmp_x, double bmp_y, double x, double y); + + + /** + * Tests if a cell of a bitmap drawn at x,y would draw a pixel at the passed in point. Use + * to check collisions between a point and a bitmap. + * + * @param bmp The bitmap to test + * @param cell The cell of the bitmap to test + * @param bmp_x The x location where the bitmap is drawn + * @param bmp_y The y location where the bitmap is drawn + * @param x The x location of the point to test + * @param y The y location of the point to test + * @returns True if drawing the bitmap cell, at the indicated location, + * will draw a pixel at the indicated point. + * + * @attribute class bitmap + * @attribute method point_collision + * + * @attribute suffix for_cell + */ + bool bitmap_point_collision(bitmap bmp, int cell, double bmp_x, double bmp_y, double x, double y); + /** * Tests if a bitmap drawn using the passed in translation matrix would draw a pixel * at the passed in point. Use to check collisions between a point and a bitmap. @@ -33,7 +72,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method point_collision */ - bool bitmap_point_collision(bitmap bmp, const matrix_2d& translation, const point_2d& pt); + bool bitmap_point_collision(bitmap bmp, const matrix_2d &translation, const point_2d &pt); /** * Tests if a bitmap drawn at the `bmp_pt` point would draw a pixel @@ -50,24 +89,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method point_collision */ - bool bitmap_point_collision(bitmap bmp, const point_2d &bmp_pt, const point_2d& pt); - - /** - * Tests if a bitmap drawn at x,y would draw a pixel at the passed in point. Use - * to check collisions between a point and a bitmap. - * - * @param bmp The bitmap to test. - * @param bmp_x The x location where the bitmap is drawn - * @param bmp_y The y location where the bitmap is drawn - * @param x The x location of the point to test - * @param y The y location of the point to test - * @returns True if drawing the bitmap, at the indicated location, - * will draw a pixel at the indicated point. - * - * @attribute class bitmap - * @attribute method point_collision - */ - bool bitmap_point_collision(bitmap bmp, double bmp_x, double bmp_y, double x, double y); + bool bitmap_point_collision(bitmap bmp, const point_2d &bmp_pt, const point_2d &pt); /** * Tests if a cell of a bitmap drawn at x,y would draw a pixel at the passed in point. Use @@ -85,28 +107,8 @@ namespace splashkit_lib * * @attribute suffix for_cell_at_point */ - bool bitmap_point_collision(bitmap bmp, int cell, const point_2d &bmp_pt, const point_2d& pt); + bool bitmap_point_collision(bitmap bmp, int cell, const point_2d &bmp_pt, const point_2d &pt); - /** - * Tests if a cell of a bitmap drawn at x,y would draw a pixel at the passed in point. Use - * to check collisions between a point and a bitmap. - * - * @param bmp The bitmap to test - * @param cell The cell of the bitmap to test - * @param bmp_x The x location where the bitmap is drawn - * @param bmp_y The y location where the bitmap is drawn - * @param x The x location of the point to test - * @param y The y location of the point to test - * @returns True if drawing the bitmap cell, at the indicated location, - * will draw a pixel at the indicated point. - * - * @attribute class bitmap - * @attribute method point_collision - * - * @attribute suffix for_cell - */ - bool bitmap_point_collision(bitmap bmp, int cell, double bmp_x, double bmp_y, double x, double y); - /** * Tests if a bitmap cell drawn using the passed in translation matrix would draw a pixel * at the passed in point. @@ -124,7 +126,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method point_collision */ - bool bitmap_point_collision(bitmap bmp, int cell, const matrix_2d& translation, const point_2d& pt); + bool bitmap_point_collision(bitmap bmp, int cell, const matrix_2d &translation, const point_2d &pt); /** * Tests if a bitmap cell drawn using a passed in translation, will @@ -143,7 +145,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method rectangle_collision */ - bool bitmap_rectangle_collision(bitmap bmp, int cell, const matrix_2d& translation, const rectangle& rect); + bool bitmap_rectangle_collision(bitmap bmp, int cell, const matrix_2d &translation, const rectangle &rect); /** * Tests if a bitmap cell drawn at `pt` would intersect with a rectangle. @@ -160,7 +162,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method rectangle_collision */ - bool bitmap_rectangle_collision(bitmap bmp, int cell, const point_2d& pt, const rectangle& rect); + bool bitmap_rectangle_collision(bitmap bmp, int cell, const point_2d &pt, const rectangle &rect); /** * Tests if a cell of the bitmap drawn at `x`, `y` would intersect with a rectangle. @@ -178,8 +180,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method rectangle_collision */ - bool bitmap_rectangle_collision(bitmap bmp, int cell, double x, double y, const rectangle& rect); - + bool bitmap_rectangle_collision(bitmap bmp, int cell, double x, double y, const rectangle &rect); + /** * Tests if a bitmap drawn at `x`, `y` would intersect with a rectangle. * @@ -193,8 +195,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method rectangle_collision */ - bool bitmap_rectangle_collision(bitmap bmp, double x, double y, const rectangle& rect); - + bool bitmap_rectangle_collision(bitmap bmp, double x, double y, const rectangle &rect); + /** * Tests if a bitmap drawn at `pt` would intersect with a rectangle. * @@ -209,9 +211,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method rectangle_collision */ - bool bitmap_rectangle_collision(bitmap bmp, const point_2d& pt, const rectangle& rect); - - + bool bitmap_rectangle_collision(bitmap bmp, const point_2d &pt, const rectangle &rect); + /** * Tests if a bitmap cell drawn using a passed in translation, will * intersect with a circle. You can use this to detect collisions between @@ -229,8 +230,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method circle_collision */ - bool bitmap_circle_collision(bitmap bmp, int cell, const matrix_2d& translation, const circle& circ); - + bool bitmap_circle_collision(bitmap bmp, int cell, const matrix_2d &translation, const circle &circ); + /** * Tests if a bitmap cell drawn at `pt` would intersect with a circle. * @@ -246,8 +247,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method circle_collision */ - bool bitmap_circle_collision(bitmap bmp, int cell, const point_2d& pt, const circle& circ); - + bool bitmap_circle_collision(bitmap bmp, int cell, const point_2d &pt, const circle &circ); + /** * Tests if a bitmap cell drawn at `x`, `y` would intersect with a circle. * @@ -264,8 +265,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method circle_collision */ - bool bitmap_circle_collision(bitmap bmp, int cell, double x, double y, const circle& circ); - + bool bitmap_circle_collision(bitmap bmp, int cell, double x, double y, const circle &circ); + /** * Tests if a bitmap drawn at `x`, `y` would intersect with a circle. * @@ -279,8 +280,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method circle_collision */ - bool bitmap_circle_collision(bitmap bmp, double x, double y, const circle& circ); - + bool bitmap_circle_collision(bitmap bmp, double x, double y, const circle &circ); + /** * Tests if a bitmap drawn at `pt` would intersect with a circle. * @@ -295,27 +296,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method circle_collision */ - bool bitmap_circle_collision(bitmap bmp, const point_2d& pt, const circle& circ); + bool bitmap_circle_collision(bitmap bmp, const point_2d &pt, const circle &circ); - /** - * Tests if a bitmap cell drawn using a passed in translation, will - * intersect with a quad. You can use this to detect collisions between - * bitmaps and quads. - * - * @param bmp The bitmap to test - * @param cell The cell of the bitmap to check - * @param translation The matrix used to transfrom the bitmap when drawing - * @param q The quad to test - * @return True if a drawn pixel in the cell of the bitmap will - * intersect with `q` when drawn. - * - * @attribute suffix for_cell_with_translation - * - * @attribute class bitmap - * @attribute method quad_collision - */ - bool bitmap_quad_collision(bitmap bmp, int cell, const matrix_2d &translation, const quad &q); - /** * Tests if a bitmap cell drawn using a passed in translation, will * intersect with a ray. You can use this to detect collisions between @@ -334,7 +316,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method ray_collision */ - bool bitmap_ray_collision(bitmap bmp, int cell, const matrix_2d& translation, const point_2d& origin, const vector_2d& heading); + bool bitmap_ray_collision(bitmap bmp, int cell, const matrix_2d &translation, const point_2d &origin, const vector_2d &heading); /** * Tests if a bitmap cell drawn at `pt` would intersect with a ray. @@ -352,7 +334,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method ray_collision */ - bool bitmap_ray_collision(bitmap bmp, int cell, const point_2d& pt, const point_2d& origin, const vector_2d& heading); + bool bitmap_ray_collision(bitmap bmp, int cell, const point_2d &pt, const point_2d &origin, const vector_2d &heading); /** * Tests if a bitmap cell drawn at `x`, `y` would intersect with a ray. @@ -371,7 +353,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method ray_collision */ - bool bitmap_ray_collision(bitmap bmp, int cell, double x, double y, const point_2d& origin, const vector_2d& heading); + bool bitmap_ray_collision(bitmap bmp, int cell, double x, double y, const point_2d &origin, const vector_2d &heading); /** * Tests if a bitmap drawn at `x`, `y` would intersect with a ray. @@ -380,14 +362,14 @@ namespace splashkit_lib * @param x The x location where the bitmap is drawn * @param y The y location where the bitmap is drawn * @param origin The origin of the ray - * @param heading The heading of the ray + * @param heading The heading of the ray * @return True if a drawn pixel in the bitmap will * intersect with the ray when drawn. * * @attribute class bitmap * @attribute method ray_collision */ - bool bitmap_ray_collision(bitmap bmp, double x, double y, const point_2d& origin, const vector_2d& heading); + bool bitmap_ray_collision(bitmap bmp, double x, double y, const point_2d &origin, const vector_2d &heading); /** * Tests if a bitmap drawn at `pt` would intersect with a ray. @@ -404,8 +386,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method ray_collision */ - bool bitmap_ray_collision(bitmap bmp, const point_2d& pt, const point_2d& origin, const vector_2d& heading); - + bool bitmap_ray_collision(bitmap bmp, const point_2d &pt, const point_2d &origin, const vector_2d &heading); /** * Tests if a bitmap cell drawn using a passed in translation, will @@ -441,7 +422,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method triangle_collision */ - bool bitmap_triangle_collision(bitmap bmp, int cell, const point_2d& pt, const triangle &tri); + bool bitmap_triangle_collision(bitmap bmp, int cell, const point_2d &pt, const triangle &tri); /** * Tests if a bitmap cell drawn at `x`, `y` would intersect with a triangle. @@ -490,7 +471,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method triangle_collision */ - bool bitmap_triangle_collision(bitmap bmp, const point_2d& pt, const triangle &tri); + bool bitmap_triangle_collision(bitmap bmp, const point_2d &pt, const triangle &tri); /** * Tests if a bitmap cell drawn using a passed in translation, will @@ -526,7 +507,7 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method quad_collision */ - bool bitmap_quad_collision(bitmap bmp, int cell, const point_2d& pt, const quad &q); + bool bitmap_quad_collision(bitmap bmp, int cell, const point_2d &pt, const quad &q); /** * Tests if a bitmap cell drawn at `x`, `y` would intersect with a quad. @@ -575,8 +556,8 @@ namespace splashkit_lib * @attribute class bitmap * @attribute method quad_collision */ - bool bitmap_quad_collision(bitmap bmp, const point_2d& pt, const quad &q); - + bool bitmap_quad_collision(bitmap bmp, const point_2d &pt, const quad &q); + /** * Tests if a sprite will collide with a bitmap drawn at the indicated * location. @@ -640,7 +621,7 @@ namespace splashkit_lib * @attribute class sprite * @attribute method point_collision */ - bool sprite_point_collision(sprite s, const point_2d& pt); + bool sprite_point_collision(sprite s, const point_2d &pt); /** * Tests if a sprite is drawn within an given area (rectangle). @@ -652,20 +633,20 @@ namespace splashkit_lib * @attribute class sprite * @attribute method rectangle_collision */ - bool sprite_rectangle_collision(sprite s, const rectangle& rect); + bool sprite_rectangle_collision(sprite s, const rectangle &rect); /** * Tests if a sprite is drawn along a given ray. - * + * * @param s The sprite to test * @param origin The origin of the ray * @param heading The heading of the ray * @return True if the sprite is drawn along the ray - * + * * @attribute class sprite * @attribute method ray_collision */ - bool sprite_ray_collision(sprite s, const point_2d& origin, const vector_2d& heading); + bool sprite_ray_collision(sprite s, const point_2d &origin, const vector_2d &heading); /** * Tests if a sprite is drawn within an given area (circle). @@ -809,13 +790,13 @@ namespace splashkit_lib * Returns the direction of the collision between two sprites * relative to the collider sprite. If the sprites are not colliding, * this function will return a zero vector. - * + * * @param collider The sprite that is colliding * @param collidee The sprite that is being collided with * @return The direction of the collision relative to the collider sprite, * expressed as a unit vector. If the sprites are not colliding, * this function will return a zero vector. - * + * * @attribute class sprite * @attribute suffix between_sprites */ @@ -825,392 +806,392 @@ namespace splashkit_lib * Returns the direction of the collision between a sprite * and a rectangle relative to the sprite. If the sprite and * rectangle are not colliding, this function will return a zero vector. - * + * * @param collider The sprite that is colliding * @param collidee The rectangle that is being collided with * @return The direction of the collision relative to the sprite, * expressed as a unit vector. If the sprite and rectangle are not colliding, * this function will return a zero vector. - * + * * @attribute class sprite * @attribute suffix between_sprite_and_rectangle */ - vector_2d calculate_collision_direction(const sprite collider, const rectangle& collidee); + vector_2d calculate_collision_direction(const sprite collider, const rectangle &collidee); /** * Returns the direction of the collision between a sprite * and a circle relative to the sprite. If the sprite and * circle are not colliding, this function will return a zero vector. - * + * * @param collider The sprite that is colliding * @param collidee The circle that is being collided with * @return The direction of the collision relative to the sprite, * expressed as a unit vector. If the sprite and circle are not colliding, * this function will return a zero vector. - * + * * @attribute class sprite * @attribute suffix between_sprite_and_circle */ - vector_2d calculate_collision_direction(const sprite collider, const circle& collidee); + vector_2d calculate_collision_direction(const sprite collider, const circle &collidee); /** * Returns the direction of the collision between a sprite * and a triangle relative to the sprite. If the sprite and * triangle are not colliding, this function will return a zero vector. - * + * * @param collider The sprite that is colliding * @param collidee The triangle that is being collided with * @return The direction of the collision relative to the sprite, * expressed as a unit vector. If the sprite and triangle are not colliding, * this function will return a zero vector. - * + * * @attribute class sprite * @attribute suffix between_sprite_and_triangle */ - vector_2d calculate_collision_direction(const sprite collider, const triangle& collidee); + vector_2d calculate_collision_direction(const sprite collider, const triangle &collidee); /** * Returns the direction of the collision between a sprite * and a quad relative to the sprite. If the sprite and * quad are not colliding, this function will return a zero vector. - * + * * @param collider The sprite that is colliding * @param collidee The quad that is being collided with * @return The direction of the collision relative to the sprite, * expressed as a unit vector. If the sprite and quad are not colliding, * this function will return a zero vector. - * + * * @attribute class sprite * @attribute suffix between_sprite_and_quad */ - vector_2d calculate_collision_direction(const sprite collider, const quad& collidee); + vector_2d calculate_collision_direction(const sprite collider, const quad &collidee); /** * Returns the direction of the collision between a rectangle * and a sprite relative to the rectangle. If the rectangle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The rectangle that is colliding * @param collidee The sprite that is being collided with * @return The direction of the collision relative to the rectangle, * expressed as a unit vector. If the rectangle and sprite are not colliding, * this function will return a zero vector. - * + * * @attribute class rectangle * @attribute suffix between_rectangle_and_sprite */ - vector_2d calculate_collision_direction(const rectangle& collider, const sprite collidee); + vector_2d calculate_collision_direction(const rectangle &collider, const sprite collidee); /** * Returns the direction of the collision between a collider rectangle * and a collidee rectangle relative to the collider rectangle. If the rectangles are not * colliding, this function will return a zero vector. - * + * * @param collider The rectangle that is colliding * @param collidee The rectangle that is being collided with * @return The direction of the collision relative to the collider rectangle, * expressed as a unit vector. If the rectangles are not colliding, this function * will return a zero vector. - * + * * @attribute class rectangle * @attribute suffix between_rectangles */ - vector_2d calculate_collision_direction(const rectangle& collider, const rectangle& collidee); + vector_2d calculate_collision_direction(const rectangle &collider, const rectangle &collidee); /** * Returns the direction of the collision between a rectangle * and a circle relative to the rectangle. If the rectangle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The rectangle that is colliding * @param collidee The circle that is being collided with * @return The direction of the collision relative to the rectangle, * expressed as a unit vector. If the rectangle and circle are not colliding, * this function will return a zero vector. - * + * * @attribute class rectangle * @attribute suffix between_rectangle_and_circle */ - vector_2d calculate_collision_direction(const rectangle& collider, const circle& collidee); + vector_2d calculate_collision_direction(const rectangle &collider, const circle &collidee); /** * Returns the direction of the collision between a rectangle * and a triangle relative to the rectangle. If the rectangle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The rectangle that is colliding * @param collidee The triangle that is being collided with * @return The direction of the collision relative to the rectangle, * expressed as a unit vector. If the rectangle and triangle are not colliding, * this function will return a zero vector. - * + * * @attribute class rectangle * @attribute suffix between_rectangle_and_triangle */ - vector_2d calculate_collision_direction(const rectangle& collider, const triangle& collidee); + vector_2d calculate_collision_direction(const rectangle &collider, const triangle &collidee); /** * Returns the direction of the collision between a rectangle * and a quad relative to the rectangle. If the rectangle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The rectangle that is colliding * @param collidee The quad that is being collided with * @return The direction of the collision relative to the rectangle, * expressed as a unit vector. If the rectangle and quad are not colliding, * this function will return a zero vector. - * + * * @attribute class rectangle * @attribute suffix between_rectangle_and_quad */ - vector_2d calculate_collision_direction(const rectangle& collider, const quad& collidee); + vector_2d calculate_collision_direction(const rectangle &collider, const quad &collidee); /** * Returns the direction of the collision between a circle * and a sprite relative to the circle. If the circle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The circle that is colliding * @param collidee The sprite that is being collided with * @return The direction of the collision relative to the circle, * expressed as a unit vector. If the circle and sprite are not colliding, * this function will return a zero vector. - * + * * @attribute class circle * @attribute suffix between_circle_and_sprite */ - vector_2d calculate_collision_direction(const circle& collider, const sprite collidee); + vector_2d calculate_collision_direction(const circle &collider, const sprite collidee); /** * Returns the direction of the collision between a circle * and a rectangle relative to the circle. If the circle and * rectangle are not colliding, this function will return a zero vector. - * + * * @param collider The circle that is colliding * @param collidee The rectangle that is being collided with * @return The direction of the collision relative to the circle, * expressed as a unit vector. If the circle and rectangle are not colliding, * this function will return a zero vector. - * + * * @attribute class circle * @attribute suffix between_circle_and_rectangle */ - vector_2d calculate_collision_direction(const circle& collider, const rectangle& collidee); + vector_2d calculate_collision_direction(const circle &collider, const rectangle &collidee); /** * Returns the direction of the collision between a collider circle * and a collidee circle relative to the collider circle. If the circles are not * colliding, this function will return a zero vector. - * + * * @param collider The circle that is colliding * @param collidee The circle that is being collided with * @return The direction of the collision relative to the collider circle, * expressed as a unit vector. If the circles are not colliding, this function * will return a zero vector. - * + * * @attribute class circle * @attribute suffix between_circles */ - vector_2d calculate_collision_direction(const circle& collider, const circle& collidee); + vector_2d calculate_collision_direction(const circle &collider, const circle &collidee); /** * Returns the direction of the collision between a circle * and a triangle relative to the circle. If the circle and * triangle are not colliding, this function will return a zero vector. - * + * * @param collider The circle that is colliding * @param collidee The triangle that is being collided with * @return The direction of the collision relative to the circle, * expressed as a unit vector. If the circle and triangle are not colliding, * this function will return a zero vector. - * + * * @attribute class circle * @attribute suffix between_circle_and_triangle */ - vector_2d calculate_collision_direction(const circle& collider, const triangle& collidee); + vector_2d calculate_collision_direction(const circle &collider, const triangle &collidee); /** * Returns the direction of the collision between a circle * and a quad relative to the circle. If the circle and * quad are not colliding, this function will return a zero vector. - * + * * @param collider The circle that is colliding * @param collidee The quad that is being collided with * @return The direction of the collision relative to the circle, * expressed as a unit vector. If the circle and quad are not colliding, * this function will return a zero vector. - * + * * @attribute class circle * @attribute suffix between_circle_and_quad */ - vector_2d calculate_collision_direction(const circle& collider, const quad& collidee); + vector_2d calculate_collision_direction(const circle &collider, const quad &collidee); /** * Returns the direction of the collision between a triangle * and a sprite relative to the triangle. If the triangle and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The triangle that is colliding * @param collidee The sprite that is being collided with * @return The direction of the collision relative to the triangle, * expressed as a unit vector. If the triangle and sprite are not colliding, * this function will return a zero vector. - * + * * @attribute class triangle * @attribute suffix between_triangle_and_sprite */ - vector_2d calculate_collision_direction(const triangle& collider, const sprite collidee); + vector_2d calculate_collision_direction(const triangle &collider, const sprite collidee); /** * Returns the direction of the collision between a triangle * and a rectangle relative to the triangle. If the triangle and * rectangle are not colliding, this function will return a zero vector. - * + * * @param collider The triangle that is colliding * @param collidee The rectangle that is being collided with * @return The direction of the collision relative to the triangle, * expressed as a unit vector. If the triangle and rectangle are not colliding, * this function will return a zero vector. - * + * * @attribute class triangle * @attribute suffix between_triangle_and_rectangle */ - vector_2d calculate_collision_direction(const triangle& collider, const rectangle& collidee); + vector_2d calculate_collision_direction(const triangle &collider, const rectangle &collidee); /** * Returns the direction of the collision between a triangle * and a circle relative to the triangle. If the triangle and * circle are not colliding, this function will return a zero vector. - * + * * @param collider The triangle that is colliding * @param collidee The circle that is being collided with * @return The direction of the collision relative to the triangle, * expressed as a unit vector. If the triangle and circle are not colliding, * this function will return a zero vector. - * + * * @attribute class triangle * @attribute suffix between_triangle_and_circle */ - vector_2d calculate_collision_direction(const triangle& collider, const circle& collidee); + vector_2d calculate_collision_direction(const triangle &collider, const circle &collidee); /** * Returns the direction of the collision between a collider triangle * and a collidee triangle relative to the collider triangle. If the triangles are not * colliding, this function will return a zero vector. - * + * * @param collider The triangle that is colliding * @param collidee The triangle that is being collided with * @return The direction of the collision relative to the collider triangle, * expressed as a unit vector. If the triangles are not colliding, this function * will return a zero vector. - * + * * @attribute class triangle * @attribute suffix between_triangles */ - vector_2d calculate_collision_direction(const triangle& collider, const triangle& collidee); + vector_2d calculate_collision_direction(const triangle &collider, const triangle &collidee); /** * Returns the direction of the collision between a triangle * and a quad relative to the triangle. If the triangle and * quad are not colliding, this function will return a zero vector. - * + * * @param collider The triangle that is colliding * @param collidee The quad that is being collided with * @return The direction of the collision relative to the triangle, * expressed as a unit vector. If the triangle and quad are not colliding, * this function will return a zero vector. - * + * * @attribute class triangle * @attribute suffix between_triangle_and_quad */ - vector_2d calculate_collision_direction(const triangle& collider, const quad& collidee); + vector_2d calculate_collision_direction(const triangle &collider, const quad &collidee); /** * Returns the direction of the collision between a quad * and a sprite relative to the quad. If the quad and * sprite are not colliding, this function will return a zero vector. - * + * * @param collider The quad that is colliding * @param collidee The sprite that is being collided with * @return The direction of the collision relative to the quad, * expressed as a unit vector. If the quad and sprite are not colliding, * this function will return a zero vector. - * + * * @attribute class quad * @attribute suffix between_quad_and_sprite */ - vector_2d calculate_collision_direction(const quad& collider, const sprite collidee); + vector_2d calculate_collision_direction(const quad &collider, const sprite collidee); /** * Returns the direction of the collision between a quad * and a rectangle relative to the quad. If the quad and * rectangle are not colliding, this function will return a zero vector. - * + * * @param collider The quad that is colliding * @param collidee The rectangle that is being collided with * @return The direction of the collision relative to the quad, * expressed as a unit vector. If the quad and rectangle are not colliding, * this function will return a zero vector. - * + * * @attribute class quad * @attribute suffix between_quad_and_rectangle */ - vector_2d calculate_collision_direction(const quad& collider, const rectangle& collidee); + vector_2d calculate_collision_direction(const quad &collider, const rectangle &collidee); /** * Returns the direction of the collision between a quad * and a circle relative to the quad. If the quad and * circle are not colliding, this function will return a zero vector. - * + * * @param collider The quad that is colliding * @param collidee The circle that is being collided with * @return The direction of the collision relative to the quad, * expressed as a unit vector. If the quad and circle are not colliding, * this function will return a zero vector. - * + * * @attribute class quad * @attribute suffix between_quad_and_circle */ - vector_2d calculate_collision_direction(const quad& collider, const circle& collidee); + vector_2d calculate_collision_direction(const quad &collider, const circle &collidee); /** * Returns the direction of the collision between a quad * and a triangle relative to the quad. If the quad and * triangle are not colliding, this function will return a zero vector. - * + * * @param collider The quad that is colliding * @param collidee The triangle that is being collided with * @return The direction of the collision relative to the quad, * expressed as a unit vector. If the quad and triangle are not colliding, * this function will return a zero vector. - * + * * @attribute class quad * @attribute suffix between_quad_and_triangle */ - vector_2d calculate_collision_direction(const quad& collider, const triangle& collidee); + vector_2d calculate_collision_direction(const quad &collider, const triangle &collidee); /** * Returns the direction of the collision between a collider quad * and a collidee quad relative to the collider quad. If the quads are not * colliding, this function will return a zero vector. - * + * * @param collider The quad that is colliding * @param collidee The quad that is being collided with * @return The direction of the collision relative to the collider quad, * expressed as a unit vector. If the quads are not colliding, this function * will return a zero vector. - * + * * @attribute class quad * @attribute suffix between_quads */ - vector_2d calculate_collision_direction(const quad& collider, const quad& collidee); + vector_2d calculate_collision_direction(const quad &collider, const quad &collidee); /** * Resolves the collision between two sprites by moving the * collider sprite to the edge of the collidee sprite. The direction of the * resolution is determined by the `direction` parameter. If the sprites are not * colliding, this function will return false. - * + * * @param collider The sprite which will be altered if there is a collision * @param collidee The sprite which will not be altered * @param direction The direction of the collision relative to the collider sprite, @@ -1218,18 +1199,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the sprites are colliding and the collision was resolved, * false if the sprites are not colliding - * + * * @atrribute class sprite * @attribute suffix between_sprites */ - bool resolve_collision(sprite collider, const sprite collidee, const vector_2d& direction); + bool resolve_collision(sprite collider, const sprite collidee, const vector_2d &direction); /** * Resolves the collision between a sprite and a rectangle by moving the * sprite to the edge of the rectangle. The direction of the * resolution is determined by the `direction` parameter. If the sprite and * rectangle are not colliding, this function will return false. - * + * * @param collider The sprite which will be altered if there is a collision * @param collidee The rectangle which will not be altered * @param direction The direction of the collision relative to the sprite, @@ -1237,18 +1218,18 @@ namespace splashkit_lib * the function will not resolve the collision. * @return True if the sprite and rectangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class sprite * @attribute suffix between_sprite_and_rectangle */ - bool resolve_collision(sprite collider, const rectangle& collidee, const vector_2d& direction); + bool resolve_collision(sprite collider, const rectangle &collidee, const vector_2d &direction); /** * Resolves the collision between a sprite and a circle by moving the * sprite to the edge of the circle. The direction of the * resolution is determined by the `direction` parameter. If the sprite and * circle are not colliding, this function will return false. - * + * * @param collider The sprite which will be altered if there is a collision * @param collidee The circle which will not be altered * @param direction The direction of the collision relative to the sprite, @@ -1256,18 +1237,18 @@ namespace splashkit_lib * the function will not resolve the collision. * @return True if the sprite and circle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class sprite * @attribute suffix between_sprite_and_circle */ - bool resolve_collision(sprite collider, const circle& collidee, const vector_2d& direction); + bool resolve_collision(sprite collider, const circle &collidee, const vector_2d &direction); /** * Resolves the collision between a sprite and a triangle by moving the * sprite to the edge of the triangle. The direction of the * resolution is determined by the `direction` parameter. If the sprite and * triangle are not colliding, this function will return false. - * + * * @param collider The sprite which will be altered if there is a collision * @param collidee The triangle which will not be altered * @param direction The direction of the collision relative to the sprite, @@ -1275,18 +1256,18 @@ namespace splashkit_lib * the function will not resolve the collision. * @return True if the sprite and triangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class sprite * @attribute suffix between_sprite_and_triangle */ - bool resolve_collision(sprite collider, const triangle& collidee, const vector_2d& direction); + bool resolve_collision(sprite collider, const triangle &collidee, const vector_2d &direction); /** * Resolves the collision between a sprite and a quad by moving the * sprite to the edge of the quad. The direction of the * resolution is determined by the `direction` parameter. If the sprite and * quad are not colliding, this function will return false. - * + * * @param collider The sprite which will be altered if there is a collision * @param collidee The quad which will not be altered * @param direction The direction of the collision relative to the sprite, @@ -1294,18 +1275,18 @@ namespace splashkit_lib * the function will not resolve the collision. * @return True if the sprite and quad are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class sprite * @attribute suffix between_sprite_and_quad */ - bool resolve_collision(sprite collider, const quad& collidee, const vector_2d& direction); + bool resolve_collision(sprite collider, const quad &collidee, const vector_2d &direction); /** * Resolves the collision between a rectangle and a sprite by moving the * rectangle to the edge of the sprite. The direction of the * resolution is determined by the `direction` parameter. If the rectangle and * sprite are not colliding, this function will return false. - * + * * @param collider The rectangle which will be altered if there is a collision * @param collidee The sprite which will not be altered * @param direction The direction of the collision relative to the rectangle, @@ -1313,18 +1294,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the rectangle and sprite are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class rectangle * @attribute suffix between_rectangle_and_sprite */ - bool resolve_collision(rectangle& collider, const sprite collidee, const vector_2d& direction); + bool resolve_collision(rectangle &collider, const sprite collidee, const vector_2d &direction); /** * Resolves the collision between two rectangles by moving the * collider rectangle to the edge of the collidee rectangle. The direction of the * resolution is determined by the `direction` parameter. If the rectangles are not * colliding, this function will return false. - * + * * @param collider The rectangle which will be altered if there is a collision * @param collidee The rectangle which will not be altered * @param direction The direction of the collision relative to the collider rectangle, @@ -1332,18 +1313,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the rectangles are colliding and the collision was resolved, * false if the rectangles are not colliding - * + * * @atrribute class rectangle * @attribute suffix between_rectangles */ - bool resolve_collision(rectangle& collider, const rectangle& collidee, const vector_2d& direction); + bool resolve_collision(rectangle &collider, const rectangle &collidee, const vector_2d &direction); /** * Resolves the collision between a rectangle and a circle by moving the * rectangle to the edge of the circle. The direction of the * resolution is determined by the `direction` parameter. If the rectangle and * circle are not colliding, this function will return false. - * + * * @param collider The rectangle which will be altered if there is a collision * @param collidee The circle which will not be altered * @param direction The direction of the collision relative to the rectangle, @@ -1351,18 +1332,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the rectangle and circle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class rectangle * @attribute suffix between_rectangle_and_circle */ - bool resolve_collision(rectangle& collider, const circle& collidee, const vector_2d& direction); + bool resolve_collision(rectangle &collider, const circle &collidee, const vector_2d &direction); /** * Resolves the collision between a rectangle and a triangle by moving the * rectangle to the edge of the triangle. The direction of the * resolution is determined by the `direction` parameter. If the rectangle and * triangle are not colliding, this function will return false. - * + * * @param collider The rectangle which will be altered if there is a collision * @param collidee The triangle which will not be altered * @param direction The direction of the collision relative to the rectangle, @@ -1370,18 +1351,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the rectangle and triangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class rectangle * @attribute suffix between_rectangle_and_triangle */ - bool resolve_collision(rectangle& collider, const triangle& collidee, const vector_2d& direction); + bool resolve_collision(rectangle &collider, const triangle &collidee, const vector_2d &direction); /** * Resolves the collision between a rectangle and a quad by moving the * rectangle to the edge of the quad. The direction of the * resolution is determined by the `direction` parameter. If the rectangle and * quad are not colliding, this function will return false. - * + * * @param collider The rectangle which will be altered if there is a collision * @param collidee The quad which will not be altered * @param direction The direction of the collision relative to the rectangle, @@ -1389,18 +1370,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the rectangle and quad are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class rectangle * @attribute suffix between_rectangle_and_quad */ - bool resolve_collision(rectangle& collider, const quad& collidee, const vector_2d& direction); + bool resolve_collision(rectangle &collider, const quad &collidee, const vector_2d &direction); /** * Resolves the collision between a circle and a sprite by moving the * circle to the edge of the sprite. The direction of the * resolution is determined by the `direction` parameter. If the circle and * sprite are not colliding, this function will return false. - * + * * @param collider The circle which will be altered if there is a collision * @param collidee The sprite which will not be altered * @param direction The direction of the collision relative to the circle, @@ -1408,18 +1389,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the circle and sprite are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class circle * @attribute suffix between_circle_and_sprite */ - bool resolve_collision(circle& collider, const sprite collidee, const vector_2d& direction); + bool resolve_collision(circle &collider, const sprite collidee, const vector_2d &direction); /** * Resolves the collision between a circle and a rectangle by moving the * circle to the edge of the rectangle. The direction of the * resolution is determined by the `direction` parameter. If the circle and * rectangle are not colliding, this function will return false. - * + * * @param collider The circle which will be altered if there is a collision * @param collidee The rectangle which will not be altered * @param direction The direction of the collision relative to the circle, @@ -1427,18 +1408,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the circle and rectangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class circle * @attribute suffix between_circle_and_rectangle */ - bool resolve_collision(circle& collider, const rectangle& collidee, const vector_2d& direction); + bool resolve_collision(circle &collider, const rectangle &collidee, const vector_2d &direction); /** * Resolves the collision between a collider circle and a collidee circle by moving the * collider circle to the edge of the collidee circle. The direction of the * resolution is determined by the `direction` parameter. If the circles are not * colliding, this function will return false. - * + * * @param collider The circle which will be altered if there is a collision * @param collidee The circle which will not be altered * @param direction The direction of the collision relative to the collider circle, @@ -1446,18 +1427,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the circles are colliding and the collision was resolved, * false if the circles are not colliding - * + * * @atrribute class circle * @attribute suffix between_circles */ - bool resolve_collision(circle& collider, const circle& collidee, const vector_2d& direction); + bool resolve_collision(circle &collider, const circle &collidee, const vector_2d &direction); /** * Resolves the collision between a circle and a triangle by moving the * circle to the edge of the triangle. The direction of the * resolution is determined by the `direction` parameter. If the circle and * triangle are not colliding, this function will return false. - * + * * @param collider The circle which will be altered if there is a collision * @param collidee The triangle which will not be altered * @param direction The direction of the collision relative to the circle, @@ -1465,18 +1446,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the circle and triangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class circle * @attribute suffix between_circle_and_triangle */ - bool resolve_collision(circle& collider, const triangle& collidee, const vector_2d& direction); + bool resolve_collision(circle &collider, const triangle &collidee, const vector_2d &direction); /** * Resolves the collision between a circle and a quad by moving the * circle to the edge of the quad. The direction of the * resolution is determined by the `direction` parameter. If the circle and * quad are not colliding, this function will return false. - * + * * @param collider The circle which will be altered if there is a collision * @param collidee The quad which will not be altered * @param direction The direction of the collision relative to the circle, @@ -1484,18 +1465,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the circle and quad are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class circle * @attribute suffix between_circle_and_quad */ - bool resolve_collision(circle& collider, const quad& collidee, const vector_2d& direction); + bool resolve_collision(circle &collider, const quad &collidee, const vector_2d &direction); /** * Resolves the collision between a triangle and a sprite by moving the * triangle to the edge of the sprite. The direction of the * resolution is determined by the `direction` parameter. If the triangle and * sprite are not colliding, this function will return false. - * + * * @param collider The triangle which will be altered if there is a collision * @param collidee The sprite which will not be altered * @param direction The direction of the collision relative to the triangle, @@ -1503,18 +1484,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the triangle and sprite are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class triangle * @attribute suffix between_triangle_and_sprite */ - bool resolve_collision(triangle& collider, const sprite collidee, const vector_2d& direction); + bool resolve_collision(triangle &collider, const sprite collidee, const vector_2d &direction); /** * Resolves the collision between a triangle and a rectangle by moving the * triangle to the edge of the rectangle. The direction of the * resolution is determined by the `direction` parameter. If the triangle and * rectangle are not colliding, this function will return false. - * + * * @param collider The triangle which will be altered if there is a collision * @param collidee The rectangle which will not be altered * @param direction The direction of the collision relative to the triangle, @@ -1522,18 +1503,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the triangle and rectangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class triangle * @attribute suffix between_triangle_and_rectangle */ - bool resolve_collision(triangle& collider, const rectangle& collidee, const vector_2d& direction); + bool resolve_collision(triangle &collider, const rectangle &collidee, const vector_2d &direction); /** * Resolves the collision between a triangle and a circle by moving the * triangle to the edge of the circle. The direction of the * resolution is determined by the `direction` parameter. If the triangle and * circle are not colliding, this function will return false. - * + * * @param collider The triangle which will be altered if there is a collision * @param collidee The circle which will not be altered * @param direction The direction of the collision relative to the triangle, @@ -1541,18 +1522,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the triangle and circle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class triangle * @attribute suffix between_triangle_and_circle */ - bool resolve_collision(triangle& collider, const circle& collidee, const vector_2d& direction); + bool resolve_collision(triangle &collider, const circle &collidee, const vector_2d &direction); /** * Resolves the collision between a collider triangle and a collidee triangle by moving the * collider triangle to the edge of the collidee triangle. The direction of the * resolution is determined by the `direction` parameter. If the triangles are not * colliding, this function will return false. - * + * * @param collider The triangle which will be altered if there is a collision * @param collidee The triangle which will not be altered * @param direction The direction of the collision relative to the collider triangle, @@ -1560,18 +1541,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the triangles are colliding and the collision was resolved, * false if the triangles are not colliding - * + * * @atrribute class triangle * @attribute suffix between_triangles */ - bool resolve_collision(triangle& collider, const triangle& collidee, const vector_2d& direction); + bool resolve_collision(triangle &collider, const triangle &collidee, const vector_2d &direction); /** * Resolves the collision between a triangle and a quad by moving the * triangle to the edge of the quad. The direction of the * resolution is determined by the `direction` parameter. If the triangle and * quad are not colliding, this function will return false. - * + * * @param collider The triangle which will be altered if there is a collision * @param collidee The quad which will not be altered * @param direction The direction of the collision relative to the triangle, @@ -1579,18 +1560,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the triangle and quad are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class triangle * @attribute suffix between_triangle_and_quad */ - bool resolve_collision(triangle& collider, const quad& collidee, const vector_2d& direction); + bool resolve_collision(triangle &collider, const quad &collidee, const vector_2d &direction); /** * Resolves the collision between a quad and a sprite by moving the * quad to the edge of the sprite. The direction of the * resolution is determined by the `direction` parameter. If the quad and * sprite are not colliding, this function will return false. - * + * * @param collider The quad which will be altered if there is a collision * @param collidee The sprite which will not be altered * @param direction The direction of the collision relative to the quad, @@ -1598,18 +1579,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the quad and sprite are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class quad * @attribute suffix between_quad_and_sprite */ - bool resolve_collision(quad& collider, const sprite collidee, const vector_2d& direction); + bool resolve_collision(quad &collider, const sprite collidee, const vector_2d &direction); /** * Resolves the collision between a quad and a rectangle by moving the * quad to the edge of the rectangle. The direction of the * resolution is determined by the `direction` parameter. If the quad and * rectangle are not colliding, this function will return false. - * + * * @param collider The quad which will be altered if there is a collision * @param collidee The rectangle which will not be altered * @param direction The direction of the collision relative to the quad, @@ -1617,18 +1598,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the quad and rectangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class quad * @attribute suffix between_quad_and_rectangle */ - bool resolve_collision(quad& collider, const rectangle& collidee, const vector_2d& direction); + bool resolve_collision(quad &collider, const rectangle &collidee, const vector_2d &direction); /** * Resolves the collision between a quad and a circle by moving the * quad to the edge of the circle. The direction of the * resolution is determined by the `direction` parameter. If the quad and * circle are not colliding, this function will return false. - * + * * @param collider The quad which will be altered if there is a collision * @param collidee The circle which will not be altered * @param direction The direction of the collision relative to the quad, @@ -1636,18 +1617,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the quad and circle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class quad * @attribute suffix between_quad_and_circle */ - bool resolve_collision(quad& collider, const circle& collidee, const vector_2d& direction); + bool resolve_collision(quad &collider, const circle &collidee, const vector_2d &direction); /** * Resolves the collision between a quad and a triangle by moving the * quad to the edge of the triangle. The direction of the * resolution is determined by the `direction` parameter. If the quad and * triangle are not colliding, this function will return false. - * + * * @param collider The quad which will be altered if there is a collision * @param collidee The triangle which will not be altered * @param direction The direction of the collision relative to the quad, @@ -1655,18 +1636,18 @@ namespace splashkit_lib * not resolve the collision. * @return True if the quad and triangle are colliding and the collision * was resolved, false if they are not colliding - * + * * @atrribute class quad * @attribute suffix between_quad_and_triangle */ - bool resolve_collision(quad& collider, const triangle& collidee, const vector_2d& direction); + bool resolve_collision(quad &collider, const triangle &collidee, const vector_2d &direction); /** * Resolves the collision between a collider quad and a collidee quad by moving the * collider quad to the edge of the collidee quad. The direction of the * resolution is determined by the `direction` parameter. If the quads are not * colliding, this function will return false. - * + * * @param collider The quad which will be altered if there is a collision * @param collidee The quad which will not be altered * @param direction The direction of the collision relative to the collider quad, @@ -1674,11 +1655,11 @@ namespace splashkit_lib * not resolve the collision. * @return True if the quads are colliding and the collision was resolved, * false if the quads are not colliding - * + * * @atrribute class quad * @attribute suffix between_quads */ - bool resolve_collision(quad& collider, const quad& collidee, const vector_2d& direction); + bool resolve_collision(quad &collider, const quad &collidee, const vector_2d &direction); } #endif /* collisions_h */