mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added camera
This commit is contained in:
@@ -219,7 +219,12 @@ namespace omath
|
||||
const auto sinYaw = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
|
||||
return {cosPitch*cosYaw, cosPitch*sinYaw, sinPitch};
|
||||
return
|
||||
{
|
||||
cosPitch*cosYaw,
|
||||
cosPitch*sinYaw,
|
||||
sinPitch
|
||||
};
|
||||
}
|
||||
|
||||
Vector3 Vector3::RightVector(const float pitch, const float yaw, const float roll)
|
||||
@@ -230,13 +235,33 @@ namespace omath
|
||||
const auto cosYaw = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinYaw = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
const auto cosRoll = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinRoll = std::sin(angles::DegreesToRadians(yaw));
|
||||
const auto cosRoll = std::cos(angles::DegreesToRadians(roll));
|
||||
const auto sinRoll = std::sin(angles::DegreesToRadians(roll));
|
||||
|
||||
|
||||
return {-sinRoll*sinPitch*cosYaw + -cosRoll*-sinYaw,
|
||||
-sinRoll*sinPitch*sinYaw + -cosRoll*cosYaw,
|
||||
sinRoll*cosPitch};
|
||||
-sinRoll*cosPitch};
|
||||
}
|
||||
|
||||
Vector3 Vector3::UpVector(float pitch, float yaw, float roll)
|
||||
{
|
||||
const auto cosPitch = std::cos(angles::DegreesToRadians(pitch));
|
||||
const auto sinPitch = std::sin(angles::DegreesToRadians(pitch));
|
||||
|
||||
const auto cosYaw = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinYaw = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
const auto cosRoll = std::cos(angles::DegreesToRadians(roll));
|
||||
const auto sinRoll = std::sin(angles::DegreesToRadians(roll));
|
||||
|
||||
|
||||
return
|
||||
{
|
||||
cosRoll*sinPitch*cosYaw+-sinRoll*-sinYaw,
|
||||
cosRoll*sinPitch*cosYaw+-sinRoll*-sinYaw,
|
||||
cosRoll*cosPitch,
|
||||
};
|
||||
}
|
||||
|
||||
Vector3 Vector3::Cross(const Vector3 &v) const
|
||||
|
||||
Reference in New Issue
Block a user