wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wEngine::RotationComponent Class Reference

ECS component that stores a rotation angle (in degrees). More...

#include <wRotationComponent.hpp>

Inheritance diagram for wEngine::RotationComponent:
Inheritance graph

Public Member Functions

 RotationComponent (float angle=0.0f)
 Construct a RotationComponent with an initial angle.
virtual ~RotationComponent ()=default
void setAngle (float angle)
 Set the rotation angle.
float getAngle () const
 Get the current rotation angle.
void debugPrint () const
 Outputs the current angle value to the console for debugging.
Public Member Functions inherited from wEngine::Component
virtual ~Component ()=default
virtual void enable ()
virtual void disable ()
bool isEnabled () const
 Checks whether the component is currently active.
void setParent (Entity *parent)
 Sets the parent entity of this component.
EntitygetParent () const
 Returns the parent entity of this component.

Additional Inherited Members

Protected Member Functions inherited from wEngine::Component
 Component ()
 Protected constructor to restrict instantiation to derived classes.

Detailed Description

ECS component that stores a rotation angle (in degrees).

This component can be attached to any entity that needs to be rotated relative to its logical origin. The angle is expressed in degrees (positive values correspond to counter-clockwise rotation).

Usage Example:

addComponent< wEngine::RotationComponent >( 45.0f ); // Rotate 45° counter-clockwise
Author
Wilfried Koch

Constructor & Destructor Documentation

◆ RotationComponent()

wEngine::RotationComponent::RotationComponent ( float angle = 0.0f)

Construct a RotationComponent with an initial angle.

Parameters
angleInitial rotation angle in degrees (default: 0.0f).

◆ ~RotationComponent()

virtual wEngine::RotationComponent::~RotationComponent ( )
virtualdefault

Member Function Documentation

◆ setAngle()

void wEngine::RotationComponent::setAngle ( float angle)

Set the rotation angle.

Parameters
angleNew rotation angle in degrees.

◆ getAngle()

float wEngine::RotationComponent::getAngle ( ) const
nodiscard

Get the current rotation angle.

Returns
The stored angle in degrees.

◆ debugPrint()

void wEngine::RotationComponent::debugPrint ( ) const

Outputs the current angle value to the console for debugging.


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