ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
YawPitchRoll.cpp
Go to the documentation of this file.
1#include "YawPitchRoll.h"
2#include "Mathematics.h"
3
4YawPitchRoll::YawPitchRoll() : Yaw(0.0f), Pitch(0.0f), Roll(0.0f) {}
5
6YawPitchRoll::YawPitchRoll(Vector3D vector) : Yaw(vector.X), Pitch(vector.Y), Roll(vector.Z) {}
7
9
10YawPitchRoll::YawPitchRoll(float yaw, float pitch, float roll) : Yaw(yaw), Pitch(pitch), Roll(roll) {}
11
12String YawPitchRoll::ToString() const {
13 String y = Mathematics::DoubleToCleanString(this->Yaw);
15 String r = Mathematics::DoubleToCleanString(this->Roll);
16
17 return "[" + y + ", " + p + ", " + r + "]";
18}
Provides a collection of mathematical utility functions and constants.
Represents an orientation using yaw, pitch, and roll angles.
static String DoubleToCleanString(float value)
Converts a floating-point value to a String, removing trailing decimals if not needed.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26
float Yaw
The yaw angle, representing rotation around the vertical axis.
String ToString() const
Converts the yaw, pitch, and roll angles to a string representation.
YawPitchRoll()
Default constructor, initializes yaw, pitch, and roll to 0.
float Pitch
The pitch angle, representing rotation around the lateral axis.
float Roll
The roll angle, representing rotation around the longitudinal axis.