Добавление операции комбинирования для Posture3
This commit is contained in:
parent
add4d89c80
commit
c857c251c3
3 changed files with 49 additions and 38 deletions
|
|
@ -12,6 +12,8 @@ extern inline void bgc_fp64_posture3_swap(BGC_FP64_Posture3* posture1, BGC_FP64_
|
||||||
extern inline void bgc_fp32_posture3_convert_to_fp64(BGC_FP64_Posture3* destination, const BGC_FP32_Posture3* source);
|
extern inline void bgc_fp32_posture3_convert_to_fp64(BGC_FP64_Posture3* destination, const BGC_FP32_Posture3* source);
|
||||||
extern inline void bgc_fp64_posture3_convert_to_fp32(BGC_FP32_Posture3* destination, const BGC_FP64_Posture3* source);
|
extern inline void bgc_fp64_posture3_convert_to_fp32(BGC_FP32_Posture3* destination, const BGC_FP64_Posture3* source);
|
||||||
|
|
||||||
|
extern inline void bgc_fp32_posture3_combine(BGC_FP32_Posture3* combination, const BGC_FP32_Posture3* first, const BGC_FP32_Posture3* second);
|
||||||
|
extern inline void bgc_fp64_posture3_combine(BGC_FP64_Posture3* combination, const BGC_FP64_Posture3* first, const BGC_FP64_Posture3* second);
|
||||||
|
|
||||||
void _bgc_fp32_posture3_normalize(BGC_FP32_Posture3* posture, const float square_magnitude)
|
void _bgc_fp32_posture3_normalize(BGC_FP32_Posture3* posture, const float square_magnitude)
|
||||||
{
|
{
|
||||||
|
|
@ -22,8 +24,7 @@ void _bgc_fp32_posture3_normalize(BGC_FP32_Posture3* posture, const float square
|
||||||
|
|
||||||
const float multiplier = sqrtf(1.0f / square_magnitude);
|
const float multiplier = sqrtf(1.0f / square_magnitude);
|
||||||
|
|
||||||
bgc_fp32_quaternion_multiply_by_real(&posture->_real_part, &posture->_real_part, multiplier);
|
bgc_fp32_dual_quaternion_multiply_by_real_number(&posture->_versor, &posture->_versor, multiplier);
|
||||||
bgc_fp32_quaternion_multiply_by_real(&posture->_dual_part, &posture->_dual_part, multiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _bgc_fp64_posture3_normalize(BGC_FP64_Posture3* posture, const double square_magnitude)
|
void _bgc_fp64_posture3_normalize(BGC_FP64_Posture3* posture, const double square_magnitude)
|
||||||
|
|
@ -35,6 +36,5 @@ void _bgc_fp64_posture3_normalize(BGC_FP64_Posture3* posture, const double squar
|
||||||
|
|
||||||
const double multiplier = sqrt(1.0 / square_magnitude);
|
const double multiplier = sqrt(1.0 / square_magnitude);
|
||||||
|
|
||||||
bgc_fp64_quaternion_multiply_by_real(&posture->_real_part, &posture->_real_part, multiplier);
|
bgc_fp64_dual_quaternion_multiply_by_real_number(&posture->_versor, &posture->_versor, multiplier);
|
||||||
bgc_fp64_quaternion_multiply_by_real(&posture->_dual_part, &posture->_dual_part, multiplier);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,66 +15,61 @@ void _bgc_fp64_posture3_normalize(BGC_FP64_Posture3* posture, const double squar
|
||||||
|
|
||||||
inline void bgc_fp32_posture3_reset(BGC_FP32_Posture3* posture)
|
inline void bgc_fp32_posture3_reset(BGC_FP32_Posture3* posture)
|
||||||
{
|
{
|
||||||
posture->_real_part.s0 = 1.0f;
|
posture->_versor.real_part.s0 = 1.0f;
|
||||||