ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Ellipse Class Reference

Represents an ellipse in 2D space. More...

#include <Ellipse.h>

Inheritance diagram for Ellipse:
Collaboration diagram for Ellipse:

Public Member Functions

 Ellipse (Vector2D center, Vector2D size, float rotation)
 Constructs an Ellipse object with specified center, size, and rotation.
 
bool IsInShape (Vector2D point) override
 Checks if a given point lies within the ellipse's boundaries.
 
- Public Member Functions inherited from Shape
 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.
 

Additional Inherited Members

- Protected Attributes inherited from Shape
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.
 

Detailed Description

Represents an ellipse in 2D space.

Definition at line 21 of file Ellipse.h.

Constructor & Destructor Documentation

◆ Ellipse()

Ellipse ( Vector2D  center,
Vector2D  size,
float  rotation 
)

Constructs an Ellipse object with specified center, size, and rotation.

Parameters
centerCenter point of the ellipse.
sizeDimensions of the ellipse (width and height).
rotationRotation angle of the ellipse in degrees.

Definition at line 3 of file Ellipse.cpp.

Member Function Documentation

◆ IsInShape()

bool IsInShape ( Vector2D  point)
overridevirtual

Checks if a given point lies within the ellipse's boundaries.

Parameters
pointThe point to check.
Returns
True if the point is within the ellipse, otherwise false.

Implements Shape.

Definition at line 5 of file Ellipse.cpp.

References Shape::center, Mathematics::MPID180, Shape::rotation, Shape::size, Vector2D::X, and Vector2D::Y.


The documentation for this class was generated from the following files: