NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
c_m3d.cpp
1#include <types.h>
2#include <lib/rvl/mtx/vec.h>
3
4void cM3d_calcInDivPos1(const Vec *start, const Vec *dir, float scale, Vec *pos) {
5 Vec scaledDir;
6 PSVECScale(dir, &scaledDir, scale);
7 PSVECAdd(&scaledDir, start, pos);
8}
9
10void cM3d_calcInDivPos2(const Vec *a, const Vec *b, float scale, Vec *pos) {
11 Vec dist;
12 PSVECSubtract(b, a, &dist);
13 cM3d_calcInDivPos1(a, &dist, scale, pos);
14}
void cM3d_calcInDivPos2(const Vec *a, const Vec *b, float scale, Vec *pos)
Obtains an intermediate position between two given points using a scalar multiplier.
Definition c_m3d.cpp:10
void cM3d_calcInDivPos1(const Vec *start, const Vec *dir, float scale, Vec *pos)
Obtains a position given a starting point, a direction and a scalar multiplier.
Definition c_m3d.cpp:4
void PSVECSubtract(const Vec *v1, const Vec *v2, Vec *out)
Subtracts vector v2 from vector v1.
void PSVECAdd(const Vec *v1, const Vec *v2, Vec *out)
Sums two vectors together.
void PSVECScale(const Vec *in, Vec *out, float scale)
Multiplies a vector by a scalar.
A three-dimensional floating point vector.
Definition vec.h:18