mirror of
https://github.com/HarbourMasters/Starship
synced 2026-09-12 21:25:52 -04:00
ortho.c is matching (allá se lo están haciendo...)
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "PR/gbi.h"
|
||||
|
||||
void guMtxIdentF(float (*mf)[4]);
|
||||
|
||||
float sqrtf(float value);
|
||||
#include "PR/gu.h"
|
||||
|
||||
void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp,
|
||||
float yUp, float zUp) {
|
||||
|
||||
+29
-3
@@ -1,5 +1,31 @@
|
||||
#include "common.h"
|
||||
#include "global.h"
|
||||
#include "PR/gu.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/ortho/guOrthoF.s")
|
||||
void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/ortho/guOrtho.s")
|
||||
guMtxIdentF(mf);
|
||||
|
||||
mf[0][0] = 2 / (r - l);
|
||||
mf[1][1] = 2 / (t - b);
|
||||
mf[2][2] = -2 / (f - n);
|
||||
mf[3][0] = -(r + l) / (r - l);
|
||||
mf[3][1] = -(t + b) / (t - b);
|
||||
mf[3][2] = -(f + n) / (f - n);
|
||||
mf[3][3] = 1;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
mf[i][j] *= scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void guOrtho(Mtx* m, float l, float r, float b, float t, float n, float f, float scale) {
|
||||
Matrix mf;
|
||||
|
||||
guOrthoF(mf, l, r, b, t, n, f, scale);
|
||||
|
||||
guMtxF2L(mf, m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user