Here you can find the source of copyMatrixRow(final float[] m_in, final int m_in_off, final int row, final float[] v_out, final int v_out_off)
Parameter | Description |
---|---|
m_in | input column-major matrix |
m_in_off | offset to input matrix |
row | named row to copy |
v_out | the row-vector storage, at least 3 components long |
v_out_off | offset to storage |
public static float[] copyMatrixRow(final float[] m_in, final int m_in_off, final int row, final float[] v_out, final int v_out_off)
//package com.java2s; public class Main { /**// ww w. j av a 2 s. c om * Copy the named row of the given column-major matrix to v_out. * <p> * v_out may be 3 or 4 components long, hence the 4th column may not be stored. * </p> * @param m_in input column-major matrix * @param m_in_off offset to input matrix * @param row named row to copy * @param v_out the row-vector storage, at least 3 components long * @param v_out_off offset to storage * @return given result vector <i>v_out</i> for chaining */ public static float[] copyMatrixRow(final float[] m_in, final int m_in_off, final int row, final float[] v_out, final int v_out_off) { v_out[0 + v_out_off] = m_in[row + 0 * 4 + m_in_off]; v_out[1 + v_out_off] = m_in[row + 1 * 4 + m_in_off]; v_out[2 + v_out_off] = m_in[row + 2 * 4 + m_in_off]; if (v_out.length > 3 + v_out_off) { v_out[3 + v_out_off] = m_in[row + 3 * 4 + m_in_off]; } return v_out; } }