Class MatrixUtils


  • public class MatrixUtils
    extends Object
    Author:
    royer
    • Constructor Detail

      • MatrixUtils

        public MatrixUtils()
    • Method Detail

      • matrixToArray

        public static final float[] matrixToArray​(Matrix4f pMatrix)
        Converts Matrix4f into an array that can be sent to an OpenCL kernel as a float16.
        Parameters:
        pMatrix - matrix to convert
        Returns:
        array of 16 floats representing 4x4 matrix
      • matrixToBuffer

        public static ClearCLBuffer matrixToBuffer​(ClearCLContext pContext,
                                                   ClearCLBuffer pClearCLBuffer,
                                                   Matrix4f pMatrix)
        Allocates an ClearCL buffer and copies the contents of a Matrix4f to it. the buffer is newly allocated if it is not the case already or if it is of the wrong size.
        Parameters:
        pContext - clearcl context
        pClearCLBuffer - buffer
        pMatrix - matrix
        Returns:
        buffer