| 564 | } |
| 565 | |
| 566 | Quaternion Quaternion::GetRotationFromNormal(const Vector3& normal, const Transform& reference) |
| 567 | { |
| 568 | Float3 up = reference.GetUp(); |
| 569 | const Real dot = Vector3::Dot(normal, up); |
| 570 | if (Math::NearEqual(Math::Abs(dot), 1)) |
| 571 | up = reference.GetRight(); |
| 572 | return Quaternion::LookRotation(normal, up); |
| 573 | } |
no test coverage detected