Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций

This commit is contained in:
Andrey Pokidov 2026-01-30 19:37:49 +07:00
parent d33daf4e2d
commit f7e41645fe
87 changed files with 4580 additions and 4051 deletions

View file

@ -6,22 +6,22 @@
#include "vector3.h"
typedef struct {
BgcVector3FP32 axis;
BGC_FP32_Vector3 axis;
float radians;
} BgcRotation3FP32;
} BGC_FP32_Rotation3;
typedef struct {
BgcVector3FP64 axis;
BGC_FP64_Vector3 axis;
double radians;
} BgcRotation3FP64;
} BGC_FP64_Rotation3;
extern const BgcRotation3FP32 BGC_IDLE_ROTATION3_FP32;
extern const BGC_FP32_Rotation3 BGC_FP32_IDLE_ROTATION3;
extern const BgcRotation3FP64 BGC_IDLE_ROTATION3_FP64;
extern const BGC_FP64_Rotation3 BGC_FP64_IDLE_ROTATION3;
// =================== Reset ==================== //
inline void bgc_rotation3_reset_fp32(BgcRotation3FP32* rotation)
inline void bgc_fp32_rotation3_reset(BGC_FP32_Rotation3* rotation)
{
rotation->axis.x1 = 0.0f;
rotation->axis.x2 = 0.0f;
@ -30,7 +30,7 @@ inline void bgc_rotation3_reset_fp32(BgcRotation3FP32* rotation)
rotation->radians = 0.0f;
}
inline void bgc_rotation3_reset_fp64(BgcRotation3FP64* rotation)
inline void bgc_fp64_rotation3_reset(BGC_FP64_Rotation3* rotation)
{
rotation->axis.x1 = 0.0;
rotation->axis.x2 = 0.0;
@ -41,14 +41,14 @@ inline void bgc_rotation3_reset_fp64(BgcRotation3FP64* rotation)
// ================= Set Values ================= //
inline void bgc_rotation3_set_values_fp32(const float x1, const float x2, const float x3, const float angle, const BgcAngleUnitEnum unit, BgcRotation3FP32* rotation)
inline void bgc_fp32_rotation3_make(const float x1, const float x2, const float x3, const float angle, const int unit, BGC_FP32_Rotation3* rotation)
{
rotation->axis.x1 = x1;
rotation->axis.x2 = x2;
rotation->axis.x3 = x3;
if (bgc_vector3_normalize_fp32(&rotation->axis)) {
rotation->radians = bgc_angle_to_radians_fp32(angle, unit);
if (bgc_fp32_vector3_normalize(&rotation->axis)) {
rotation->radians = bgc_fp32_angle_to_radians(angle, unit);
}
else {
rotation->radians = 0.0f;
@ -56,34 +56,34 @@ inline void bgc_rotation3_set_values_fp32(const float x1, const float x2, const
}
inline void bgc_rotation3_set_values_fp64(const double x1, const double x2, const double x3, const double angle, const BgcAngleUnitEnum unit, BgcRotation3FP64* rotation)
inline void bgc_fp64_rotation3_make(const double x1, const double x2, const double x3, const double angle, const int unit, BGC_FP64_Rotation3* rotation)
{
rotation->axis.x1 = x1;
rotation->axis.x2 = x2;
rotation->axis.x3 = x3;
if (bgc_vector3_normalize_fp64(&rotation->axis)) {
rotation->radians = bgc_angle_to_radians_fp64(angle, unit);
if (bgc_fp64_vector3_normalize(&rotation->axis)) {
rotation->radians = bgc_fp64_angle_to_radians(angle, unit);
}
else {
rotation->radians = 0.0;
}
}
inline void bgc_rotation3_set_with_axis_fp32(const BgcVector3FP32* axis, const float angle, const BgcAngleUnitEnum unit, BgcRotation3FP32* rotation)
inline void bgc_fp32_rotation3_make_for_axis(const BGC_FP32_Vector3* axis, const float angle, const int unit, BGC_FP32_Rotation3* rotation)
{
if (bgc_vector3_get_normalized_fp32(axis, &rotation->axis)) {
rotation->radians = bgc_angle_to_radians_fp32(angle, unit);
if (bgc_fp32_vector3_get_normalized(axis, &rotation->axis)) {
rotation->radians = bgc_fp32_angle_to_radians(angle, unit);
}
else {
rotation->radians = 0.0f;
}
}
inline void bgc_rotation3_set_with_axis_fp64(const BgcVector3FP64* axis, const double angle, const BgcAngleUnitEnum unit, BgcRotation3FP64* rotation)
inline void bgc_fp64_rotation3_make_for_axis(const BGC_FP64_Vector3* axis, const double angle, const int unit, BGC_FP64_Rotation3* rotation)
{
if (bgc_vector3_get_normalized_fp64(axis, &rotation->axis)) {
rotation->radians = bgc_angle_to_radians_fp64(angle, unit);
if (bgc_fp64_vector3_get_normalized(axis, &rotation->axis)) {
rotation->radians = bgc_fp64_angle_to_radians(angle, unit);
}
else {
rotation->radians = 0.0;