/** * @param matrix * @return This matrix for chaining, modified internally to reflect multiplication against the given matrix * @throws NullPointerException * if matrix is null */ public Matrix3 multiplyLocal(final ReadOnlyMatrix3 matrix) { return multiply(matrix, this); }
4, 5, 6, // 8, 9, 10); final Matrix3 result = mat3A.multiply(mat3B, null); assertTrue(0.02 * 0.5 + 0.2 * 4 + 0.4 * 8 == result.getM00()); assertTrue(0.02 * 1 + 0.2 * 5 + 0.4 * 9 == result.getM01());
/** * @param matrix * @return This matrix for chaining, modified internally to reflect multiplication against the given matrix * @throws NullPointerException * if matrix is null */ public Matrix3 multiplyLocal(final ReadOnlyMatrix3 matrix) { return multiply(matrix, this); }
@Test public void testInvert() { final Matrix3 mat3A = new Matrix3().applyRotationX(MathUtils.QUARTER_PI); final Matrix3 inverted = mat3A.invert(null); assertEquals(Matrix3.IDENTITY, mat3A.multiply(inverted, null)); assertEquals(mat3A, inverted.invertLocal()); }
@Override public void processInput(final Canvas source, final TwoInputStates inputStates, final AtomicBoolean inputConsumed, final InteractManager manager) { final Camera camera = source.getCanvasRenderer().getCamera(); final MouseState current = inputStates.getCurrent().getMouseState(); final MouseState previous = inputStates.getPrevious().getMouseState(); // first process mouse over state checkMouseOver(source, current, manager); if (current.getButtonsReleasedSince(previous).contains(_dragButton)) { _rotateStore.setIdentity(); if (_interactMatrix != InteractMatrix.Local) { setRingRotations(Matrix3.IDENTITY); } } // Now check drag status if (!checkShouldDrag(camera, current, previous, inputConsumed, manager)) { return; } // act on drag if (_lastDragSpatial instanceof InteractRing) { _lastRing = (InteractRing) _lastDragSpatial; final Vector2 oldMouse = new Vector2(previous.getX(), previous.getY()); final ReadOnlyQuaternion rot = getNewAxisRotation(_lastRing, oldMouse, current, camera, manager); final Transform transform = manager.getSpatialState().getTransform(); rot.toRotationMatrix(_calcMat3).multiply(transform.getMatrix(), _calcMat3); transform.setRotation(_calcMat3); // apply our filters, if any, now that we've made updates. applyFilters(manager); } }