PowerVR Software Development Kit


Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

PVRTMatrix.h File Reference

Vector, Matrix and quaternion functions for floating and fixed point math. More...

Go to the source code of this file.

Classes

struct  PVRTVECTOR3f
struct  PVRTVECTOR3x
struct  PVRTVECTOR4f
struct  PVRTVECTOR4x
struct  PVRTQUATERNIONf
struct  PVRTQUATERNIONx
struct  PVRTMATRIXf
struct  PVRTMATRIXx

Defines

#define PVRTMatrixIdentity   PVRTMatrixIdentityF
#define PVRTMatrixMultiply   PVRTMatrixMultiplyF
#define PVRTMatrixTranslation   PVRTMatrixTranslationF
#define PVRTMatrixScaling   PVRTMatrixScalingF
#define PVRTMatrixRotationX   PVRTMatrixRotationXF
#define PVRTMatrixRotationY   PVRTMatrixRotationYF
#define PVRTMatrixRotationZ   PVRTMatrixRotationZF
#define PVRTMatrixTranspose   PVRTMatrixTransposeF
#define PVRTMatrixInverse   PVRTMatrixInverseF
#define PVRTMatrixInverseEx   PVRTMatrixInverseExF
#define PVRTMatrixLookAtLH   PVRTMatrixLookAtLHF
#define PVRTMatrixLookAtRH   PVRTMatrixLookAtRHF
#define PVRTMatrixPerspectiveFovLH   PVRTMatrixPerspectiveFovLHF
#define PVRTMatrixPerspectiveFovRH   PVRTMatrixPerspectiveFovRHF
#define PVRTMatrixOrthoLH   PVRTMatrixOrthoLHF
#define PVRTMatrixOrthoRH   PVRTMatrixOrthoRHF
#define PVRTMatrixVec3Lerp   PVRTMatrixVec3LerpF
#define PVRTMatrixVec3DotProduct   PVRTMatrixVec3DotProductF
#define PVRTMatrixVec3CrossProduct   PVRTMatrixVec3CrossProductF
#define PVRTMatrixVec3Normalize   PVRTMatrixVec3NormalizeF
#define PVRTMatrixQuaternionIdentity   PVRTMatrixQuaternionIdentityF
#define PVRTMatrixQuaternionRotationAxis   PVRTMatrixQuaternionRotationAxisF
#define PVRTMatrixQuaternionToAxisAngle   PVRTMatrixQuaternionToAxisAngleF
#define PVRTMatrixQuaternionSlerp   PVRTMatrixQuaternionSlerpF
#define PVRTMatrixQuaternionNormalize   PVRTMatrixQuaternionNormalizeF
#define PVRTMatrixRotationQuaternion   PVRTMatrixRotationQuaternionF
#define PVRTMatrixQuaternionMultiply   PVRTMatrixQuaternionMultiplyF
#define PVRTMatrixLinearEqSolve   PVRTMatrixLinearEqSolveF

Typedefs

typedef PVRTVECTOR3f PVRTVECTOR3
typedef PVRTVECTOR4f PVRTVECTOR4
typedef PVRTQUATERNIONf PVRTQUATERNION
typedef PVRTMATRIXf PVRTMATRIX

Functions

void PVRTMatrixIdentityF (PVRTMATRIXf &mOut)
void PVRTMatrixIdentityX (PVRTMATRIXx &mOut)
void PVRTMatrixMultiplyF (PVRTMATRIXf &mOut, const PVRTMATRIXf &mA, const PVRTMATRIXf &mB)
void PVRTMatrixMultiplyX (PVRTMATRIXx &mOut, const PVRTMATRIXx &mA, const PVRTMATRIXx &mB)
void PVRTMatrixTranslationF (PVRTMATRIXf &mOut, const float fX, const float fY, const float fZ)
void PVRTMatrixTranslationX (PVRTMATRIXx &mOut, const int fX, const int fY, const int fZ)
void PVRTMatrixScalingF (PVRTMATRIXf &mOut, const float fX, const float fY, const float fZ)
void PVRTMatrixScalingX (PVRTMATRIXx &mOut, const int fX, const int fY, const int fZ)
void PVRTMatrixRotationXF (PVRTMATRIXf &mOut, const float fAngle)
void PVRTMatrixRotationXX (PVRTMATRIXx &mOut, const int fAngle)
void PVRTMatrixRotationYF (PVRTMATRIXf &mOut, const float fAngle)
void PVRTMatrixRotationYX (PVRTMATRIXx &mOut, const int fAngle)
void PVRTMatrixRotationZF (PVRTMATRIXf &mOut, const float fAngle)
void PVRTMatrixRotationZX (PVRTMATRIXx &mOut, const int fAngle)
void PVRTMatrixTransposeF (PVRTMATRIXf &mOut, const PVRTMATRIXf &mIn)
void PVRTMatrixTransposeX (PVRTMATRIXx &mOut, const PVRTMATRIXx &mIn)
void PVRTMatrixInverseF (PVRTMATRIXf &mOut, const PVRTMATRIXf &mIn)
void PVRTMatrixInverseX (PVRTMATRIXx &mOut, const PVRTMATRIXx &mIn)
void PVRTMatrixInverseExF (PVRTMATRIXf &mOut, const PVRTMATRIXf &mIn)
void PVRTMatrixInverseExX (PVRTMATRIXx &mOut, const PVRTMATRIXx &mIn)
void PVRTMatrixLookAtLHF (PVRTMATRIXf &mOut, const PVRTVECTOR3f &vEye, const PVRTVECTOR3f &vAt, const PVRTVECTOR3f &vUp)
void PVRTMatrixLookAtLHX (PVRTMATRIXx &mOut, const PVRTVECTOR3x &vEye, const PVRTVECTOR3x &vAt, const PVRTVECTOR3x &vUp)
void PVRTMatrixLookAtRHF (PVRTMATRIXf &mOut, const PVRTVECTOR3f &vEye, const PVRTVECTOR3f &vAt, const PVRTVECTOR3f &vUp)
void PVRTMatrixLookAtRHX (PVRTMATRIXx &mOut, const PVRTVECTOR3x &vEye, const PVRTVECTOR3x &vAt, const PVRTVECTOR3x &vUp)
void PVRTMatrixPerspectiveFovLHF (PVRTMATRIXf &mOut, const float fFOVy, const float fAspect, const float fNear, const float fFar, const bool bRotate=false)
void PVRTMatrixPerspectiveFovLHX (PVRTMATRIXx &mOut, const int fFOVy, const int fAspect, const int fNear, const int fFar, const bool bRotate=false)
void PVRTMatrixPerspectiveFovRHF (PVRTMATRIXf &mOut, const float fFOVy, const float fAspect, const float fNear, const float fFar, const bool bRotate=false)
void PVRTMatrixPerspectiveFovRHX (PVRTMATRIXx &mOut, const int fFOVy, const int fAspect, const int fNear, const int fFar, const bool bRotate=false)
void PVRTMatrixOrthoLHF (PVRTMATRIXf &mOut, const float w, const float h, const float zn, const float zf, const bool bRotate=false)
void PVRTMatrixOrthoLHX (PVRTMATRIXx &mOut, const int w, const int h, const int zn, const int zf, const bool bRotate=false)
void PVRTMatrixOrthoRHF (PVRTMATRIXf &mOut, const float w, const float h, const float zn, const float zf, const bool bRotate=false)
void PVRTMatrixOrthoRHX (PVRTMATRIXx &mOut, const int w, const int h, const int zn, const int zf, const bool bRotate=false)
void PVRTMatrixVec3LerpF (PVRTVECTOR3f &vOut, const PVRTVECTOR3f &v1, const PVRTVECTOR3f &v2, const float s)
void PVRTMatrixVec3LerpX (PVRTVECTOR3x &vOut, const PVRTVECTOR3x &v1, const PVRTVECTOR3x &v2, const int s)
float PVRTMatrixVec3DotProductF (const PVRTVECTOR3f &v1, const PVRTVECTOR3f &v2)
int PVRTMatrixVec3DotProductX (const PVRTVECTOR3x &v1, const PVRTVECTOR3x &v2)
void PVRTMatrixVec3CrossProductF (PVRTVECTOR3f &vOut, const PVRTVECTOR3f &v1, const PVRTVECTOR3f &v2)
void PVRTMatrixVec3CrossProductX (PVRTVECTOR3x &vOut, const PVRTVECTOR3x &v1, const PVRTVECTOR3x &v2)
void PVRTMatrixVec3NormalizeF (PVRTVECTOR3f &vOut, const PVRTVECTOR3f &vIn)
void PVRTMatrixVec3NormalizeX (PVRTVECTOR3x &vOut, const PVRTVECTOR3x &vIn)
void PVRTMatrixQuaternionIdentityF (PVRTQUATERNIONf &qOut)
void PVRTMatrixQuaternionIdentityX (PVRTQUATERNIONx &qOut)
void PVRTMatrixQuaternionRotationAxisF (PVRTQUATERNIONf &qOut, const PVRTVECTOR3f &vAxis, const float fAngle)
void PVRTMatrixQuaternionRotationAxisX (PVRTQUATERNIONx &qOut, const PVRTVECTOR3x &vAxis, const int fAngle)
void PVRTMatrixQuaternionToAxisAngleF (const PVRTQUATERNIONf &qIn, PVRTVECTOR3f &vAxis, float &fAngle)
void PVRTMatrixQuaternionToAxisAngleX (const PVRTQUATERNIONx &qIn, PVRTVECTOR3x &vAxis, int &fAngle)
void PVRTMatrixQuaternionSlerpF (PVRTQUATERNIONf &qOut, const PVRTQUATERNIONf &qA, const PVRTQUATERNIONf &qB, const float t)
void PVRTMatrixQuaternionSlerpX (PVRTQUATERNIONx &qOut, const PVRTQUATERNIONx &qA, const PVRTQUATERNIONx &qB, const int t)
void PVRTMatrixQuaternionNormalizeF (PVRTQUATERNIONf &quat)
void PVRTMatrixQuaternionNormalizeX (PVRTQUATERNIONx &quat)
void PVRTMatrixRotationQuaternionF (PVRTMATRIXf &mOut, const PVRTQUATERNIONf &quat)
void PVRTMatrixRotationQuaternionX (PVRTMATRIXx &mOut, const PVRTQUATERNIONx &quat)
void PVRTMatrixQuaternionMultiplyF (PVRTQUATERNIONf &qOut, const PVRTQUATERNIONf &qA, const PVRTQUATERNIONf &qB)
void PVRTMatrixQuaternionMultiplyX (PVRTQUATERNIONx &qOut, const PVRTQUATERNIONx &qA, const PVRTQUATERNIONx &qB)
void PVRTMatrixLinearEqSolveF (float *const pRes, float **const pSrc, const int nCnt)
void PVRTMatrixLinearEqSolveX (int *const pRes, int **const pSrc, const int nCnt)


Detailed Description

Vector, Matrix and quaternion functions for floating and fixed point math.

Author:
PowerVR
Date:
August 1999
Copyright:
Copyright 2003-2004 by Imagination Technologies Limited. All rights reserved. No part of this software, either material or conceptual may be copied or distributed, transmitted, transcribed, stored in a retrieval system or translated into any human or computer language in any form by any means, electronic, mechanical, manual or other-wise, or disclosed to third parties without the express written permission of Imagination Technologies Limited, Unit 8, HomePark Industrial Estate, King's Langley, Hertfordshire, WD4 8LZ, U.K.
Platform:
ANSI compatible
Description:
Vector, Matrix and quaternion functions for floating and fixed point math. The general matrix format used is directly compatible with, for example, both DirectX and OpenGL. For the reasons why, read this: http://research.microsoft.com/~hollasch/cgindex/math/matrix/column-vec.html
Revision
1.8

Define Documentation



PVRTMatrixIdentity


#define PVRTMatrixIdentity   PVRTMatrixIdentityF
 



PVRTMatrixInverse


#define PVRTMatrixInverse   PVRTMatrixInverseF
 



PVRTMatrixInverseEx


#define PVRTMatrixInverseEx   PVRTMatrixInverseExF
 



PVRTMatrixLinearEqSolve


#define PVRTMatrixLinearEqSolve   PVRTMatrixLinearEqSolveF
 



PVRTMatrixLookAtLH


#define PVRTMatrixLookAtLH   PVRTMatrixLookAtLHF
 



PVRTMatrixLookAtRH


#define PVRTMatrixLookAtRH   PVRTMatrixLookAtRHF
 



PVRTMatrixMultiply


#define PVRTMatrixMultiply   PVRTMatrixMultiplyF
 



PVRTMatrixOrthoLH


#define PVRTMatrixOrthoLH   PVRTMatrixOrthoLHF
 



PVRTMatrixOrthoRH


#define PVRTMatrixOrthoRH   PVRTMatrixOrthoRHF
 



PVRTMatrixPerspectiveFovLH


#define PVRTMatrixPerspectiveFovLH   PVRTMatrixPerspectiveFovLHF
 



PVRTMatrixPerspectiveFovRH


#define PVRTMatrixPerspectiveFovRH   PVRTMatrixPerspectiveFovRHF
 



PVRTMatrixQuaternionIdentity


#define PVRTMatrixQuaternionIdentity   PVRTMatrixQuaternionIdentityF
 



PVRTMatrixQuaternionMultiply


#define PVRTMatrixQuaternionMultiply   PVRTMatrixQuaternionMultiplyF
 



PVRTMatrixQuaternionNormalize


#define PVRTMatrixQuaternionNormalize   PVRTMatrixQuaternionNormalizeF
 



PVRTMatrixQuaternionRotationAxis


#define PVRTMatrixQuaternionRotationAxis   PVRTMatrixQuaternionRotationAxisF
 



PVRTMatrixQuaternionSlerp


#define PVRTMatrixQuaternionSlerp   PVRTMatrixQuaternionSlerpF
 



PVRTMatrixQuaternionToAxisAngle


#define PVRTMatrixQuaternionToAxisAngle   PVRTMatrixQuaternionToAxisAngleF
 



PVRTMatrixRotationQuaternion


#define PVRTMatrixRotationQuaternion   PVRTMatrixRotationQuaternionF
 



PVRTMatrixRotationX


#define PVRTMatrixRotationX   PVRTMatrixRotationXF
 



PVRTMatrixRotationY


#define PVRTMatrixRotationY   PVRTMatrixRotationYF
 



PVRTMatrixRotationZ


#define PVRTMatrixRotationZ   PVRTMatrixRotationZF
 



PVRTMatrixScaling


#define PVRTMatrixScaling   PVRTMatrixScalingF
 



PVRTMatrixTranslation


#define PVRTMatrixTranslation   PVRTMatrixTranslationF
 



PVRTMatrixTranspose


#define PVRTMatrixTranspose   PVRTMatrixTransposeF
 



PVRTMatrixVec3CrossProduct


#define PVRTMatrixVec3CrossProduct   PVRTMatrixVec3CrossProductF
 



PVRTMatrixVec3DotProduct


#define PVRTMatrixVec3DotProduct   PVRTMatrixVec3DotProductF
 



PVRTMatrixVec3Lerp


#define PVRTMatrixVec3Lerp   PVRTMatrixVec3LerpF
 



PVRTMatrixVec3Normalize


#define PVRTMatrixVec3Normalize   PVRTMatrixVec3NormalizeF
 


Typedef Documentation



PVRTMATRIX


typedef PVRTMATRIXf PVRTMATRIX
 



PVRTQUATERNION


typedef PVRTQUATERNIONf PVRTQUATERNION
 



PVRTVECTOR3


typedef PVRTVECTOR3f PVRTVECTOR3
 



PVRTVECTOR4


typedef PVRTVECTOR4f PVRTVECTOR4
 


Function Documentation



PVRTMatrixIdentityF


void PVRTMatrixIdentityF PVRTMATRIXf mOut  ) 
 

Outputs:
mOut Set to identity
Description:
Reset matrix to identity matrix.



PVRTMatrixIdentityX


void PVRTMatrixIdentityX PVRTMATRIXx mOut  ) 
 

Outputs:
mOut Set to identity
Description:
Reset matrix to identity matrix.



PVRTMatrixInverseExF


void PVRTMatrixInverseExF PVRTMATRIXf mOut,
const PVRTMATRIXf mIn
 

Outputs:
mOut Inversed matrix
Inputs:
mIn Original matrix
Description:
Compute the inverse matrix of mIn. Uses a linear equation solver and the knowledge that M.M^-1=I. Use this fn to calculate the inverse of matrices that PVRTMatrixInverse() cannot.



PVRTMatrixInverseExX


void PVRTMatrixInverseExX PVRTMATRIXx mOut,
const PVRTMATRIXx mIn
 

Outputs:
mOut Inversed matrix
Inputs:
mIn Original matrix
Description:
Compute the inverse matrix of mIn. Uses a linear equation solver and the knowledge that M.M^-1=I. Use this fn to calculate the inverse of matrices that PVRTMatrixInverse() cannot.



PVRTMatrixInverseF


void PVRTMatrixInverseF PVRTMATRIXf mOut,
const PVRTMATRIXf mIn
 

Outputs:
mOut Inversed matrix
Inputs:
mIn Original matrix
Description:
Compute the inverse matrix of mIn. The matrix must be of the form : A 0 C 1 Where A is a 3x3 matrix and C is a 1x3 matrix.



PVRTMatrixInverseX


void PVRTMatrixInverseX PVRTMATRIXx mOut,
const PVRTMATRIXx mIn
 

Outputs:
mOut Inversed matrix
Inputs:
mIn Original matrix
Description:
Compute the inverse matrix of mIn. The matrix must be of the form : A 0 C 1 Where A is a 3x3 matrix and C is a 1x3 matrix.



PVRTMatrixLinearEqSolveF


void PVRTMatrixLinearEqSolveF float *const  pRes,
float **const  pSrc,
const int  nCnt
 

Inputs:
pSrc 2D array of floats. 4 Eq linear problem is 5x4 matrix, constants in first column
nCnt Number of equations to solve
Outputs:
pRes Result
Description:
Solves 'nCnt' simultaneous equations of 'nCnt' variables. pRes should be an array large enough to contain the results: the values of the 'nCnt' variables. This fn recursively uses Gaussian Elimination.



PVRTMatrixLinearEqSolveX


void PVRTMatrixLinearEqSolveX int *const  pRes,
int **const  pSrc,
const int  nCnt
 

Inputs:
pSrc 2D array of floats. 4 Eq linear problem is 5x4 matrix, constants in first column
nCnt Number of equations to solve
Outputs:
pRes Result
Description:
Solves 'nCnt' simultaneous equations of 'nCnt' variables. pRes should be an array large enough to contain the results: the values of the 'nCnt' variables. This fn recursively uses Gaussian Elimination.



PVRTMatrixLookAtLHF


void PVRTMatrixLookAtLHF PVRTMATRIXf mOut,
const PVRTVECTOR3f vEye,
const PVRTVECTOR3f vAt,
const PVRTVECTOR3f vUp
 

Outputs:
mOut Look-at view matrix
Inputs:
vEye Position of the camera
vAt Point the camera is looking at
vUp Up direction for the camera
Description:
Create a look-at view matrix.



PVRTMatrixLookAtLHX


void PVRTMatrixLookAtLHX PVRTMATRIXx mOut,
const PVRTVECTOR3x vEye,
const PVRTVECTOR3x vAt,
const PVRTVECTOR3x vUp
 

Outputs:
mOut Look-at view matrix
Inputs:
vEye Position of the camera
vAt Point the camera is looking at
vUp Up direction for the camera
Description:
Create a look-at view matrix.



PVRTMatrixLookAtRHF


void PVRTMatrixLookAtRHF PVRTMATRIXf mOut,
const PVRTVECTOR3f vEye,
const PVRTVECTOR3f vAt,
const PVRTVECTOR3f vUp
 

Outputs:
mOut Look-at view matrix
Inputs:
vEye Position of the camera
vAt Point the camera is looking at
vUp Up direction for the camera
Description:
Create a look-at view matrix.



PVRTMatrixLookAtRHX


void PVRTMatrixLookAtRHX PVRTMATRIXx mOut,
const PVRTVECTOR3x vEye,
const PVRTVECTOR3x vAt,
const PVRTVECTOR3x vUp
 

Outputs:
mOut Look-at view matrix
Inputs:
vEye Position of the camera
vAt Point the camera is looking at
vUp Up direction for the camera
Description:
Create a look-at view matrix.



PVRTMatrixMultiplyF


void PVRTMatrixMultiplyF PVRTMATRIXf mOut,
const PVRTMATRIXf mA,
const PVRTMATRIXf mB
 

Outputs:
mOut Result of mA x mB
Inputs:
mA First operand
mB Second operand
Description:
Multiply mA by mB and assign the result to mOut (mOut = p1 * p2). A copy of the result matrix is done in the function because mOut can be a parameter mA or mB.



PVRTMatrixMultiplyX


void PVRTMatrixMultiplyX PVRTMATRIXx mOut,
const PVRTMATRIXx mA,
const PVRTMATRIXx mB
 

Outputs:
mOut Result of mA x mB
Inputs:
mA First operand
mB Second operand
Description:
Multiply mA by mB and assign the result to mOut (mOut = p1 * p2). A copy of the result matrix is done in the function because mOut can be a parameter mA or mB. The fixed-point shift could be performed after adding all four intermediate results together however this might cause some overflow issues.



PVRTMatrixOrthoLHF


void PVRTMatrixOrthoLHF PVRTMATRIXf mOut,
const float  w,
const float  h,
const float  zn,
const float  zf,
const bool  bRotate = false
 

Outputs:
mOut Orthographic matrix
Inputs:
w Width of the screen
h Height of the screen
zn Near clipping distance
zf Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create an orthographic matrix.



PVRTMatrixOrthoLHX


void PVRTMatrixOrthoLHX PVRTMATRIXx mOut,
const int  w,
const int  h,
const int  zn,
const int  zf,
const bool  bRotate = false
 

Outputs:
mOut Orthographic matrix
Inputs:
w Width of the screen
h Height of the screen
zn Near clipping distance
zf Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create an orthographic matrix.



PVRTMatrixOrthoRHF


void PVRTMatrixOrthoRHF PVRTMATRIXf mOut,
const float  w,
const float  h,
const float  zn,
const float  zf,
const bool  bRotate = false
 

Outputs:
mOut Orthographic matrix
Inputs:
w Width of the screen
h Height of the screen
zn Near clipping distance
zf Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create an orthographic matrix.



PVRTMatrixOrthoRHX


void PVRTMatrixOrthoRHX PVRTMATRIXx mOut,
const int  w,
const int  h,
const int  zn,
const int  zf,
const bool  bRotate = false
 

Outputs:
mOut Orthographic matrix
Inputs:
w Width of the screen
h Height of the screen
zn Near clipping distance
zf Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create an orthographic matrix.



PVRTMatrixPerspectiveFovLHF


void PVRTMatrixPerspectiveFovLHF PVRTMATRIXf mOut,
const float  fFOVy,
const float  fAspect,
const float  fNear,
const float  fFar,
const bool  bRotate = false
 

Outputs:
mOut Perspective matrix
Inputs:
fFOVy Field of view
fAspect Aspect ratio
fNear Near clipping distance
fFar Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create a perspective matrix.



PVRTMatrixPerspectiveFovLHX


void PVRTMatrixPerspectiveFovLHX PVRTMATRIXx mOut,
const int  fFOVy,
const int  fAspect,
const int  fNear,
const int  fFar,
const bool  bRotate = false
 

Outputs:
mOut Perspective matrix
Inputs:
fFOVy Field of view
fAspect Aspect ratio
fNear Near clipping distance
fFar Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create a perspective matrix.



PVRTMatrixPerspectiveFovRHF


void PVRTMatrixPerspectiveFovRHF PVRTMATRIXf mOut,
const float  fFOVy,
const float  fAspect,
const float  fNear,
const float  fFar,
const bool  bRotate = false
 

Outputs:
mOut Perspective matrix
Inputs:
fFOVy Field of view
fAspect Aspect ratio
fNear Near clipping distance
fFar Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create a perspective matrix.



PVRTMatrixPerspectiveFovRHX


void PVRTMatrixPerspectiveFovRHX PVRTMATRIXx mOut,
const int  fFOVy,
const int  fAspect,
const int  fNear,
const int  fFar,
const bool  bRotate = false
 

Outputs:
mOut Perspective matrix
Inputs:
fFOVy Field of view
fAspect Aspect ratio
fNear Near clipping distance
fFar Far clipping distance
bRotate Should we rotate it ? (for upright screens)
Description:
Create a perspective matrix.



PVRTMatrixQuaternionIdentityF


void PVRTMatrixQuaternionIdentityF PVRTQUATERNIONf qOut  ) 
 

Outputs:
qOut Identity quaternion
Description:
Sets the quaternion to (0, 0, 0, 1), the identity quaternion.



PVRTMatrixQuaternionIdentityX


void PVRTMatrixQuaternionIdentityX PVRTQUATERNIONx qOut  ) 
 

Outputs:
qOut Identity quaternion
Description:
Sets the quaternion to (0, 0, 0, 1), the identity quaternion.



PVRTMatrixQuaternionMultiplyF


void PVRTMatrixQuaternionMultiplyF PVRTQUATERNIONf qOut,
const PVRTQUATERNIONf qA,
const PVRTQUATERNIONf qB
 

Outputs:
qOut Resulting quaternion
Inputs:
qA First quaternion to multiply
qB Second quaternion to multiply
Description:
Multiply quaternion A with quaternion B and return the result in qOut.



PVRTMatrixQuaternionMultiplyX


void PVRTMatrixQuaternionMultiplyX PVRTQUATERNIONx qOut,
const PVRTQUATERNIONx qA,
const PVRTQUATERNIONx qB
 

Outputs:
qOut Resulting quaternion
Inputs:
qA First quaternion to multiply
qB Second quaternion to multiply
Description:
Multiply quaternion A with quaternion B and return the result in qOut. Input quaternions must be normalized.



PVRTMatrixQuaternionNormalizeF


void PVRTMatrixQuaternionNormalizeF PVRTQUATERNIONf quat  ) 
 

Modified:
quat Vector to normalize
Description:
Normalize quaternion.



PVRTMatrixQuaternionNormalizeX


void PVRTMatrixQuaternionNormalizeX PVRTQUATERNIONx quat  ) 
 

Modified:
quat Vector to normalize
Description:
Normalize quaternion. Original quaternion is scaled down prior to be normalized in order to avoid overflow issues.



PVRTMatrixQuaternionRotationAxisF


void PVRTMatrixQuaternionRotationAxisF PVRTQUATERNIONf qOut,
const PVRTVECTOR3f vAxis,
const float  fAngle
 

Outputs:
qOut Rotation quaternion
Inputs:
vAxis Axis to rotate around
fAngle Angle to rotate
Description:
Create quaternion corresponding to a rotation of fAngle radians around submitted vector.



PVRTMatrixQuaternionRotationAxisX


void PVRTMatrixQuaternionRotationAxisX PVRTQUATERNIONx qOut,
const PVRTVECTOR3x vAxis,
const int  fAngle
 

Outputs:
qOut Rotation quaternion
Inputs:
vAxis Axis to rotate around
fAngle Angle to rotate
Description:
Create quaternion corresponding to a rotation of fAngle radians around submitted vector.



PVRTMatrixQuaternionSlerpF


void PVRTMatrixQuaternionSlerpF PVRTQUATERNIONf qOut,
const PVRTQUATERNIONf qA,
const PVRTQUATERNIONf qB,
const float  t
 

Outputs:
qOut Result of the interpolation
Inputs:
qA First quaternion to interpolate from
qB Second quaternion to interpolate from
t Coefficient of interpolation
Description:
Perform a Spherical Linear intERPolation between quaternion A and quaternion B at time t. t must be between 0.0f and 1.0f



PVRTMatrixQuaternionSlerpX


void PVRTMatrixQuaternionSlerpX PVRTQUATERNIONx qOut,
const PVRTQUATERNIONx qA,
const PVRTQUATERNIONx qB,
const int  t
 

Outputs:
qOut Result of the interpolation
Inputs:
qA First quaternion to interpolate from
qB Second quaternion to interpolate from
t Coefficient of interpolation
Description:
Perform a Spherical Linear intERPolation between quaternion A and quaternion B at time t. t must be between 0.0f and 1.0f Requires input quaternions to be normalized



PVRTMatrixQuaternionToAxisAngleF


void PVRTMatrixQuaternionToAxisAngleF const PVRTQUATERNIONf qIn,
PVRTVECTOR3f vAxis,
float &  fAngle
 

Inputs:
qIn Quaternion to transform
Outputs:
vAxis Axis of rotation
fAngle Angle of rotation
Description:
Convert a quaternion to an axis and angle. Expects a unit quaternion.



PVRTMatrixQuaternionToAxisAngleX


void PVRTMatrixQuaternionToAxisAngleX const PVRTQUATERNIONx qIn,
PVRTVECTOR3x vAxis,
int &  fAngle
 

Inputs:
qIn Quaternion to transform
Outputs:
vAxis Axis of rotation
fAngle Angle of rotation
Description:
Convert a quaternion to an axis and angle. Expects a unit quaternion.



PVRTMatrixRotationQuaternionF


void PVRTMatrixRotationQuaternionF PVRTMATRIXf mOut,
const PVRTQUATERNIONf quat
 

Outputs:
mOut Resulting rotation matrix
Inputs:
quat Quaternion to transform
Description:
Create rotation matrix from submitted quaternion. Assuming the quaternion is of the form [X Y Z W]:
| 2 2 | | 1 - 2Y - 2Z 2XY - 2ZW 2XZ + 2YW 0 | | | | 2 2 | M = | 2XY + 2ZW 1 - 2X - 2Z 2YZ - 2XW 0 | | | | 2 2 | | 2XZ - 2YW 2YZ + 2XW 1 - 2X - 2Y 0 | | | | 0 0 0 1 |



PVRTMatrixRotationQuaternionX


void PVRTMatrixRotationQuaternionX PVRTMATRIXx mOut,
const PVRTQUATERNIONx quat
 

Outputs:
mOut Resulting rotation matrix
Inputs:
quat Quaternion to transform
Description:
Create rotation matrix from submitted quaternion. Assuming the quaternion is of the form [X Y Z W]:
| 2 2 | | 1 - 2Y - 2Z 2XY - 2ZW 2XZ + 2YW 0 | | | | 2 2 | M = | 2XY + 2ZW 1 - 2X - 2Z 2YZ - 2XW 0 | | | | 2 2 | | 2XZ - 2YW 2YZ + 2XW 1 - 2X - 2Y 0 | | | | 0 0 0 1 |



PVRTMatrixRotationXF


void PVRTMatrixRotationXF PVRTMATRIXf mOut,
const float  fAngle
 

PVRTMatrixRotationXF

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an X rotation matrix mOut.



PVRTMatrixRotationXX


void PVRTMatrixRotationXX PVRTMATRIXx mOut,
const int  fAngle
 

PVRTMatrixRotationXX

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an X rotation matrix mOut.



PVRTMatrixRotationYF


void PVRTMatrixRotationYF PVRTMATRIXf mOut,
const float  fAngle
 

PVRTMatrixRotationYF

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an Y rotation matrix mOut.



PVRTMatrixRotationYX


void PVRTMatrixRotationYX PVRTMATRIXx mOut,
const int  fAngle
 

PVRTMatrixRotationYX

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an Y rotation matrix mOut.



PVRTMatrixRotationZF


void PVRTMatrixRotationZF PVRTMATRIXf mOut,
const float  fAngle
 

PVRTMatrixRotationZF

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an Z rotation matrix mOut.



PVRTMatrixRotationZX


void PVRTMatrixRotationZX PVRTMATRIXx mOut,
const int  fAngle
 

PVRTMatrixRotationZX

Outputs:
mOut Rotation matrix
Inputs:
fAngle Angle of the rotation
Description:
Create an Z rotation matrix mOut.



PVRTMatrixScalingF


void PVRTMatrixScalingF PVRTMATRIXf mOut,
const float  fX,
const float  fY,
const float  fZ
 

PVRTMatrixScalingF

Outputs:
mOut Scale matrix
Inputs:
fX X component of the scaling
fY Y component of the scaling
fZ Z component of the scaling
Description:
Build a scale matrix mOut using fX, fY and fZ.



PVRTMatrixScalingX


void PVRTMatrixScalingX PVRTMATRIXx mOut,
const int  fX,
const int  fY,
const int  fZ
 

PVRTMatrixScalingX

Outputs:
mOut Scale matrix
Inputs:
fX X component of the scaling
fY Y component of the scaling
fZ Z component of the scaling
Description:
Build a scale matrix mOut using fX, fY and fZ.



PVRTMatrixTranslationF


void PVRTMatrixTranslationF PVRTMATRIXf mOut,
const float  fX,
const float  fY,
const float  fZ
 

PVRTMatrixTranslationF

Outputs:
mOut Translation matrix
Inputs:
fX X component of the translation
fY Y component of the translation
fZ Z component of the translation
Description:
Build a transaltion matrix mOut using fX, fY and fZ.



PVRTMatrixTranslationX


void PVRTMatrixTranslationX PVRTMATRIXx mOut,
const int  fX,
const int  fY,
const int  fZ
 

PVRTMatrixTranslationX

Outputs:
mOut Translation matrix
Inputs:
fX X component of the translation
fY Y component of the translation
fZ Z component of the translation
Description:
Build a transaltion matrix mOut using fX, fY and fZ.



PVRTMatrixTransposeF


void PVRTMatrixTransposeF PVRTMATRIXf mOut,
const PVRTMATRIXf mIn
 

PVRTMatrixTransposeF

Outputs:
mOut Transposed matrix
Inputs:
mIn Original matrix
Description:
Compute the transpose matrix of mIn.



PVRTMatrixTransposeX


void PVRTMatrixTransposeX PVRTMATRIXx mOut,
const PVRTMATRIXx mIn
 

PVRTMatrixTransposeX

Outputs:
mOut Transposed matrix
Inputs:
mIn Original matrix
Description:
Compute the transpose matrix of mIn.



PVRTMatrixVec3CrossProductF


void PVRTMatrixVec3CrossProductF PVRTVECTOR3f vOut,
const PVRTVECTOR3f v1,
const PVRTVECTOR3f v2
 

Outputs:
vOut Cross product of the two vectors
Inputs:
v1 First vector
v2 Second vector
Description:
This function performs the cross product of the two supplied vectors.



PVRTMatrixVec3CrossProductX


void PVRTMatrixVec3CrossProductX PVRTVECTOR3x vOut,
const PVRTVECTOR3x v1,
const PVRTVECTOR3x v2
 

Outputs:
vOut Cross product of the two vectors
Inputs:
v1 First vector
v2 Second vector
Description:
This function performs the cross product of the two supplied vectors.



PVRTMatrixVec3DotProductF


float PVRTMatrixVec3DotProductF const PVRTVECTOR3f v1,
const PVRTVECTOR3f v2
 

Inputs:
v1 First vector
v2 Second vector
Returns:
Dot product of the two vectors.
Description:
This function performs the dot product of the two supplied vectors.



PVRTMatrixVec3DotProductX


int PVRTMatrixVec3DotProductX const PVRTVECTOR3x v1,
const PVRTVECTOR3x v2
 

Inputs:
v1 First vector
v2 Second vector
Returns:
Dot product of the two vectors.
Description:
This function performs the dot product of the two supplied vectors. A single >> 16 shift could be applied to the final accumulated result however this runs the risk of overflow between the results of the intermediate additions.



PVRTMatrixVec3LerpF


void PVRTMatrixVec3LerpF PVRTVECTOR3f vOut,
const PVRTVECTOR3f v1,
const PVRTVECTOR3f v2,
const float  s
 

Outputs:
vOut Result of the interpolation
Inputs:
v1 First vector to interpolate from
v2 Second vector to interpolate form
s Coefficient of interpolation
Description:
This function performs the linear interpolation based on the following formula: V1 + s(V2-V1).



PVRTMatrixVec3LerpX


void PVRTMatrixVec3LerpX PVRTVECTOR3x vOut,
const PVRTVECTOR3x v1,
const PVRTVECTOR3x v2,
const int  s
 

Outputs:
vOut Result of the interpolation
Inputs:
v1 First vector to interpolate from
v2 Second vector to interpolate form
s Coefficient of interpolation
Description:
This function performs the linear interpolation based on the following formula: V1 + s(V2-V1).



PVRTMatrixVec3NormalizeF


void PVRTMatrixVec3NormalizeF PVRTVECTOR3f vOut,
const PVRTVECTOR3f vIn
 

Outputs:
vOut Normalized vector
Inputs:
vIn Vector to normalize
Description:
Normalizes the supplied vector.



PVRTMatrixVec3NormalizeX


void PVRTMatrixVec3NormalizeX PVRTVECTOR3x vOut,
const PVRTVECTOR3x vIn
 

Outputs:
vOut Normalized vector
Inputs:
vIn Vector to normalize
Description:
Normalizes the supplied vector. The square root function is currently still performed in floating-point. Original vector is scaled down prior to be normalized in order to avoid overflow issues.


Copyright © 1999-2006, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Ltd.


Generated by DOXYGEN 1.3.6