3dcam-headers/include/math.h

37 lines
921 B
C
Raw Normal View History

2021-06-23 19:25:12 +02:00
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <libgte.h>
2021-11-28 19:59:05 +01:00
#include <macros.h>
2021-06-23 19:25:12 +02:00
// Precalculated arctan values
2021-11-28 19:59:05 +01:00
#include <atan.h>
2021-06-23 19:25:12 +02:00
// fixed point math
int32_t dMul(int32_t a, int32_t b);
uint32_t lerpU(uint32_t start, uint32_t dest, unsigned pos);
int32_t lerpS(int32_t start, int32_t dest, unsigned pos);
int32_t lerpD(int32_t start, int32_t dest, int32_t pos);
long long lerpL(long long start, long long dest, long long pos);
// Sin/Cos Table
void generateTable(void);
int ncos(u_int t);
int nsin(u_int t);
// Atan table
long long patan(long x, long y);
// Sqrt
u_int psqrt(u_int n);
// Lerps
int lerp(int start, int end, int factor); // FIXME : not working as it should
SVECTOR SVlerp(SVECTOR start, SVECTOR end, int factor); // FIXME
long long easeIn(long long i);
int easeOut(int i);
//~ int easeInOut(int i, int div);
VECTOR getVectorTo(VECTOR actor, VECTOR target);
2021-09-25 19:39:49 +02:00
int32_t round( int32_t n);