65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
#ifndef FE_POINT
|
|
#define FE_POINT
|
|
|
|
|
|
#include <stdint.h>
|
|
#include <fxengine/parameters.h>
|
|
|
|
/**
|
|
* @brief this struct is a point in 3d, which has coords save as uint32_t
|
|
* this is the recommended type for high performance rendering, because the sh3eb-elf architecture
|
|
* is 32 bits
|
|
* This is also the type used by the rendering triangles.
|
|
*/
|
|
struct fe_integer_position
|
|
{
|
|
int32_t x,
|
|
y,
|
|
z;
|
|
};
|
|
typedef struct fe_integer_position fe_integer_position;
|
|
|
|
/**
|
|
* @brief this struct is a point in 3d, which has coords save as double
|
|
* it is not recommended to use it for high performances rendering,
|
|
* because of the sh3eb-elf architecture, which does not support natively floating calculation
|
|
*/
|
|
struct fe_floating_position
|
|
{
|
|
double x,
|
|
y,
|
|
z;
|
|
};
|
|
typedef struct fe_floating_position fe_floating_position;
|
|
|
|
|
|
/**
|
|
* @brief This is a point which is used for 3d translations and rendering
|
|
* integer mode is the best solution to increase perfs, and that's why I didn't have implemented
|
|
* the floating_points yet. (Maybe I will never add them)
|
|
* To render a triangle, you have to set &point.translated as s1, s2 or even s3
|
|
*/
|
|
struct fe_integer_point
|
|
{
|
|
fe_integer_position real,
|
|
translated;
|
|
};
|
|
typedef struct fe_integer_point fe_integer_point;
|
|
|
|
|
|
/**
|
|
* @brief Translate a point with camera settings
|
|
*
|
|
* @param point The point to translate
|
|
*/
|
|
void fe_point_translate(fe_integer_point * point);
|
|
|
|
/**
|
|
* mathematics constants
|
|
* TODO déplacer dans caméra
|
|
*/
|
|
extern const double pi, pi2, pi_sur_2;
|
|
|
|
|
|
#endif
|