Продолжение переименования типов и функций
This commit is contained in:
parent
605afabd94
commit
3b6efaafa9
25 changed files with 768 additions and 916 deletions
|
|
@ -6,22 +6,22 @@
|
|||
#include "vector3.h"
|
||||
|
||||
typedef struct {
|
||||
fp32_vector3_t axis;
|
||||
vector3_fp32_t axis;
|
||||
float radians;
|
||||
} fp32_rotation3_t;
|
||||
} rotation3_fp32_t;
|
||||
|
||||
typedef struct {
|
||||
fp64_vector3_t axis;
|
||||
vector3_fp64_t axis;
|
||||
double radians;
|
||||
} fp64_rotation3_t;
|
||||
} rotation3_fp64_t;
|
||||
|
||||
extern const fp32_rotation3_t FP32_IDLE_ROTATION3;
|
||||
extern const rotation3_fp32_t FP32_IDLE_ROTATION3;
|
||||
|
||||
extern const fp64_rotation3_t FP64_IDLE_ROTATION3;
|
||||
extern const rotation3_fp64_t FP64_IDLE_ROTATION3;
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
static inline void fp32_rotation_reset(fp32_rotation3_t* rotation)
|
||||
inline void fp32_rotation_reset(rotation3_fp32_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = 0.0f;
|
||||
rotation->axis.x2 = 0.0f;
|
||||
|
|
@ -30,7 +30,7 @@ static inline void fp32_rotation_reset(fp32_rotation3_t* rotation)
|
|||
rotation->radians = 0.0f;
|
||||
}
|
||||
|
||||
static inline void fp64_rotation_reset(fp64_rotation3_t* rotation)
|
||||
inline void fp64_rotation_reset(rotation3_fp64_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = 0.0;
|
||||
rotation->axis.x2 = 0.0;
|
||||
|
|
@ -41,13 +41,13 @@ static inline void fp64_rotation_reset(fp64_rotation3_t* rotation)
|
|||
|
||||
// ==================== Make ==================== //
|
||||
|
||||
static inline void fp32_rotation_set_values(const float x1, const float x2, const float x3, const float angle, const angle_unit_t unit, fp32_rotation3_t* rotation)
|
||||
inline void fp32_rotation_set_values(const float x1, const float x2, const float x3, const float angle, const angle_unit_t unit, rotation3_fp32_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = x1;
|
||||
rotation->axis.x2 = x2;
|
||||
rotation->axis.x3 = x3;
|
||||
|
||||
if (fp32_vector3_normalize(&rotation->axis)) {
|
||||
if (vector3_fp32_normalize(&rotation->axis)) {
|
||||
rotation->radians = fp32_angle_to_radians(angle, unit);
|
||||
}
|
||||
else {
|
||||
|
|
@ -56,13 +56,13 @@ static inline void fp32_rotation_set_values(const float x1, const float x2, cons
|
|||
}
|
||||
|
||||
|
||||
static inline void fp64_rotation_set_values(const double x1, const double x2, const double x3, const double angle, const angle_unit_t unit, fp64_rotation3_t* rotation)
|
||||
inline void fp64_rotation_set_values(const double x1, const double x2, const double x3, const double angle, const angle_unit_t unit, rotation3_fp64_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = x1;
|
||||
rotation->axis.x2 = x2;
|
||||
rotation->axis.x3 = x3;
|
||||
|
||||
if (fp64_vector3_normalize(&rotation->axis)) {
|
||||
if (vector3_fp64_normalize(&rotation->axis)) {
|
||||
rotation->radians = fp64_angle_to_radians(angle, unit);
|
||||
}
|
||||
else {
|
||||
|
|
@ -70,13 +70,13 @@ static inline void fp64_rotation_set_values(const double x1, const double x2, co
|
|||
}
|
||||
}
|
||||
|
||||
static inline void fp32_rotation_set_with_axis(const fp32_vector3_t* axis, const float angle, const angle_unit_t unit, fp32_rotation3_t* rotation)
|
||||
inline void fp32_rotation_set_with_axis(const vector3_fp32_t* axis, const float angle, const angle_unit_t unit, rotation3_fp32_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = axis->x1;
|
||||
rotation->axis.x2 = axis->x2;
|
||||
rotation->axis.x3 = axis->x3;
|
||||
|
||||
if (fp32_vector3_normalize(&rotation->axis)) {
|
||||
if (vector3_fp32_normalize(&rotation->axis)) {
|
||||
rotation->radians = fp32_angle_to_radians(angle, unit);
|
||||
}
|
||||
else {
|
||||
|
|
@ -84,13 +84,13 @@ static inline void fp32_rotation_set_with_axis(const fp32_vector3_t* axis, const
|
|||
}
|
||||
}
|
||||
|
||||
static inline void fp64_rotation_set_with_axis(const fp64_vector3_t* axis, const double angle, const angle_unit_t unit, fp64_rotation3_t* rotation)
|
||||
inline void fp64_rotation_set_with_axis(const vector3_fp64_t* axis, const double angle, const angle_unit_t unit, rotation3_fp64_t* rotation)
|
||||
{
|
||||
rotation->axis.x1 = axis->x1;
|
||||
rotation->axis.x2 = axis->x2;
|
||||
rotation->axis.x3 = axis->x3;
|
||||
|
||||
if (fp64_vector3_normalize(&rotation->axis)) {
|
||||
if (vector3_fp64_normalize(&rotation->axis)) {
|
||||
rotation->radians = fp64_angle_to_radians(angle, unit);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue