coastline 0.0.4
Loading...
Searching...
No Matches
gu.h
Go to the documentation of this file.
1#ifndef PR_GU_H
2#define PR_GU_H
3
8
9#include <PR/gbi.h>
10#include <PR/ultratypes.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
26void guMtxF2L(float mf[4][4], Mtx *m);
27
38void guMtxL2F(float mf[4][4], Mtx *m);
39
51void guMtxIdentF(float mf[4][4]);
52
62void guMtxIdent(Mtx *m);
63
77void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4]);
78
90void guMtxCatL(Mtx *m, Mtx *n, Mtx *res);
91
107void guMtxXFMF(float mf[4][4], float x, float y, float z, float *ox, float *oy, float *oz);
108
124void guMtxXFML(Mtx *m, float x, float y, float z, float *ox, float *oy, float *oz);
125
140void guScaleF(float mf[4][4], float x, float y, float z);
141
154void guScale(Mtx *m, float x, float y, float z);
155
170void guTranslateF(float mf[4][4], float x, float y, float z);
171
184void guTranslate(Mtx *m, float x, float y, float z);
185
201void guRotateF(float mf[4][4], float a, float x, float y, float z);
202
216void guRotate(Mtx *m, float a, float x, float y, float z);
217
229void guNormalize(float *x, float *y, float *z);
230
231#if TGR_BOSS_RALLY
238void guFrustumF(float mf[4][4],
239 float left,
240 float right,
241 float bottom,
242 float top,
243 float near,
244 float far,
245 float scale);
246#endif /* TGR_BOSS_RALLY */
247
267 float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale);
268
285 Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, float scale);
286
307void guLookAtF(float mf[4][4],
308 float xEye,
309 float yEye,
310 float zEye,
311 float xAt,
312 float yAt,
313 float zAt,
314 float xUp,
315 float yUp,
316 float zUp);
317
336void guLookAt(Mtx *m,
337 float xEye,
338 float yEye,
339 float zEye,
340 float xAt,
341 float yAt,
342 float zAt,
343 float xUp,
344 float yUp,
345 float zUp);
346
368void guLookAtReflectF(float mf[4][4],
369 LookAt *l,
370 float xEye,
371 float yEye,
372 float zEye,
373 float xAt,
374 float yAt,
375 float zAt,
376 float xUp,
377 float yUp,
378 float zUp);
379
400 LookAt *l,
401 float xEye,
402 float yEye,
403 float zEye,
404 float xAt,
405 float yAt,
406 float zAt,
407 float xUp,
408 float yUp,
409 float zUp);
410
442void guLookAtHiliteF(float mf[4][4],
443 LookAt *l,
444 Hilite *h,
445 float xEye,
446 float yEye,
447 float zEye,
448 float xAt,
449 float yAt,
450 float zAt,
451 float xUp,
452 float yUp,
453 float zUp,
454 float xl1,
455 float yl1,
456 float zl1,
457 float xl2,
458 float yl2,
459 float zl2,
460 int twidth,
461 int theight);
462
492 LookAt *l,
493 Hilite *h,
494 float xEye,
495 float yEye,
496 float zEye,
497 float xAt,
498 float yAt,
499 float zAt,
500 float xUp,
501 float yUp,
502 float zUp,
503 float xl1,
504 float yl1,
505 float zl1,
506 float xl2,
507 float yl2,
508 float zl2,
509 int twidth,
510 int theight);
511
512#if defined(TGR_PLATFORM) && TGR_PLATFORM == TGR_PLATFORM_SDL
513/* The SDL game takes the three from the C library, as the PC release does. */
514#include <math.h>
515#else
526float sinf(float x);
527
538float cosf(float x);
539
550float sqrtf(float x);
551#endif /* defined(TGR_PLATFORM) && TGR_PLATFORM == TGR_PLATFORM_SDL */
552
564
565#ifdef __cplusplus
566}
567#endif
568
569#endif /* PR_GU_H */
The graphics binary interface types the gu routines fill in for the RSP microcode.
void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp, float xl1, float yl1, float zl1, float xl2, float yl2, float zl2, int twidth, int theight)
Build a fixed-point viewing matrix with reflection directions and highlights.
void guTranslateF(float mf[4][4], float x, float y, float z)
Build a floating-point translation matrix.
void guScaleF(float mf[4][4], float x, float y, float z)
Build a floating-point scale matrix.
void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp)
Build a floating-point viewing matrix from the eye, the point it looks at and the up vector.
void guMtxIdentF(float mf[4][4])
Set a floating-point matrix to the identity.
void guMtxF2L(float mf[4][4], Mtx *m)
Convert a floating-point matrix to the fixed-point form of the RSP.
void guScale(Mtx *m, float x, float y, float z)
Build a fixed-point scale matrix.
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
Build a floating-point perspective projection.
float sqrtf(float x)
Return the square root.
void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4])
Multiply two floating-point matrices.
void guLookAtReflectF(float mf[4][4], LookAt *l, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp)
Build a floating-point viewing matrix and the directions for reflection mapping.
void guMtxCatL(Mtx *m, Mtx *n, Mtx *res)
Multiply two fixed-point matrices.
void guTranslate(Mtx *m, float x, float y, float z)
Build a fixed-point translation matrix.
void guRotateF(float mf[4][4], float a, float x, float y, float z)
Build a floating-point matrix that rotates by a degrees about an axis.
void guMtxXFML(Mtx *m, float x, float y, float z, float *ox, float *oy, float *oz)
Transform a point by a fixed-point matrix.
void guNormalize(float *x, float *y, float *z)
Scale a vector to unit length in place.
float cosf(float x)
Return the cosine of an angle in radians.
void guLookAt(Mtx *m, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp)
Build a fixed-point viewing matrix.
float sinf(float x)
Return the sine of an angle in radians.
void guMtxIdent(Mtx *m)
Set a fixed-point matrix to the identity.
void guMtxL2F(float mf[4][4], Mtx *m)
Convert a fixed-point matrix to floating point.
void guRotate(Mtx *m, float a, float x, float y, float z)
Build a fixed-point matrix that rotates by a degrees about an axis.
void guMtxXFMF(float mf[4][4], float x, float y, float z, float *ox, float *oy, float *oz)
Transform a point by a floating-point matrix.
void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp, float xl1, float yl1, float zl1, float xl2, float yl2, float zl2, int twidth, int theight)
Build a floating-point viewing matrix, the reflection directions and the positions of the highlights ...
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
Build a fixed-point perspective projection.
s16 sins(u16 x)
Return the sine of an angle where 0x10000 is a full turn, in s1.15 fixed point.
void guLookAtReflect(Mtx *m, LookAt *l, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp)
Build a fixed-point viewing matrix and the directions for reflection mapping.
The two directions the RSP uses to generate texture coordinates for reflection mapping.
Definition gbi.h:39
Integer and floating-point types of libultra.
short s16
Definition ultratypes.h:24
unsigned short u16
Definition ultratypes.h:19
The coordinates of two specular highlights, aligned for the RSP.
Definition gbi.h:52
A 4 by 4 matrix in s15.16 fixed point, with the integer halves before the fractions.
Definition gbi.h:16