blob: ed094eda094c092ab37d33ea973419894e2da10f [file] [log] [blame]
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/** @file
* Implements simple matrix manipulation functions.
#include <limits.h>
#include <math.h>
#include <GLES2/gl2.h>
typedef GLfloat Matrix_t[16];
/// Since GLES2 doesn't have all the nifty matrix transform functions that GL
/// has, we emulate some of them here for the sake of sanity from:
void glhFrustumf2(Matrix_t mat,
GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat znear,
GLfloat zfar);
void glhPerspectivef2(Matrix_t mat,
GLfloat fovyInDegrees,
GLfloat aspectRatio,
GLfloat znear,
GLfloat zfar);
void identity_matrix(Matrix_t mat);
void multiply_matrix(const Matrix_t a, const Matrix_t b, Matrix_t mat);
void rotate_matrix(GLfloat x_deg, GLfloat y_deg, GLfloat z_deg, Matrix_t mat);
void translate_matrix(GLfloat x, GLfloat y, GLfloat z, Matrix_t mat);