コード例 #1
0
ファイル: Quaternion.java プロジェクト: Diex/residua
 /**
  * Returns the slerp interpolation of the two quaternions {@code a} and {@code b}, at time {@code
  * t}, using tangents {@code tgA} and {@code tgB}.
  *
  * <p>The resulting Quaternion is "between" {@code a} and {@code b} (result is {@code a} when
  * {@code t=0} and {@code b} for {@code t=1}).
  *
  * <p>Use {@link #squadTangent(Quaternion, Quaternion, Quaternion)} to define the Quaternion
  * tangents {@code tgA} and {@code tgB}.
  *
  * @param a the first Quaternion
  * @param tgA the first tangent Quaternion
  * @param tgB the second tangent Quaternion
  * @param b the second Quaternion
  * @param t the t interpolation parameter
  */
 public static final Quaternion squad(
     Quaternion a, Quaternion tgA, Quaternion tgB, Quaternion b, float t) {
   Quaternion ab = Quaternion.slerp(a, b, t);
   Quaternion tg = Quaternion.slerp(tgA, tgB, t, false);
   return Quaternion.slerp(ab, tg, 2.0f * t * (1.0f - t), false);
 }
コード例 #2
0
ファイル: Quaternion.java プロジェクト: Diex/residua
 /**
  * Wrapper function that simply calls {@code slerp(a, b, t, true)}.
  *
  * <p>See {@link #slerp(Quaternion, Quaternion, float, boolean)} for details.
  */
 public static final Quaternion slerp(Quaternion a, Quaternion b, float t) {
   return Quaternion.slerp(a, b, t, true);
 }