![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Abstract base class for 2D geometric shapes. More...
#include <Shape.h>
Public Member Functions | |
Shape (Vector2D center, Vector2D size, float rotation) | |
Constructs a Shape object with specified center, size, and rotation. | |
void | SetCenter (Vector2D center) |
Sets the center of the shape. | |
void | Translate (Vector2D offset) |
Translates the shape by a given offset. | |
Vector2D | GetCenter () |
Gets the center point of the shape. | |
void | SetSize (Vector2D size) |
Sets the size of the shape. | |
void | Scale (Vector2D scale) |
Scales the shape by a given factor. | |
Vector2D | GetSize () |
Gets the size of the shape. | |
void | SetRotation (float rotation) |
Sets the rotation angle of the shape. | |
void | Rotate (float offset) |
Rotates the shape by a given offset angle. | |
float | GetRotation () |
Gets the current rotation angle of the shape. | |
virtual bool | IsInShape (Vector2D point)=0 |
Checks if a given point lies within the shape's boundaries. | |
Protected Attributes | |
Vector2D | center |
The center point of the shape. | |
Vector2D | size |
The size of the shape, large enough to fit within a bounding rectangle. | |
float | rotation |
The rotation of the shape in degrees. | |
Vector2D GetCenter | ( | ) |
float GetRotation | ( | ) |
Vector2D GetSize | ( | ) |
Checks if a given point lies within the shape's boundaries.
point | The point to check. |
Implemented in Circle, Ellipse, and Rectangle.
Referenced by MaterialMask::GetRGB().
|
protected |
The center point of the shape.
Definition at line 24 of file Shape.h.
Referenced by GetCenter(), Circle::IsInShape(), Ellipse::IsInShape(), Rectangle::IsInShape(), SetCenter(), and Translate().
|
protected |
The rotation of the shape in degrees.
Definition at line 26 of file Shape.h.
Referenced by GetRotation(), Ellipse::IsInShape(), Rectangle::IsInShape(), Rotate(), and SetRotation().
|
protected |
The size of the shape, large enough to fit within a bounding rectangle.
Definition at line 25 of file Shape.h.
Referenced by GetSize(), Ellipse::IsInShape(), Rectangle::IsInShape(), Scale(), and SetSize().