| 37 | } |
| 38 | |
| 39 | void normalizeVec3(vec3_fixed* vIn, vec3_fixed* vOut) |
| 40 | { |
| 41 | fixed16_16 distSq = mul16(vIn->x, vIn->x) + mul16(vIn->y, vIn->y) + mul16(vIn->z, vIn->z); |
| 42 | fixed16_16 dist = fixedSqrt(distSq); |
| 43 | |
| 44 | if (dist > 0) |
| 45 | { |
| 46 | vOut->x = div16(vIn->x, dist); |
| 47 | vOut->y = div16(vIn->y, dist); |
| 48 | vOut->z = div16(vIn->z, dist); |
| 49 | } |
| 50 | else |
| 51 | { |
| 52 | vOut->x = 0; |
| 53 | vOut->y = 0; |
| 54 | vOut->z = 0; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void rotateVectorM3x3(vec3_fixed* inVec, vec3_fixed* outVec, s32* mtx) |
| 59 | { |
no test coverage detected