/** * 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); }
Vector3.releaseTempInstance(lightSpace); Quaternion.releaseTempInstance(q);
Vector3.releaseTempInstance(lightSpace); Quaternion.releaseTempInstance(q);
Quaternion.releaseTempInstance(kQ0); Quaternion.releaseTempInstance(kQ1); Matrix3.releaseTempInstance(kBoxaxis); Vector3.releaseTempInstance(kBoxCenter);
Quaternion.releaseTempInstance(kQ0); Quaternion.releaseTempInstance(kQ1); Matrix3.releaseTempInstance(kBoxaxis); Vector3.releaseTempInstance(kBoxCenter);
BufferUtils.setInBuffer(tempVec3, vertexBuffer, startIndex + x); Quaternion.releaseTempInstance(tempQuat); break;
BufferUtils.setInBuffer(tempVec3, vertexBuffer, startIndex + x); Quaternion.releaseTempInstance(tempQuat); break;
assertEquals(quat, quatTemp); assertNotSame(quat, quatTemp); Quaternion.releaseTempInstance(quatTemp);