|
Dura2D
v0.1.0
An educational 2D game physics library
|
Represents a rotation in 2D space. More...
#include <d2Math.h>
Public Member Functions | |
| d2Rot () | |
| Default constructor. | |
| d2Rot (real angle) | |
| Constructor that initializes the rotation with given angle in radians. | |
| d2Rot (real s, real c) | |
| Constructor that initializes the rotation with given sine and cosine values. | |
| void | Set (real angle) |
| Set the rotation angle from a given angle in radians. | |
| void | SetIdentity () |
| Set the rotation angle as identity. | |
| real | GetAngle () const |
| Get the rotation angle in radians. | |
| d2Vec2 | GetXAxis () const |
| Get the x-axis of the rotation. | |
| d2Vec2 | GetYAxis () const |
| Get the y-axis of the rotation. | |
| void | Add (const d2Rot &other) |
| Adds the rotation of another d2Rot object to this object. | |
| d2Rot | operator+ (const d2Rot &other) const |
| d2Rot & | operator+= (const d2Rot &other) |
| d2Rot & | operator+= (real angle) |
Public Attributes | |
| real | s |
| The sine of the rotation angle. | |
| real | c |
| The cosine of the rotation angle. | |
Represents a rotation in 2D space.
|
inline |
Default constructor.
Initializes the rotation to identity.
|
inlineexplicit |
Constructor that initializes the rotation with given angle in radians.
| angle | The angle in radians. |
Constructor that initializes the rotation with given sine and cosine values.
| s | The sine of the rotation angle. |
| c | The cosine of the rotation angle. |
|
inline |
|
inline |
Get the rotation angle in radians.
|
inline |
Get the x-axis of the rotation.
|
inline |
Get the y-axis of the rotation.
|
inline |
Set the rotation angle from a given angle in radians.
| angle | The angle in radians. |
|
inline |
Set the rotation angle as identity.
| real d2Rot::c |
The cosine of the rotation angle.
| real d2Rot::s |
The sine of the rotation angle.