IT. Expert System.

Android Reference

Matrix4f


android.renderscript

Class Matrix4f



  • public class Matrix4f
    extends Object
    Class for exposing the native Renderscript rs_matrix4x4 type back to the Android system.
    • Constructor Summary

      Constructors
      Constructor and Description
      Matrix4f()
      Creates a new identity 4x4 matrix
      Matrix4f(float[] dataArray)
      Creates a new matrix and sets its values from the given parameter
    • Method Summary

      Methods
      Modifier and Type Method and Description
      float get(int x, int y)
      Returns the value for a given row and column
      float[] getArray()
      Return a reference to the internal array representing matrix values.
      boolean inverse()
      Sets the current matrix to its inverse
      boolean inverseTranspose()
      Sets the current matrix to its inverse transpose
      void load(Matrix3f src)
      Sets the values of the matrix to those of the parameter
      void load(Matrix4f src)
      Sets the values of the matrix to those of the parameter
      void loadFrustum(float l, float r, float b, float t, float n, float f)
      Sets current values to be a perspective projection matrix
      void loadIdentity()
      Sets the matrix values to identity
      void loadMultiply(Matrix4f lhs, Matrix4f rhs)
      Sets current values to be the result of multiplying two given matrices
      void loadOrtho(float l, float r, float b, float t, float n, float f)
      Set current values to be an orthographic projection matrix
      void loadOrthoWindow(int w, int h)
      Set current values to be an orthographic projection matrix with the right and bottom clipping planes set to the given values.
      void loadPerspective(float fovy, float aspect, float near, float far)
      Sets current values to be a perspective projection matrix
      void loadProjectionNormalized(int w, int h)
      Helper function to set the current values to a perspective projection matrix with aspect ratio defined by the parameters and (near, far), (bottom, top) mapping to (-1, 1) at z = 0
      void loadRotate(float rot, float x, float y, float z)
      Sets current values to be a rotation matrix of certain angle about a given axis
      void loadScale(float x, float y, float z)
      Sets current values to be a scale matrix of given dimensions
      void loadTranslate(float x, float y, float z)
      Sets current values to be a translation matrix of given dimensions
      void multiply(Matrix4f rhs)
      Post-multiplies the current matrix by a given parameter
      void rotate(float rot, float x, float y, float z)
      Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis
      void scale(float x, float y, float z)
      Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions
      void set(int x, int y, float v)
      Sets the value for a given row and column
      void translate(float x, float y, float z)
      Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions
      void transpose()
      Sets the current matrix to its transpose
    • Constructor Detail

      • Matrix4f

        public Matrix4f()
        Creates a new identity 4x4 matrix
      • Matrix4f

        public Matrix4f(float[] dataArray)
        Creates a new matrix and sets its values from the given parameter
        Parameters:
        dataArray - values to set the matrix to, must be 16 floats long
    • Method Detail

      • getArray

        public float[] getArray()
        Return a reference to the internal array representing matrix values. Modifying this array will also change the matrix
        Returns:
        internal array representing the matrix
      • get

        public float get(int x,
                int y)
        Returns the value for a given row and column
        Parameters:
        x - column of the value to return
        y - row of the value to return
        Returns:
        value in the yth row and xth column
      • set

        public void set(int x,
               int y,
               float v)
        Sets the value for a given row and column
        Parameters:
        x - column of the value to set
        y - row of the value to set
      • loadIdentity

        public void loadIdentity()
        Sets the matrix values to identity
      • load

        public void load(Matrix4f src)
        Sets the values of the matrix to those of the parameter
        Parameters:
        src - matrix to load the values from
      • load

        public void load(Matrix3f src)
        Sets the values of the matrix to those of the parameter
        Parameters:
        src - matrix to load the values from
      • loadRotate

        public void loadRotate(float rot,
                      float x,
                      float y,
                      float z)
        Sets current values to be a rotation matrix of certain angle about a given axis
        Parameters:
        rot - angle of rotation
        x - rotation axis x
        y - rotation axis y
        z - rotation axis z
      • loadScale

        public void loadScale(float x,
                     float y,
                     float z)
        Sets current values to be a scale matrix of given dimensions
        Parameters:
        x - scale component x
        y - scale component y
        z - scale component z
      • loadTranslate

        public void loadTranslate(float x,
                         float y,
                         float z)
        Sets current values to be a translation matrix of given dimensions
        Parameters:
        x - translation component x
        y - translation component y
        z - translation component z
      • loadMultiply

        public void loadMultiply(Matrix4f lhs,
                        Matrix4f rhs)
        Sets current values to be the result of multiplying two given matrices
        Parameters:
        lhs - left hand side matrix
        rhs - right hand side matrix
      • loadOrtho

        public void loadOrtho(float l,
                     float r,
                     float b,
                     float t,
                     float n,
                     float f)
        Set current values to be an orthographic projection matrix
        Parameters:
        l - location of the left vertical clipping plane
        r - location of the right vertical clipping plane
        b - location of the bottom horizontal clipping plane
        t - location of the top horizontal clipping plane
        n - location of the near clipping plane
        f - location of the far clipping plane
      • loadOrthoWindow

        public void loadOrthoWindow(int w,
                           int h)
        Set current values to be an orthographic projection matrix with the right and bottom clipping planes set to the given values. Left and top clipping planes are set to 0. Near and far are set to -1, 1 respectively
        Parameters:
        w - location of the right vertical clipping plane
        h - location of the bottom horizontal clipping plane
      • loadFrustum

        public void loadFrustum(float l,
                       float r,
                       float b,
                       float t,
                       float n,
                       float f)
        Sets current values to be a perspective projection matrix
        Parameters:
        l - location of the left vertical clipping plane
        r - location of the right vertical clipping plane
        b - location of the bottom horizontal clipping plane
        t - location of the top horizontal clipping plane
        n - location of the near clipping plane, must be positive
        f - location of the far clipping plane, must be positive
      • loadPerspective

        public void loadPerspective(float fovy,
                           float aspect,
                           float near,
                           float far)
        Sets current values to be a perspective projection matrix
        Parameters:
        fovy - vertical field of view angle in degrees
        aspect - aspect ratio of the screen
        near - near cliping plane, must be positive
        far - far clipping plane, must be positive
      • loadProjectionNormalized

        public void loadProjectionNormalized(int w,
                                    int h)
        Helper function to set the current values to a perspective projection matrix with aspect ratio defined by the parameters and (near, far), (bottom, top) mapping to (-1, 1) at z = 0
        Parameters:
        w - screen width
        h - screen height
      • multiply

        public void multiply(Matrix4f rhs)
        Post-multiplies the current matrix by a given parameter
        Parameters:
        rhs - right hand side to multiply by
      • rotate

        public void rotate(float rot,
                  float x,
                  float y,
                  float z)
        Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis
        Parameters:
        rot - angle of rotation
        x - rotation axis x
        y - rotation axis y
        z - rotation axis z
      • scale

        public void scale(float x,
                 float y,
                 float z)
        Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions
        Parameters:
        x - scale component x
        y - scale component y
        z - scale component z
      • translate

        public void translate(float x,
                     float y,
                     float z)
        Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions
        Parameters:
        x - translation component x
        y - translation component y
        z - translation component z
      • inverse

        public boolean inverse()
        Sets the current matrix to its inverse
      • inverseTranspose

        public boolean inverseTranspose()
        Sets the current matrix to its inverse transpose
      • transpose

        public void transpose()
        Sets the current matrix to its transpose


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 273 / 158697782. Delta: 0.04501 с