Добавление квалификатора const для запрета изменения указаелей внутри функций
This commit is contained in:
parent
610756ffed
commit
e6ac9023ec
24 changed files with 951 additions and 951 deletions
|
|
@ -33,25 +33,25 @@ extern const BGC_FP64_Turn3 BGC_FP64_IDLE_TURN3;
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_make(&turn->_versor, 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_make(&turn->_versor, 1.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
// ============= Private: Normalize ============= //
|
||||
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* turn, const float square_modulus);
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* const turn, const float square_modulus);
|
||||
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* turn, const double square_modulus);
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* const turn, const double square_modulus);
|
||||
|
||||
// ================= Set Values ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* turn, const float s0, const float x1, const float x2, const float x3)
|
||||
inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* const turn, const float s0, const float x1, const float x2, const float x3)
|
||||
{
|
||||
bgc_fp32_quaternion_make(&turn->_versor, s0, x1, x2, x3);
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* turn, const float s0,
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* turn, const double s0, const double x1, const double x2, const double x3)
|
||||
inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* const turn, const double s0, const double x1, const double x2, const double x3)
|
||||
{
|
||||
bgc_fp64_quaternion_make(&turn->_versor, s0, x1, x2, x3);
|
||||
|
||||
|
|
@ -75,19 +75,19 @@ inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* turn, const double s0,
|
|||
|
||||
// =============== Get Quaternion =============== //
|
||||
|
||||
inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* quaternion, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(quaternion, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* quaternion, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(quaternion, &turn->_versor);
|
||||
}
|
||||
|
||||
// =============== Set Quaternion =============== //
|
||||
|
||||
inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* turn, const BGC_FP32_Quaternion* quaternion)
|
||||
inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* const turn, const BGC_FP32_Quaternion* const quaternion)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(&turn->_versor, quaternion);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* turn, const BGC_FP32_Q
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* turn, const BGC_FP64_Quaternion* quaternion)
|
||||
inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* const turn, const BGC_FP64_Quaternion* const quaternion)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(&turn->_versor, quaternion);
|
||||
|
||||
|
|
@ -111,79 +111,79 @@ inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* turn, const BGC_FP64_Q
|
|||
|
||||
// ================ Get Rotation ================ //
|
||||
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* axis, const BGC_FP32_Turn3* turn, const int angle_unit);
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* const axis, const BGC_FP32_Turn3* const turn, const int angle_unit);
|
||||
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* axis, const BGC_FP64_Turn3* turn, const int angle_unit);
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* const axis, const BGC_FP64_Turn3* const turn, const int angle_unit);
|
||||
|
||||
// ================ Set Rotation ================ //
|
||||
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit);
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* const turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit);
|
||||
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit);
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* const turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit);
|
||||
|
||||
// ========= Find Direction Difference ========== //
|
||||
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* start, const BGC_FP32_Vector3* end);
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const start, const BGC_FP32_Vector3* const end);
|
||||
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* start, const BGC_FP64_Vector3* end);
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const start, const BGC_FP64_Vector3* const end);
|
||||
|
||||
// ======= Find Direction Pair Difference ======= //
|
||||
|
||||
int bgc_fp32_turn3_find_pair_difference(
|
||||
BGC_FP32_Turn3* turn,
|
||||
const BGC_FP32_Vector3* first_pair_main,
|
||||
const BGC_FP32_Vector3* first_pair_branch,
|
||||
const BGC_FP32_Vector3* second_pair_main,
|
||||
const BGC_FP32_Vector3* second_pair_branch
|
||||
BGC_FP32_Turn3* const turn,
|
||||
const BGC_FP32_Vector3* const first_pair_main,
|
||||
const BGC_FP32_Vector3* const first_pair_branch,
|
||||
const BGC_FP32_Vector3* const second_pair_main,
|
||||
const BGC_FP32_Vector3* const second_pair_branch
|
||||
);
|
||||
|
||||
int bgc_fp64_turn3_find_pair_difference(
|
||||
BGC_FP64_Turn3* turn,
|
||||
const BGC_FP64_Vector3* first_pair_main,
|
||||
const BGC_FP64_Vector3* first_pair_branch,
|
||||
const BGC_FP64_Vector3* second_pair_main,
|
||||
const BGC_FP64_Vector3* second_pair_branch
|
||||
BGC_FP64_Turn3* const turn,
|
||||
const BGC_FP64_Vector3* const first_pair_main,
|
||||
const BGC_FP64_Vector3* const first_pair_branch,
|
||||
const BGC_FP64_Vector3* const second_pair_main,
|
||||
const BGC_FP64_Vector3* const second_pair_branch
|
||||
);
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* destination, const BGC_FP32_Turn3* source)
|
||||
inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* const destination, const BGC_FP32_Turn3* const source)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* destination, const BGC_FP64_Turn3* source)
|
||||
inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* const destination, const BGC_FP64_Turn3* const source)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* turn1, BGC_FP32_Turn3* turn2)
|
||||
inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* const turn1, BGC_FP32_Turn3* const turn2)
|
||||
{
|
||||
bgc_fp32_quaternion_swap(&turn1->_versor, &turn2->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* turn1, BGC_FP64_Turn3* turn2)
|
||||
inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* const turn1, BGC_FP64_Turn3* const turn2)
|
||||
{
|
||||
bgc_fp64_quaternion_swap(&turn1->_versor, &turn2->_versor);
|
||||
}
|
||||
|
||||
// ================= Comparison ================= //
|
||||
|
||||
inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* turn)
|
||||
inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
return turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3 <= BGC_FP32_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* turn)
|
||||
inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
return turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3 <= BGC_FP64_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* destination, const BGC_FP32_Turn3* source)
|
||||
inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* const destination, const BGC_FP32_Turn3* const source)
|
||||
{
|
||||
bgc_fp32_quaternion_convert_to_fp64(&destination->_versor, &source->_versor);
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* destination, const BG
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* destination, const BGC_FP64_Turn3* source)
|
||||
inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* const destination, const BGC_FP64_Turn3* const source)
|
||||
{
|
||||
bgc_fp64_quaternion_convert_to_fp32(&destination->_versor, &source->_versor);
|
||||
|
||||
|
|
@ -207,21 +207,21 @@ inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* destination, const BG
|
|||
|
||||
// ================== Shorten =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 < 0.0f) {
|
||||
bgc_fp32_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 < 0.0) {
|
||||
bgc_fp64_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* shortened, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* const shortened, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 >= 0.0f) {
|
||||
bgc_fp32_quaternion_copy(&shortened->_versor, &turn->_versor);
|
||||
|
|
@ -231,7 +231,7 @@ inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* shortened, const BGC_FP
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* shortened, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* const shortened, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 >= 0.0) {
|
||||
bgc_fp64_quaternion_copy(&shortened->_versor, &turn->_versor);
|
||||
|
|
@ -243,57 +243,57 @@ inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* shortened, const BGC_FP
|
|||
|
||||
// ================= Alternate ================== //
|
||||
|
||||
inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* alternative, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* const alternative, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_get_reverse(&alternative->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* alternative, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* const alternative, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_get_reverse(&alternative->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
// =================== Revert =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_conjugate(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_conjugate(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* inverse, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* const inverse, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_get_conjugate(&inverse->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* inverse, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* const inverse, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_get_conjugate(&inverse->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
// =============== Get Exponation =============== //
|
||||
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* power, const BGC_FP32_Turn3* base, const float exponent);
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* const power, const BGC_FP32_Turn3* const base, const float exponent);
|
||||
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* power, const BGC_FP64_Turn3* base, const double exponent);
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* const power, const BGC_FP64_Turn3* const base, const double exponent);
|
||||
|
||||
// ================ Combination ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second)
|
||||
inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second)
|
||||
{
|
||||
bgc_fp32_quaternion_multiply_by_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* combination, const BGC_FP32_T
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second)
|
||||
inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second)
|
||||
{
|
||||
bgc_fp64_quaternion_multiply_by_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* combination, const BGC_FP64_T
|
|||
|
||||
// ============ Combination of three ============ //
|
||||
|
||||
inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second, const BGC_FP32_Turn3* third)
|
||||
inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second, const BGC_FP32_Turn3* const third)
|
||||
{
|
||||
BGC_FP32_Quaternion product;
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* combination, const BGC_FP32_
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second, const BGC_FP64_Turn3* third)
|
||||
inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second, const BGC_FP64_Turn3* const third)
|
||||
{
|
||||
BGC_FP64_Quaternion product;
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* combination, const BGC_FP64_
|
|||
|
||||
// ================= Exclusion ================== //
|
||||
|
||||
inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* difference, const BGC_FP32_Turn3* base, const BGC_FP32_Turn3* excludant)
|
||||
inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* const difference, const BGC_FP32_Turn3* const base, const BGC_FP32_Turn3* const excludant)
|
||||
{
|
||||
bgc_fp32_quaternion_multiply_by_conjugate(&difference->_versor, &base->_versor, &excludant->_versor);
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* difference, const BGC_FP32_Tu
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* difference, const BGC_FP64_Turn3* base, const BGC_FP64_Turn3* excludant)
|
||||
inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* const difference, const BGC_FP64_Turn3* const base, const BGC_FP64_Turn3* const excludant)
|
||||
{
|
||||
bgc_fp64_quaternion_multiply_by_conjugate(&difference->_versor, &base->_versor, &excludant->_versor);
|
||||
|
||||
|
|
@ -373,43 +373,43 @@ inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* difference, const BGC_FP64_Tu
|
|||
|
||||
// ============ Sphere Interpolation ============ //
|
||||
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* interpolation, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end, const float phase);
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* const interpolation, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end, const float phase);
|
||||
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* interpolation, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end, const double phase);
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* const interpolation, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end, const double phase);
|
||||
|
||||
// ============ Get Rotation Matrix ============= //
|
||||
|
||||
inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_rotation_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_rotation_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
// ============= Get Reverse Matrix ============= //
|
||||
|
||||
inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
// ============= Get Both Matrixes ============== //
|
||||
|
||||
inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* rotation, BGC_FP32_Matrix3x3* reverse, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* const rotation, BGC_FP32_Matrix3x3* const reverse, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(reverse, &turn->_versor);
|
||||
bgc_fp32_matrix3x3_get_transposed(rotation, reverse);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* rotation, BGC_FP64_Matrix3x3* reverse, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* const rotation, BGC_FP64_Matrix3x3* const reverse, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(reverse, &turn->_versor);
|
||||
bgc_fp64_matrix3x3_get_transposed(rotation, reverse);
|
||||
|
|
@ -417,38 +417,38 @@ inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* rotation, BGC_F
|
|||
|
||||
// ================ Turn Vector ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* original_vector)
|
||||
inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp32_versor_turn_vector(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* original_vector)
|
||||
inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp64_versor_turn_vector(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
// ============== Turn Vector Back ============== //
|
||||
|
||||
inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* original_vector)
|
||||
inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp32_versor_turn_vector_back(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* original_vector)
|
||||
inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp64_versor_turn_vector_back(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
// ================== Are Close ================= //
|
||||
|
||||
inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* turn1, const BGC_FP32_Turn3* turn2)
|
||||
inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* const turn1, const BGC_FP32_Turn3* const turn2)
|
||||
{
|
||||
BGC_FP32_Quaternion difference;
|
||||
bgc_fp32_quaternion_subtract(&difference, &turn1->_versor, &turn2->_versor);
|
||||
return bgc_fp32_quaternion_get_square_magnitude(&difference) <= BGC_FP32_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* turn1, const BGC_FP64_Turn3* turn2)
|
||||
inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* const turn1, const BGC_FP64_Turn3* const turn2)
|
||||
{
|
||||
BGC_FP64_Quaternion difference;
|
||||
bgc_fp64_quaternion_subtract(&difference, &turn1->_versor, &turn2->_versor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue