-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2024 Jan Niklas Hasse <[email protected]> | ||
// For conditions of distribution and use, see copyright notice in LICENSE.txt | ||
#include "Rect.hpp" | ||
|
||
#include "Rgba.hpp" | ||
#include "shapes.hpp" | ||
|
||
namespace jngl { | ||
|
||
double Rect::getX() const { | ||
return pos.x; | ||
} | ||
|
||
double Rect::getY() const { | ||
return pos.y; | ||
} | ||
|
||
double Rect::getWidth() const { | ||
return size.x; | ||
} | ||
|
||
double Rect::getHeight() const { | ||
return size.y; | ||
} | ||
|
||
void Rect::drawBoundingBox(Mat3 modelview) const { | ||
jngl::drawRect(modelview.translate(pos), size, 0xff0000aa_rgba); | ||
} | ||
|
||
} // namespace jngl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters