Добавление квалификатора const, который запрещает изменение указателя
This commit is contained in:
parent
51fafe50c8
commit
610756ffed
14 changed files with 1019 additions and 1039 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ==================== Reset =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_reset(BGC_FP32_RigidPose3* pose)
|
||||
inline void bgc_fp32_rigid_pose3_reset(BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
pose->_versor.real_part.s0 = 1.0f;
|
||||
pose->_versor.real_part.x1 = 0.0f;
|
||||
|
|
@ -23,7 +23,7 @@ inline void bgc_fp32_rigid_pose3_reset(BGC_FP32_RigidPose3* pose)
|
|||
pose->_versor.dual_part.x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_reset(BGC_FP64_RigidPose3* pose)
|
||||
inline void bgc_fp64_rigid_pose3_reset(BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
pose->_versor.real_part.s0 = 1.0;
|
||||
pose->_versor.real_part.x1 = 0.0;
|
||||
|
|
@ -38,7 +38,7 @@ inline void bgc_fp64_rigid_pose3_reset(BGC_FP64_RigidPose3* pose)
|
|||
|
||||
// ================= Normalize ================== //
|
||||
|
||||
inline void _bgc_fp32_rigid_pose3_normalize(BGC_FP32_RigidPose3* pose)
|
||||
inline void _bgc_fp32_rigid_pose3_normalize(BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
const float square_magnitude = bgc_fp32_quaternion_get_square_magnitude(&pose->_versor.real_part);
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ inline void _bgc_fp32_rigid_pose3_normalize(BGC_FP32_RigidPose3* pose)
|
|||
bgc_fp32_quaternion_subtract_scaled(&pose->_versor.dual_part, &pose->_versor.dual_part, &pose->_versor.real_part, dot_product);
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_rigid_pose3_normalize(BGC_FP64_RigidPose3* pose)
|
||||
inline void _bgc_fp64_rigid_pose3_normalize(BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
const double square_magnitude = bgc_fp64_quaternion_get_square_magnitude(&pose->_versor.real_part);
|
||||
|
||||
|
|
@ -80,25 +80,25 @@ inline void _bgc_fp64_rigid_pose3_normalize(BGC_FP64_RigidPose3* pose)
|
|||
|
||||
// ============ Get Dual Quaternion ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_dual_quaternion(BGC_FP32_DualQuaternion* quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_dual_quaternion(BGC_FP32_DualQuaternion* const quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_copy(quaternion, &pose->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_dual_quaternion(BGC_FP64_DualQuaternion* quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_dual_quaternion(BGC_FP64_DualQuaternion* const quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_copy(quaternion, &pose->_versor);
|
||||
}
|
||||
|
||||
// ============ Get Dual Quaternion ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_set_dual_quaternion(BGC_FP32_RigidPose3* pose, const BGC_FP32_DualQuaternion* const quaternion)
|
||||
inline void bgc_fp32_rigid_pose3_set_dual_quaternion(BGC_FP32_RigidPose3* const pose, const BGC_FP32_DualQuaternion* const quaternion)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_copy(&pose->_versor, quaternion);
|
||||
_bgc_fp32_rigid_pose3_normalize(pose);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_set_dual_quaternion(BGC_FP64_RigidPose3* pose, const BGC_FP64_DualQuaternion* const quaternion)
|
||||
inline void bgc_fp64_rigid_pose3_set_dual_quaternion(BGC_FP64_RigidPose3* const pose, const BGC_FP64_DualQuaternion* const quaternion)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_copy(&pose->_versor, quaternion);
|
||||
_bgc_fp64_rigid_pose3_normalize(pose);
|
||||
|
|
@ -106,61 +106,61 @@ inline void bgc_fp64_rigid_pose3_set_dual_quaternion(BGC_FP64_RigidPose3* pose,
|
|||
|
||||
// =============== Get Real Part ================ //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_real_part(BGC_FP32_Quaternion* quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_real_part(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(quaternion, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_real_part(BGC_FP64_Quaternion* quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_real_part(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(quaternion, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
// =============== Get Dual Part ================ //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_dual_part(BGC_FP32_Quaternion* quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_dual_part(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(quaternion, &pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_dual_part(BGC_FP64_Quaternion* quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_dual_part(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(quaternion, &pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_copy(BGC_FP32_RigidPose3* destination, const BGC_FP32_RigidPose3* const source)
|
||||
inline void bgc_fp32_rigid_pose3_copy(BGC_FP32_RigidPose3* const destination, const BGC_FP32_RigidPose3* const source)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_copy(BGC_FP64_RigidPose3* destination, const BGC_FP64_RigidPose3* const source)
|
||||
inline void bgc_fp64_rigid_pose3_copy(BGC_FP64_RigidPose3* const destination, const BGC_FP64_RigidPose3* const source)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_swap(BGC_FP32_RigidPose3* pose1, BGC_FP32_RigidPose3* pose2)
|
||||
inline void bgc_fp32_rigid_pose3_swap(BGC_FP32_RigidPose3* const pose1, BGC_FP32_RigidPose3* const pose2)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_swap(&pose1->_versor, &pose2->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_swap(BGC_FP64_RigidPose3* pose1, BGC_FP64_RigidPose3* pose2)
|
||||
inline void bgc_fp64_rigid_pose3_swap(BGC_FP64_RigidPose3* const pose1, BGC_FP64_RigidPose3* const pose2)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_swap(&pose1->_versor, &pose2->_versor);
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_convert_to_fp64(BGC_FP64_RigidPose3* destination, const BGC_FP32_RigidPose3* const source)
|
||||
inline void bgc_fp32_rigid_pose3_convert_to_fp64(BGC_FP64_RigidPose3* const destination, const BGC_FP32_RigidPose3* const source)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_convert_to_fp64(&destination->_versor, &source->_versor);
|
||||
_bgc_fp64_rigid_pose3_normalize(destination);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_convert_to_fp32(BGC_FP32_RigidPose3* destination, const BGC_FP64_RigidPose3* const source)
|
||||
inline void bgc_fp64_rigid_pose3_convert_to_fp32(BGC_FP32_RigidPose3* const destination, const BGC_FP64_RigidPose3* const source)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_convert_to_fp32(&destination->_versor, &source->_versor);
|
||||
_bgc_fp32_rigid_pose3_normalize(destination);
|
||||
|
|
@ -168,7 +168,7 @@ inline void bgc_fp64_rigid_pose3_convert_to_fp32(BGC_FP32_RigidPose3* destinatio
|
|||
|
||||
// ================== Shorten =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_shorten(BGC_FP32_RigidPose3* pose)
|
||||
inline void bgc_fp32_rigid_pose3_shorten(BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
if (pose->_versor.real_part.s0 < 0.0f) {
|
||||
bgc_fp32_quaternion_revert(&pose->_versor.real_part);
|
||||
|
|
@ -176,7 +176,7 @@ inline void bgc_fp32_rigid_pose3_shorten(BGC_FP32_RigidPose3* pose)
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_shorten(BGC_FP64_RigidPose3* pose)
|
||||
inline void bgc_fp64_rigid_pose3_shorten(BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
if (pose->_versor.real_part.s0 < 0.0) {
|
||||
bgc_fp64_quaternion_revert(&pose->_versor.real_part);
|
||||
|
|
@ -186,7 +186,7 @@ inline void bgc_fp64_rigid_pose3_shorten(BGC_FP64_RigidPose3* pose)
|
|||
|
||||
// =============== Get Shortened ================ //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_shortened(BGC_FP32_RigidPose3* shortened, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_shortened(BGC_FP32_RigidPose3* const shortened, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
if (pose->_versor.real_part.s0 < 0.0f) {
|
||||
bgc_fp32_quaternion_get_reverse(&shortened->_versor.real_part, &pose->_versor.real_part);
|
||||
|
|
@ -198,7 +198,7 @@ inline void bgc_fp32_rigid_pose3_get_shortened(BGC_FP32_RigidPose3* shortened, c
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_shortened(BGC_FP64_RigidPose3* shortened, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_shortened(BGC_FP64_RigidPose3* const shortened, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
if (pose->_versor.real_part.s0 < 0.0) {
|
||||
bgc_fp64_quaternion_get_reverse(&shortened->_versor.real_part, &pose->_versor.real_part);
|
||||
|
|
@ -212,13 +212,13 @@ inline void bgc_fp64_rigid_pose3_get_shortened(BGC_FP64_RigidPose3* shortened, c
|
|||
|
||||
// ================= Alternate ================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_alternate(BGC_FP32_RigidPose3* pose)
|
||||
inline void bgc_fp32_rigid_pose3_alternate(BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_revert(&pose->_versor.real_part);
|
||||
bgc_fp32_quaternion_revert(&pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_alternate(BGC_FP64_RigidPose3* pose)
|
||||
inline void bgc_fp64_rigid_pose3_alternate(BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_revert(&pose->_versor.real_part);
|
||||
bgc_fp64_quaternion_revert(&pose->_versor.dual_part);
|
||||
|
|
@ -226,13 +226,13 @@ inline void bgc_fp64_rigid_pose3_alternate(BGC_FP64_RigidPose3* pose)
|
|||
|
||||
// ============== Get Alternative =============== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_alternative(BGC_FP32_RigidPose3* alternative, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_alternative(BGC_FP32_RigidPose3* const alternative, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_get_reverse(&alternative->_versor.real_part, &pose->_versor.real_part);
|
||||
bgc_fp32_quaternion_get_reverse(&alternative->_versor.dual_part, &pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_alternative(BGC_FP64_RigidPose3* alternative, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_alternative(BGC_FP64_RigidPose3* const alternative, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_get_reverse(&alternative->_versor.real_part, &pose->_versor.real_part);
|
||||
bgc_fp64_quaternion_get_reverse(&alternative->_versor.dual_part, &pose->_versor.dual_part);
|
||||
|
|
@ -240,13 +240,13 @@ inline void bgc_fp64_rigid_pose3_get_alternative(BGC_FP64_RigidPose3* alternativ
|
|||
|
||||
// =================== Revert =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_revert(BGC_FP32_RigidPose3* pose)
|
||||
inline void bgc_fp32_rigid_pose3_revert(BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_conjugate(&pose->_versor.real_part);
|
||||
bgc_fp32_quaternion_conjugate(&pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_revert(BGC_FP64_RigidPose3* pose)
|
||||
inline void bgc_fp64_rigid_pose3_revert(BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_conjugate(&pose->_versor.real_part);
|
||||
bgc_fp64_quaternion_conjugate(&pose->_versor.dual_part);
|
||||
|
|
@ -254,13 +254,13 @@ inline void bgc_fp64_rigid_pose3_revert(BGC_FP64_RigidPose3* pose)
|
|||
|
||||
// ================ Get Reverse ================= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_reverse(BGC_FP32_RigidPose3* reverse, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_reverse(BGC_FP32_RigidPose3* const reverse, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_get_conjugate(&reverse->_versor.real_part, &pose->_versor.real_part);
|
||||
bgc_fp32_quaternion_get_conjugate(&reverse->_versor.dual_part, &pose->_versor.dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_reverse(BGC_FP64_RigidPose3* reverse, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_reverse(BGC_FP64_RigidPose3* const reverse, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_get_conjugate(&reverse->_versor.real_part, &pose->_versor.real_part);
|
||||
bgc_fp64_quaternion_get_conjugate(&reverse->_versor.dual_part, &pose->_versor.dual_part);
|
||||
|
|
@ -268,13 +268,13 @@ inline void bgc_fp64_rigid_pose3_get_reverse(BGC_FP64_RigidPose3* reverse, const
|
|||
|
||||
// ================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_combine(BGC_FP32_RigidPose3* combination, const BGC_FP32_RigidPose3* const first, const BGC_FP32_RigidPose3* const second)
|
||||
inline void bgc_fp32_rigid_pose3_combine(BGC_FP32_RigidPose3* const combination, const BGC_FP32_RigidPose3* const first, const BGC_FP32_RigidPose3* const second)
|
||||
{
|
||||
bgc_fp32_dual_quaternion_multiply_by_dual_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
_bgc_fp32_rigid_pose3_normalize(combination);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_combine(BGC_FP64_RigidPose3* combination, const BGC_FP64_RigidPose3* const first, const BGC_FP64_RigidPose3* const second)
|
||||
inline void bgc_fp64_rigid_pose3_combine(BGC_FP64_RigidPose3* const combination, const BGC_FP64_RigidPose3* const first, const BGC_FP64_RigidPose3* const second)
|
||||
{
|
||||
bgc_fp64_dual_quaternion_multiply_by_dual_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
_bgc_fp64_rigid_pose3_normalize(combination);
|
||||
|
|
@ -282,7 +282,7 @@ inline void bgc_fp64_rigid_pose3_combine(BGC_FP64_RigidPose3* combination, const
|
|||
|
||||
// ================== Exclude =================== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_exclude(BGC_FP32_RigidPose3* difference, const BGC_FP32_RigidPose3* const base, const BGC_FP32_RigidPose3* const excludant)
|
||||
inline void bgc_fp32_rigid_pose3_exclude(BGC_FP32_RigidPose3* const difference, const BGC_FP32_RigidPose3* const base, const BGC_FP32_RigidPose3* const excludant)
|
||||
{
|
||||
BGC_FP32_Quaternion dual_part1, dual_part2;
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ inline void bgc_fp32_rigid_pose3_exclude(BGC_FP32_RigidPose3* difference, const
|
|||
_bgc_fp32_rigid_pose3_normalize(difference);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_exclude(BGC_FP64_RigidPose3* difference, const BGC_FP64_RigidPose3* const base, const BGC_FP64_RigidPose3* const excludant)
|
||||
inline void bgc_fp64_rigid_pose3_exclude(BGC_FP64_RigidPose3* const difference, const BGC_FP64_RigidPose3* const base, const BGC_FP64_RigidPose3* const excludant)
|
||||
{
|
||||
BGC_FP64_Quaternion dual_part1, dual_part2;
|
||||
|
||||
|
|
@ -310,31 +310,31 @@ inline void bgc_fp64_rigid_pose3_exclude(BGC_FP64_RigidPose3* difference, const
|
|||
|
||||
// ============= Get Outward Matrix ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_outward_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_outward_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp32_versor_get_rotation_matrix(matrix, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_outward_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_outward_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp64_versor_get_rotation_matrix(matrix, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
// ============= Get Inward Matrix ============== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_inward_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_inward_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(matrix, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_inward_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_inward_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(matrix, &pose->_versor.real_part);
|
||||
}
|
||||
|
||||
// ============== Get Outer Shift =============== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_outer_shift(BGC_FP32_Vector3* shift, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_outer_shift(BGC_FP32_Vector3* const shift, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
const BGC_FP32_Quaternion* const real = &pose->_versor.real_part;
|
||||
const BGC_FP32_Quaternion* const dual = &pose->_versor.dual_part;
|
||||
|
|
@ -344,7 +344,7 @@ inline void bgc_fp32_rigid_pose3_get_outer_shift(BGC_FP32_Vector3* shift, const
|
|||
shift->x3 = 2.0f * ((dual->x3 * real->s0 + dual->x2 * real->x1) - (dual->s0 * real->x3 + dual->x1 * real->x2));
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_outer_shift(BGC_FP64_Vector3* shift, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_outer_shift(BGC_FP64_Vector3* const shift, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
const BGC_FP64_Quaternion* const real = &pose->_versor.real_part;
|
||||
const BGC_FP64_Quaternion* const dual = &pose->_versor.dual_part;
|
||||
|
|
@ -356,7 +356,7 @@ inline void bgc_fp64_rigid_pose3_get_outer_shift(BGC_FP64_Vector3* shift, const
|
|||
|
||||
// ============== Get Inner Shift ============== //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_inner_shift(BGC_FP32_Vector3* shift, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_inner_shift(BGC_FP32_Vector3* const shift, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
const BGC_FP32_Quaternion* const real = &pose->_versor.real_part;
|
||||
const BGC_FP32_Quaternion* const dual = &pose->_versor.dual_part;
|
||||
|
|
@ -366,7 +366,7 @@ inline void bgc_fp32_rigid_pose3_get_inner_shift(BGC_FP32_Vector3* shift, const
|
|||
shift->x3 = 2.0f * ((dual->s0 * real->x3 - dual->x3 * real->s0) + (dual->x2 * real->x1 - dual->x1 * real->x2));
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_inner_shift(BGC_FP64_Vector3* shift, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_inner_shift(BGC_FP64_Vector3* const shift, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
const BGC_FP64_Quaternion* const real = &pose->_versor.real_part;
|
||||
const BGC_FP64_Quaternion* const dual = &pose->_versor.dual_part;
|
||||
|
|
@ -378,13 +378,13 @@ inline void bgc_fp64_rigid_pose3_get_inner_shift(BGC_FP64_Vector3* shift, const
|
|||
|
||||
// ============ Get Outward Affine3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_outward_affine(BGC_FP32_Affine3* affine_map, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_outward_affine(BGC_FP32_Affine3* const affine_map, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp32_versor_get_rotation_matrix(&affine_map->distortion, &pose->_versor.real_part);
|
||||
bgc_fp32_rigid_pose3_get_outer_shift(&affine_map->shift, pose);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_outward_affine(BGC_FP64_Affine3* affine_map, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_outward_affine(BGC_FP64_Affine3* const affine_map, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp64_versor_get_rotation_matrix(&affine_map->distortion, &pose->_versor.real_part);
|
||||
bgc_fp64_rigid_pose3_get_outer_shift(&affine_map->shift, pose);
|
||||
|
|
@ -392,13 +392,13 @@ inline void bgc_fp64_rigid_pose3_get_outward_affine(BGC_FP64_Affine3* affine_map
|
|||
|
||||
// ============= Get Inward Affine3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_inward_affine(BGC_FP32_Affine3* affine_map, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_inward_affine(BGC_FP32_Affine3* const affine_map, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(&affine_map->distortion, &pose->_versor.real_part);
|
||||
bgc_fp32_rigid_pose3_get_inner_shift(&affine_map->shift, pose);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_inward_affine(BGC_FP64_Affine3* affine_map, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_inward_affine(BGC_FP64_Affine3* const affine_map, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(&affine_map->distortion, &pose->_versor.real_part);
|
||||
bgc_fp64_rigid_pose3_get_inner_shift(&affine_map->shift, pose);
|
||||
|
|
@ -406,13 +406,13 @@ inline void bgc_fp64_rigid_pose3_get_inward_affine(BGC_FP64_Affine3* affine_map,
|
|||
|
||||
// ============ Get Outer Position3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_outer_position(BGC_FP32_Position3* position, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_outer_position(BGC_FP32_Position3* const position, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(&position->turn._versor, &pose->_versor.real_part);
|
||||
bgc_fp32_rigid_pose3_get_outer_shift(&position->shift, pose);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_outer_position(BGC_FP64_Position3* position, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_outer_position(BGC_FP64_Position3* const position, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(&position->turn._versor, &pose->_versor.real_part);
|
||||
bgc_fp64_rigid_pose3_get_outer_shift(&position->shift, pose);
|
||||
|
|
@ -420,7 +420,7 @@ inline void bgc_fp64_rigid_pose3_get_outer_position(BGC_FP64_Position3* position
|
|||
|
||||
// ============ Set Outer Position3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_set_outer_position(BGC_FP32_RigidPose3* pose, const BGC_FP32_Position3* const position)
|
||||
inline void bgc_fp32_rigid_pose3_set_outer_position(BGC_FP32_RigidPose3* const pose, const BGC_FP32_Position3* const position)
|
||||
{
|
||||
const BGC_FP32_Quaternion* const versor = &position->turn._versor;
|
||||
const BGC_FP32_Vector3* const shift = &position->shift;
|
||||
|
|
@ -433,7 +433,7 @@ inline void bgc_fp32_rigid_pose3_set_outer_position(BGC_FP32_RigidPose3* pose, c
|
|||
pose->_versor.dual_part.x3 = -0.5f * (shift->x2 * versor->x1 - shift->x1 * versor->x2 - shift->x3 * versor->s0);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_set_outer_position(BGC_FP64_RigidPose3* pose, const BGC_FP64_Position3* const position)
|
||||
inline void bgc_fp64_rigid_pose3_set_outer_position(BGC_FP64_RigidPose3* const pose, const BGC_FP64_Position3* const position)
|
||||
{
|
||||
const BGC_FP64_Quaternion* const versor = &position->turn._versor;
|
||||
const BGC_FP64_Vector3* const shift = &position->shift;
|
||||
|
|
@ -448,13 +448,13 @@ inline void bgc_fp64_rigid_pose3_set_outer_position(BGC_FP64_RigidPose3* pose, c
|
|||
|
||||
// ============ Get Inner Position3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_get_inner_position(BGC_FP32_Position3* position, const BGC_FP32_RigidPose3* const pose)
|
||||
inline void bgc_fp32_rigid_pose3_get_inner_position(BGC_FP32_Position3* const position, const BGC_FP32_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp32_quaternion_get_conjugate(&position->turn._versor, &pose->_versor.real_part);
|
||||
bgc_fp32_rigid_pose3_get_inner_shift(&position->shift, pose);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_get_inner_position(BGC_FP64_Position3* position, const BGC_FP64_RigidPose3* const pose)
|
||||
inline void bgc_fp64_rigid_pose3_get_inner_position(BGC_FP64_Position3* const position, const BGC_FP64_RigidPose3* const pose)
|
||||
{
|
||||
bgc_fp64_quaternion_get_conjugate(&position->turn._versor, &pose->_versor.real_part);
|
||||
bgc_fp64_rigid_pose3_get_inner_shift(&position->shift, pose);
|
||||
|
|
@ -462,7 +462,7 @@ inline void bgc_fp64_rigid_pose3_get_inner_position(BGC_FP64_Position3* position
|
|||
|
||||
// ============ Set Inner Position3 ============= //
|
||||
|
||||
inline void bgc_fp32_rigid_pose3_set_inner_position(BGC_FP32_RigidPose3* pose, const BGC_FP32_Position3* const position)
|
||||
inline void bgc_fp32_rigid_pose3_set_inner_position(BGC_FP32_RigidPose3* const pose, const BGC_FP32_Position3* const position)
|
||||
{
|
||||
const BGC_FP32_Quaternion* const versor = &position->turn._versor;
|
||||
const BGC_FP32_Vector3* const shift = &position->shift;
|
||||
|
|
@ -475,7 +475,7 @@ inline void bgc_fp32_rigid_pose3_set_inner_position(BGC_FP32_RigidPose3* pose, c
|
|||
pose->_versor.dual_part.x3 = -0.5f * (versor->s0 * shift->x3 + versor->x2 * shift->x1 - versor->x1 * shift->x2);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_rigid_pose3_set_inner_position(BGC_FP64_RigidPose3* pose, const BGC_FP64_Position3* const position)
|
||||
inline void bgc_fp64_rigid_pose3_set_inner_position(BGC_FP64_RigidPose3* const pose, const BGC_FP64_Position3* const position)
|
||||
{
|
||||
const BGC_FP64_Quaternion* const versor = &position->turn._versor;
|
||||
const BGC_FP64_Vector3* const shift = &position->shift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue