mirror of
https://github.com/orange-cpp/omath.git
synced 2026-08-08 05:52:07 +00:00
patch
This commit is contained in:
@@ -10,7 +10,7 @@ namespace omath::algorithm
|
||||
template<class Camera, class FloatingType>
|
||||
requires std::is_floating_point_v<FloatingType>
|
||||
[[nodiscard]]
|
||||
Vector3<float> world_to_radar(const Camera& camera, const Vector3<FloatingType>& position, const FloatingType scale)
|
||||
Vector2<float> world_to_radar(const Camera& camera, const Vector3<FloatingType>& position, const FloatingType scale)
|
||||
{
|
||||
auto look_at_angles = camera.calc_look_at_angles(position);
|
||||
auto current_angles = camera.get_view_angles();
|
||||
@@ -20,7 +20,7 @@ namespace omath::algorithm
|
||||
- current_angles.yaw + decltype(current_angles.yaw)::from_degrees(180);
|
||||
const auto right_scale = right_yaw.sin() < 0 ? -1.f : 1.f;
|
||||
|
||||
return omath::Vector3<float>(static_cast<float>(yaw.sin()) * right_scale, yaw.cos(), 0.f)
|
||||
return omath::Vector2<float>(static_cast<float>(yaw.sin()) * right_scale, yaw.cos())
|
||||
* (camera.get_origin().distance_to(position) * scale);
|
||||
}
|
||||
} // namespace omath::algorithm
|
||||
|
||||
Reference in New Issue
Block a user