mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
renamed method
This commit is contained in:
@@ -47,7 +47,7 @@ namespace uml
|
|||||||
Vector3 operator*(const Vector3& v) const;
|
Vector3 operator*(const Vector3& v) const;
|
||||||
Vector3 operator/(float fl) const;
|
Vector3 operator/(float fl) const;
|
||||||
Vector3 operator/(const Vector3& v) const;
|
Vector3 operator/(const Vector3& v) const;
|
||||||
[[nodiscard]] Vector3 Transform(const Vector3& angles, float length) const;
|
[[nodiscard]] static Vector3 CreateVelocity(const Vector3& angles, const float length) ;
|
||||||
[[nodiscard]] float Sum() const;
|
[[nodiscard]] float Sum() const;
|
||||||
[[nodiscard]] float Sum2D() const;
|
[[nodiscard]] float Sum2D() const;
|
||||||
[[nodiscard]] Vector3 ViewAngleTo(const Vector3& other) const;
|
[[nodiscard]] Vector3 ViewAngleTo(const Vector3& other) const;
|
||||||
|
|||||||
@@ -178,14 +178,14 @@ namespace uml
|
|||||||
return {x / v.x, y / v.y, z / v.z};
|
return {x / v.x, y / v.y, z / v.z};
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 Vector3::Transform(const Vector3 &angles, const float length) const
|
Vector3 Vector3::CreateVelocity(const Vector3 &angles, const float length)
|
||||||
{
|
{
|
||||||
Vector3 transformed;
|
return
|
||||||
transformed.x += cosf(angles.y * static_cast<float>(M_PI / 180.f)) * length;
|
{
|
||||||
transformed.y += sinf(angles.y * static_cast<float>(M_PI / 180.f)) * length;
|
std::cos(angles::DegToRad(angles.y)) * length,
|
||||||
transformed.z += tanf(angles.x * static_cast<float>(M_PI / 180.f)) * length;
|
std::sin(angles::DegToRad(angles.y)) * length,
|
||||||
|
std::tan(angles::DegToRad(angles.x)) * length,
|
||||||
return transformed;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
float Vector3::Sum() const
|
float Vector3::Sum() const
|
||||||
|
|||||||
Reference in New Issue
Block a user