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

Represents a circle in 2D space. More...

#include <Circle.h>

Inheritance diagram for Circle:
Collaboration diagram for Circle:

Public Member Functions

 Circle (Vector2D center, float radius)
 Constructs a Circle object with a specified center and radius.
 
bool IsInShape (Vector2D point) override
 Checks if a given point lies within the circle'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.
 

Private Attributes

float radius
 Radius of the circle.
 

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 a circle in 2D space.

Definition at line 21 of file Circle.h.

Constructor & Destructor Documentation

◆ Circle()

Circle ( Vector2D  center,
float  radius 
)

Constructs a Circle object with a specified center and radius.

Parameters
centerCenter point of the circle.
radiusRadius of the circle.

Definition at line 3 of file Circle.cpp.

Member Function Documentation

◆ IsInShape()

bool IsInShape ( Vector2D  point)
overridevirtual

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

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

Implements Shape.

Definition at line 5 of file Circle.cpp.

References Shape::center, radius, Vector2D::X, and Vector2D::Y.

Member Data Documentation

◆ radius

float radius
private

Radius of the circle.

Definition at line 23 of file Circle.h.

Referenced by IsInShape().


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