@Override public void update(final double time, final Spatial caller) { if (null == caller) { throw new IllegalArgumentException("caller can not be null!"); } final Vector3 interpolated = Vector3.fetchTempInstance(); final Matrix3 rotation = Matrix3.fetchTempInstance(); _curveController.interpolateVectors(_curveController.getControlFrom(), _curveController.getControlTo(), _curveController.getDelta(), interpolated); MathUtils.matrixLookAt(_previous, interpolated, _worldUp, rotation); if (isLocalRotation()) { caller.setRotation(rotation); } else { caller.setWorldRotation(rotation); } _previous.set(interpolated); Matrix3.releaseTempInstance(rotation); Vector3.releaseTempInstance(interpolated); }
@Override public void update(final double time, final Spatial caller) { if (null == caller) { throw new IllegalArgumentException("caller can not be null!"); } final Vector3 interpolated = Vector3.fetchTempInstance(); final Matrix3 rotation = Matrix3.fetchTempInstance(); _curveController.interpolateVectors(_curveController.getControlFrom(), _curveController.getControlTo(), _curveController.getDelta(), interpolated); MathUtils.matrixLookAt(_previous, interpolated, _worldUp, rotation); if (isLocalRotation()) { caller.setRotation(rotation); } else { caller.setWorldRotation(rotation); } _previous.set(interpolated); Matrix3.releaseTempInstance(rotation); Vector3.releaseTempInstance(interpolated); }