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/(float fl) 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 Sum2D() const;
|
||||
[[nodiscard]] Vector3 ViewAngleTo(const Vector3& other) const;
|
||||
|
||||
@@ -178,14 +178,14 @@ namespace uml
|
||||
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;
|
||||
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;
|
||||
transformed.z += tanf(angles.x * static_cast<float>(M_PI / 180.f)) * length;
|
||||
|
||||
return transformed;
|
||||
return
|
||||
{
|
||||
std::cos(angles::DegToRad(angles.y)) * length,
|
||||
std::sin(angles::DegToRad(angles.y)) * length,
|
||||
std::tan(angles::DegToRad(angles.x)) * length,
|
||||
};
|
||||
}
|
||||
|
||||
float Vector3::Sum() const
|
||||
|
||||
Reference in New Issue
Block a user