OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Matrix.h
Go to the documentation of this file.
1 /* Copyright (c) 2013-2017, ARM Limited and Contributors
2  *
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge,
6  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef MATRIX_H
22 #define MATRIX_H
23 
28 void matrixIdentityFunction(float* matrix);
29 
37 void matrixTranslate(float* matrix, float x, float y, float z);
38 
45 void matrixMultiply(float* destination, float* operand1, float* operand2);
46 
57 void matrixFrustum(float* matrix, float left, float right, float bottom, float top, float zNear, float zFar);
58 
67 void matrixPerspective(float* matrix, float fieldOfView, float aspectRatio, float zNear, float zFar);
68 
74 void matrixRotateX(float* matrix, float angle);
75 
81 void matrixRotateY(float* matrix, float angle);
82 
88 void matrixRotateZ(float* matrix, float angle);
89 
97 void matrixScale(float* matrix,float x, float y, float z);
98 
104 float matrixDegreesToRadians(float degrees);
105 
106 #endif
void matrixRotateY(float *matrix, float angle)
Rotates a matrix around the y axis by a given angle.
Definition: Matrix.cpp:116
void matrixRotateZ(float *matrix, float angle)
Rotates a matrix around the Z axis by a given angle.
Definition: Matrix.cpp:128
void matrixRotateX(float *matrix, float angle)
Rotates a matrix around the x axis by a given angle.
Definition: Matrix.cpp:104
void matrixFrustum(float *matrix, float left, float right, float bottom, float top, float zNear, float zFar)
Create a viewing frustum and store the result in the first parameter. This is usually called by matri...
Definition: Matrix.cpp:78
void matrixTranslate(float *matrix, float x, float y, float z)
Takes in a 4 * 4 matrix and translates it by the vector defined by x y and z.
Definition: Matrix.cpp:48
void matrixScale(float *matrix, float x, float y, float z)
Scales a matrix by a given factor in the x, y and z axis.
Definition: Matrix.cpp:140
void matrixMultiply(float *destination, float *operand1, float *operand2)
Takes 2 matrices and multiplies them together. Then stores the result in a third matrix.
Definition: Matrix.cpp:58
float angle
Definition: Native.cpp:158
void matrixIdentityFunction(float *matrix)
Takes a 4 * 4 and sets the elements to the Identity function.
Definition: Matrix.cpp:23
GLint GLint GLint GLint GLint x
Definition: gl2ext.h:574
float matrixDegreesToRadians(float degrees)
Function to convert degrees into Radians.
Definition: Matrix.cpp:152
GLint left
Definition: gl2ext.h:2704
void matrixPerspective(float *matrix, float fieldOfView, float aspectRatio, float zNear, float zFar)
Create a perspective projection matrix and store the results in the first parameter.
Definition: Matrix.cpp:96
GLint y
Definition: gl2ext.h:179
GLint GLint bottom
Definition: gl2ext.h:2704