Операции оптимизации (shorten), получения альтернативного (alternate), получение матриц поворота, сдвигов и аффинных преобразовний из позиции твёрдого тела (rigid pose), представленной дуальным кватернионом

This commit is contained in:
Andrey Pokidov 2026-03-21 22:03:43 +07:00
parent 4ead7ca106
commit 84be068503
6 changed files with 163 additions and 34 deletions

View file

@ -137,6 +137,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<LanguageStandard_C>stdc11</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>
@ -153,6 +154,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<LanguageStandard_C>stdc11</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>
@ -169,6 +171,7 @@
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<LanguageStandard_C>stdc11</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>
@ -185,6 +188,7 @@
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<LanguageStandard_C>stdc11</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>

View file

@ -64,8 +64,8 @@ extern inline void _bgc_fp64_restrict_quaternion_multiply_by_quaternion(BGC_FP64
extern inline void _bgc_fp32_restrict_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* restrict product, const BGC_FP32_Quaternion* left, const BGC_FP32_Quaternion* right);
extern inline void _bgc_fp64_restrict_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* restrict product, const BGC_FP64_Quaternion* left, const BGC_FP64_Quaternion* right);
extern inline int bgc_fp32_quaternion_divide_by_real(BGC_FP32_Quaternion* quotient, const BGC_FP32_Quaternion* dividend, const float divisor);
extern inline int bgc_fp64_quaternion_divide_by_real(BGC_FP64_Quaternion* quotient, const BGC_FP64_Quaternion* dividend, const double divisor);
extern inline int bgc_fp32_quaternion_divide_by_real_number(BGC_FP32_Quaternion* quotient, const BGC_FP32_Quaternion* dividend, const float divisor);
extern inline int bgc_fp64_quaternion_divide_by_real_number(BGC_FP64_Quaternion* quotient, const BGC_FP64_Quaternion* dividend, const double divisor);
extern inline int bgc_fp32_quaternion_divide_by_quaternion(BGC_FP32_Quaternion* quotient, const BGC_FP32_Quaternion* divident, const BGC_FP32_Quaternion* divisor);
extern inline int bgc_fp64_quaternion_divide_by_quaternion(BGC_FP64_Quaternion* quotient, const BGC_FP64_Quaternion* divident, const BGC_FP64_Quaternion* divisor);

View file

@ -396,7 +396,7 @@ inline void bgc_fp64_quaternion_multiply_by_dual_quaternion(BGC_FP64_DualQuatern
// ============== Divide By Number ============== //
inline int bgc_fp32_quaternion_divide_by_real(BGC_FP32_Quaternion* quotient, const BGC_FP32_Quaternion* dividend, const float divisor)
inline int bgc_fp32_quaternion_divide_by_real_number(BGC_FP32_Quaternion* quotient, const BGC_FP32_Quaternion* dividend, const float divisor)
{
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
return BGC_FAILURE;
@ -407,7 +407,7 @@ inline int bgc_fp32_quaternion_divide_by_real(BGC_FP32_Quaternion* quotient, con
return BGC_SUCCESS;
}
inline int bgc_fp64_quaternion_divide_by_real(BGC_FP64_Quaternion* quotient, const BGC_FP64_Quaternion* dividend, const double divisor)
inline int bgc_fp64_quaternion_divide_by_real_number(BGC_FP64_Quaternion* quotient, const BGC_FP64_Quaternion* dividend, const double divisor)
{
if (bgc_fp64_is_zero(divisor) || isnan(divisor)) {
return BGC_FAILURE;

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -27,6 +27,18 @@ extern inline void bgc_fp64_rigid_pose3_swap(BGC_FP64_RigidPose3* pose1, BGC_FP6
extern inline void bgc_fp32_rigid_pose3_convert_to_fp64(BGC_FP64_RigidPose3* destination, const BGC_FP32_RigidPose3* source);
extern inline void bgc_fp64_rigid_pose3_convert_to_fp32(BGC_FP32_RigidPose3* destination, const BGC_FP64_RigidPose3* source);
extern inline void bgc_fp32_rigid_pose3_shorten(BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_shorten(BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_shortened(BGC_FP32_RigidPose3* shortened, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_get_shortened(BGC_FP64_RigidPose3* shortened, const BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_alternate(BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_alternate(BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_alternative(BGC_FP32_RigidPose3* alternative, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_get_alternative(BGC_FP64_RigidPose3* alternative, const BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_revert(BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_revert(BGC_FP64_RigidPose3* pose);
@ -45,7 +57,14 @@ extern inline void bgc_fp64_rigid_pose3_get_outward_matrix(BGC_FP64_Matrix3x3* m
extern inline void bgc_fp32_rigid_pose3_get_inward_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_get_inward_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_outward_affine3(BGC_FP32_Affine3* affine_map, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_get_outward_affine3(BGC_FP64_Affine3* affine_map, const BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_outer_shift(BGC_FP32_Vector3* shift, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp64_rigid_pose3_get_outer_shift(BGC_FP64_Vector3* shift, const BGC_FP64_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_inward_affine3(BGC_FP32_Affine3* affine_map, const BGC_FP32_RigidPose3* pose);
extern inline void bgc_fp32_rigid_pose3_get_inner_shift(BGC_FP32_Vector3* shift, const BGC_FP32_RigidPose3* pose);