SwingTwist::AngleAxis using Direction
This commit is contained in:
parent
06da9e5b80
commit
9406b57558
@ -105,17 +105,15 @@ SwingTwistOf<T> SwingTwistOf<T>::operator*=(const SwingTwistOf<T>& rotation) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
SwingTwistOf<T> Passer::LinearAlgebra::SwingTwistOf<T>::Inverse(
|
||||
SwingTwistOf<T> rotation) {
|
||||
SwingTwistOf<T> SwingTwistOf<T>::Inverse(SwingTwistOf<T> rotation) {
|
||||
SwingTwistOf<T> r = SwingTwistOf<T>(
|
||||
-rotation.swing.horizontal, -rotation.swing.vertical, -rotation.twist);
|
||||
return r;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
SwingTwistOf<T> Passer::LinearAlgebra::SwingTwistOf<T>::AngleAxis(
|
||||
float angle,
|
||||
const SphericalOf<T>& axis) {
|
||||
SwingTwistOf<T> SwingTwistOf<T>::AngleAxis(float angle,
|
||||
const DirectionOf<T>& axis) {
|
||||
Vector3 axis_vector = axis.ToVector3();
|
||||
Quaternion q = Quaternion::AngleAxis(angle, axis_vector);
|
||||
SwingTwistOf<T> r = SwingTwistOf<T>::FromQuaternion(q);
|
||||
|
@ -58,7 +58,7 @@ class SwingTwistOf {
|
||||
/// <param name="angle">The angle</param>
|
||||
/// <param name="axis">The axis</param>
|
||||
/// <returns>The resulting quaternion</returns>
|
||||
static SwingTwistOf<T> AngleAxis(float angle, const SphericalOf<T>& axis);
|
||||
static SwingTwistOf<T> AngleAxis(float angle, const DirectionOf<T>& axis);
|
||||
};
|
||||
|
||||
using SwingTwistSingle = SwingTwistOf<float>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user