Files
bullet3/ObsoleteDemos/NativeClient/transforms.h
erwin coumans 69e5454d18 Add the old Bullet 2.x obsolete demos, and CMake buildsystem files, and gradually move them to newer Bullet 3.x structure
Use statically linked freeglut, instead of dynamic glut for the obsolete Bullet 2.x demos
Add the 'reset' method to b3GpuDynamicsWorld, and use it in the BasicGpuDemo (pretty slow in debug mode, use release mode)
Don't crash in btCollisionWorld, if there is no collision dispatcher
2013-12-19 12:40:59 -08:00

46 lines
1.4 KiB
C++

// Copyright (c) 2011 The Native Client Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXAMPLES_TUMBLER_TRANSFORMS_H_
#define EXAMPLES_TUMBLER_TRANSFORMS_H_
#include <GLES2/gl2.h>
// A very simple set of 4x4 matrix routines. In all these routines, the input
// matrix is assumed to be a 4x4 of GLfloats.
namespace transform_4x4 {
// Pre-multply |m| with a projection transformation 4x4 matrix from a
// truncated pyramid viewing frustum.
void Frustum(GLfloat* m,
GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat near_z,
GLfloat far_z);
// Replace |m| with the 4x4 identity matrix.
void LoadIdentity(GLfloat* m);
// |m| <- |a| . |b|. |m| can point at the same memory as either |a| or |b|.
void Multiply(GLfloat *m, GLfloat *a, GLfloat* b);
// Pre-multiply |m| with a single-point perspective matrix based on the viewing
// frustum whose view angle is |fovy|.
void Perspective(GLfloat* m,
GLfloat fovy,
GLfloat aspect,
GLfloat near_z,
GLfloat far_z);
// Pre-multiply |m| with a matrix that represents a translation by |tx|, |ty|,
// |tz|.
void Translate(GLfloat* m, GLfloat tx, GLfloat ty, GLfloat tz);
} // namespace transform_4x4
#endif // EXAMPLES_TUMBLER_TRANSFORMS_H_