/** * Does a spherical linear interpolation between the given start and end quaternions by the given change amount. * Stores the result locally. * * @param startQuat * @param endQuat * @param changeAmnt * @return this quaternion for chaining. * @throws NullPointerException * if startQuat or endQuat are null. */ public Quaternion slerpLocal(final ReadOnlyQuaternion startQuat, final ReadOnlyQuaternion endQuat, final double changeAmnt) { final Quaternion end = Quaternion.fetchTempInstance().set(endQuat); slerpLocal(startQuat, endQuat, changeAmnt, end); Quaternion.releaseTempInstance(end); return this; }
/** * Does a spherical linear interpolation between the given start and end quaternions by the given change amount. * Stores the result locally. * * @param startQuat * @param endQuat * @param changeAmnt * @return this quaternion for chaining. * @throws NullPointerException * if startQuat or endQuat are null. */ public Quaternion slerpLocal(final ReadOnlyQuaternion startQuat, final ReadOnlyQuaternion endQuat, final double changeAmnt) { final Quaternion end = Quaternion.fetchTempInstance().set(endQuat); slerpLocal(startQuat, endQuat, changeAmnt, end); Quaternion.releaseTempInstance(end); return this; }
/** * Interpolates between the given quaternions using the * {@link Quaternion#slerpLocal(ReadOnlyQuaternion, ReadOnlyQuaternion, double)} method. */ @Override protected void interpolate(final ReadOnlyQuaternion from, final ReadOnlyQuaternion to, final double delta, final Spatial caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final Quaternion tempQuat = Quaternion.fetchTempInstance(); tempQuat.slerpLocal(from, to, delta); if (isLocalRotation()) { caller.setRotation(tempQuat); } else { caller.setWorldRotation(tempQuat); } Quaternion.releaseTempInstance(tempQuat); }
/** * Interpolates between the given quaternions using the * {@link Quaternion#slerpLocal(ReadOnlyQuaternion, ReadOnlyQuaternion, double)} method. */ @Override protected void interpolate(final ReadOnlyQuaternion from, final ReadOnlyQuaternion to, final double delta, final Spatial caller) { assert (null != from) : "parameter 'from' can not be null"; assert (null != to) : "parameter 'to' can not be null"; assert (null != caller) : "parameter 'caller' can not be null"; final Quaternion tempQuat = Quaternion.fetchTempInstance(); tempQuat.slerpLocal(from, to, delta); if (isLocalRotation()) { caller.setRotation(tempQuat); } else { caller.setWorldRotation(tempQuat); } Quaternion.releaseTempInstance(tempQuat); }
final Quaternion q = Quaternion.fetchTempInstance(); q.fromAxes(shadowCam.getLeft(), shadowCam.getUp(), shadowCam.getDirection());
final Quaternion q = Quaternion.fetchTempInstance(); q.fromAxes(shadowCam.getLeft(), shadowCam.getUp(), shadowCam.getDirection());
final Quaternion kQ0 = Quaternion.fetchTempInstance(), kQ1 = Quaternion.fetchTempInstance(); kQ0.fromAxes(rkBox0._xAxis, rkBox0._yAxis, rkBox0._zAxis); kQ1.fromAxes(rkBox1._xAxis, rkBox1._yAxis, rkBox1._zAxis);
final Quaternion kQ0 = Quaternion.fetchTempInstance(), kQ1 = Quaternion.fetchTempInstance(); kQ0.fromAxes(rkBox0._xAxis, rkBox0._yAxis, rkBox0._zAxis); kQ1.fromAxes(rkBox1._xAxis, rkBox1._yAxis, rkBox1._zAxis);
switch (type) { case GeomMesh: { final Quaternion tempQuat = Quaternion.fetchTempInstance(); final ReadOnlyVector3 norm = triModel.getNormal(); if (orient != 0) {
final Quaternion tempQuat = Quaternion.fetchTempInstance(); final ReadOnlyVector3 norm = triModel.getNormal(); if (orient != 0) {
final Quaternion quatTemp = Quaternion.fetchTempInstance(); quatTemp.set(quat); assertEquals(quat, quatTemp);