Skip to content

cDoubleRect

Stephen P edited this page Oct 13, 2021 · 4 revisions

Defines a rectangle in 2D space using double-typed x, y, width, and height variables.

Members

x

double
The x-position of the rectangle.

y

double
The y-position of the rectangle.

w

double
The width (across the x-axis) of the rectangle.

h

double
The height (across the y-axis) of the rectangle.

Functions

quickCDoubleRectCollision

bool quickCDoubleRectCollision(cDoubleRect rect1, cDoubleRect rect2)
Checks for a rectangle collision quickly, returning a simple boolean value, where true is that the objects are colliding, and false otherwise.

checkCDoubleRectCollision

cDoubleVector checkCDoubleRectCollision(cDoubleRect rect1, cDoubleRect rect2)
Performs a rectangle collision check and returns the Minimum Translation Vector to apply to rect1 in order to fix the collision.

Clone this wiki locally