Go to the source code of this file.
|
bool | areLinesColliding (unsigned start1, unsigned end1, unsigned start2, unsigned end2) |
| tells if 2 lines are colliding in a 1 dimensional space. Didn't want to use Position because of the semantic with x and y More...
|
|
void | applyTransformation (Position &pos, unsigned sizeFrom, unsigned sizeTo) |
| change the position object to reflect the top-right position of a "sizeTo"-sized entity, from a "sizeFrom"-sized entity, keeping the same center More...
|
|
◆ applyTransformation()
void applyTransformation |
( |
Position & |
pos, |
|
|
unsigned |
sizeFrom, |
|
|
unsigned |
sizeTo |
|
) |
| |
change the position object to reflect the top-right position of a "sizeTo"-sized entity, from a "sizeFrom"-sized entity, keeping the same center
- Parameters
-
[in,out] | pos | : Position object |
[in] | sizeFrom | current size of the objet |
[in] | sizeTo | : new size of the object |
Definition at line 8 of file utils.cpp.
◆ areLinesColliding()
bool areLinesColliding |
( |
unsigned |
start1, |
|
|
unsigned |
end1, |
|
|
unsigned |
start2, |
|
|
unsigned |
end2 |
|
) |
| |
tells if 2 lines are colliding in a 1 dimensional space. Didn't want to use Position because of the semantic with x and y
- Parameters
-
[in] | start1 | : position of the first point of the first line |
[in] | end1 | position of the last point of the first line |
[in] | start2 | : position of the first point of the seconde line |
[in] | end2 | position of the last point of the second line |
- Returns
- true if they are colliding, false otherwise
Definition at line 3 of file utils.cpp.