Example usage for org.apache.commons.math3.geometry.euclidean.threed Rotation getMatrix

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Rotation getMatrix

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Rotation getMatrix.

Prototype

public double[][] getMatrix() 

Source Link

Document

Get the 3X3 matrix corresponding to the instance

Usage

From source file:nova.core.util.math.MatrixStack.java

/**
 * Rotates the current matrix//  w w  w  .j av  a2 s .  com
 *
 * @param rotation The rotation to aply
 * @return The rorated matrix
 */
public MatrixStack rotate(Rotation rotation) {
    RealMatrix rotMat = MatrixUtils.createRealMatrix(4, 4);
    rotMat.setSubMatrix(rotation.getMatrix(), 0, 0);
    rotMat.setEntry(3, 3, 1);
    current = current.preMultiply(rotMat);
    return this;
}