#include <PS2Math.h>
Public Member Functions | |
Vector4 () | |
Simple constructor, there is nothing to initialize. | |
Vector4 (float x, float y, float z, float w=1) | |
Contructor to initialize the vector with coordinates values. | |
Vector4 & | Omogenize () |
Divide x,y,z by w to find real R3 coordinates. | |
Vector4 & | Normalize () |
Normalize vector dividing by the module. | |
Vector4 & | OmogenizeWtoZ () |
Divide x, y by w, put w to z and set w to 1, used to omogenize a projected vertex. | |
float | ConvertToFixedPoint (int[]) |
Transform data into fixed point format of front buffer of GS. | |
float & | operator[] (int Index) |
operator to use this class as an array. | |
const float | operator[] (int Index) const |
operator to use this class as an array. (Const version) | |
Public Attributes | |
float | x |
Values storing coordinates of the vertex. | |
float | y |
Values storing coordinates of the vertex. | |
float | z |
Values storing coordinates of the vertex. | |
float | w |
Values storing coordinates of the vertex. |
Definition at line 125 of file PS2Math.h.
|
Simple constructor from explicit float values. Last value is defaulted to 1. Definition at line 19 of file Vector4.cpp. |
|
This routine is peculiar to PS2 and it's used to convert coordinate values from normal floating point representation to fixed point representation used by front buffer of ps2. Vector is deomogenized during conversion since this operation is done only before sending data to front buffer. If texture Perspective correction is used (S,T,Q) remember that this routine is to be called immediatly after projection matrix is applied, this because perspective correction algorithm needs to know W value of the vector after projection.
Definition at line 183 of file Vector4.cpp. |
|
Do normalization of the vector dividing all coordinate for the module of the vector itself. Definition at line 46 of file Vector4.cpp. |
|
Simply divide x, y, z by w coordinate to move from omogeneuos coordinate to normal cartesian coordinate system. Definition at line 32 of file Vector4.cpp. |
|
Used in conjunction with projection matrix. Some type of projection matrix are W-friendly, this means that after transformation Z coordinate of the vertices are stored in w coordinate of projected vertices. This function is used to bring vector back to normal 3D coordinate system after a projection. Definition at line 63 of file Vector4.cpp. |
|
Operator [] is normally used to access the vector4 structure like an array. Definition at line 77 of file Vector4.cpp. |