SSBM Decomp
Loading...
Searching...
No Matches
lbvector.h
Go to the documentation of this file.
1#ifndef GALE01_00D2EC
2#define GALE01_00D2EC
3
5
6#include <math.h>
7
8#include <dolphin/mtx.h>
9
10static inline float lbVector_Len(Vec3* vec)
11{
12 return sqrtf(vec->x * vec->x + vec->y * vec->y + vec->z * vec->z);
13}
14
15static inline float lbVector_Len_xy(Vec3* vec)
16{
17 return sqrtf(vec->x * vec->x + vec->y * vec->y);
18}
19
20float lbVector_Normalize(Vec3* vec);
25Vec3* lbVector_Diff(Vec3* a, Vec3* b, Vec3* result);
27
28float lbVector_Angle(Vec3* a, Vec3* b);
29float lbVector_AngleXY(Vec3* a, Vec3* b);
30
31void lbVector_RotateAboutUnitAxis(Vec3* v, Vec3* axis, float angle);
32void lbVector_Rotate(Vec3* v, int axis, float angle);
33
34void lbVector_Mirror(Vec3* a, Vec3* b);
35float lbVector_CosAngle(Vec3* a, Vec3* b);
36Vec3* lbVector_Lerp(Vec3* a, Vec3* b, Vec3* result, float f);
37Vec3* lbVector_8000DE38(Mtx m, Vec3* v, float c);
38
39Vec3* lbVector_EulerAnglesFromONB(Vec3* result_angles, Vec3* a, Vec3* b,
40 Vec3* c);
42 Vec3* c);
44float lbVector_sqrtf_accurate(float x);
45
46Vec3* lbVector_WorldToScreen(HSD_CObj* cobj, const Vec3* pos3d,
47 Vec3* screenCoords, int d);
49float lbVector_8000E838(Vec3* a, Vec3* b, Vec3* c, Vec3* d);
50
51#endif
struct Vec Vec3
f32 Mtx[3][4]
Definition mtx.h:50
Vec3 * lbVector_Add(Vec3 *a, Vec3 *b)
Definition lbvector.c:47
float lbVector_NormalizeXY(Vec3 *a)
Definition lbvector.c:33
Vec3 * lbVector_ApplyEulerRotation(Vec3 *v, Vec3 *angles)
8000E138
Definition lbvector.c:351
Vec3 * lbVector_Lerp(Vec3 *a, Vec3 *b, Vec3 *result, float f)
8000DDAC - linearly interpolates between a and b as f goes from 0 to 1, returns a + f*(b-a).
Definition lbvector.c:277
Vec3 * lbVector_8000DE38(Mtx m, Vec3 *v, float c)
Definition lbvector.c:287
void lbVector_CreateEulerMatrix(Mtx m, Quaternion *angles)
8000E530 - Sets m to the 3x3 euler matrix that rotates about the x,y,z axes with angles angles....
Definition lbvector.c:454
Vec3 * lbVector_Diff(Vec3 *a, Vec3 *b, Vec3 *result)
Definition lbvector.c:70
float lbVector_CosAngle(Vec3 *a, Vec3 *b)
8000DCA8 - returns <a/|a|, b/|b|>, which is the cosine of the angle between a and b.
Definition lbvector.c:268
static float lbVector_Len_xy(Vec3 *vec)
Definition lbvector.h:15
float lbVector_Angle(Vec3 *a, Vec3 *b)
8000D620 - returns the angle between a and b
Definition lbvector.c:86
void lbVector_RotateAboutUnitAxis(Vec3 *v, Vec3 *axis, float angle)
8000D8F4 Rotates v by angle about the given axis.
Definition lbvector.c:157
Vec3 * lbVector_Add_xy(Vec3 *a, Vec3 *b)
Definition lbvector.c:55
void lbVector_Rotate(Vec3 *v, int axis, float angle)
Definition lbvector.c:218
Vec3 * lbVector_EulerAnglesFromPartialONB(Vec3 *result_angles, Vec3 *a, Vec3 *c)
8000DFF4 - returns lbVector_EulerAnglesFromONB(result_angles, a, c cross a,c).
Definition lbvector.c:340
Vec3 * lbVector_Sub(Vec3 *a, Vec3 *b)
Definition lbvector.c:62
static float lbVector_Len(Vec3 *vec)
Definition lbvector.h:10
Vec3 * lbVector_EulerAnglesFromONB(Vec3 *result_angles, Vec3 *a, Vec3 *b, Vec3 *c)
8000DF0C - computes euler angles phi_x,phi_y,phi_z that rotate the standard basis (e1,...
Definition lbvector.c:316
Vec3 * lbVector_CrossprodNormalized(Vec3 *a, Vec3 *b, Vec3 *result)
Definition lbvector.c:78
float lbVector_AngleXY(Vec3 *a, Vec3 *b)
8000D790 - returns the angle between a and b
Definition lbvector.c:105
float lbVector_Normalize(Vec3 *vec)
Definition lbvector.c:18
void lbVector_Mirror(Vec3 *a, Vec3 *b)
8000DC6C - compute a -= 2*<a,b>*b.
Definition lbvector.c:257
Vec3 * lbVector_WorldToScreen(HSD_CObj *cobj, const Vec3 *pos3d, Vec3 *screenCoords, int d)
8000E210
Definition lbvector.c:366
float lbVector_8000E838(Vec3 *a, Vec3 *b, Vec3 *c, Vec3 *d)
8000E838 - This function seems to have a very specific use case and is only used once in Camera_Check...
Definition lbvector.c:493
float lbVector_sqrtf_accurate(float x)
8000E19C
Definition lbvector.c:360
float sqrtf(float)
Definition math_ppc.h:11
Definition cobj.h:37
Definition mtx.h:46
f32 z
Definition mtx.h:15
f32 x
Definition mtx.h:15
f32 y
Definition mtx.h:15
int c
Definition tev.c:10
GXColorS10 a
Definition tev.c:9