fxengine/include/fxengine/point.h

56 lines
1.4 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 render_integer_position
{
int32_t x,
y,
z;
};
typedef struct render_integer_position render_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 render_floating_position
{
double x,
y,
z;
};
typedef struct render_floating_position render_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 render_integer_point
{
render_integer_position real;
render_integer_position translated;
};
typedef struct render_integer_point render_integer_point;
/**
* mathematics constants
*/
extern const double pi, pi2, pi_sur_2;
#endif