58 lines
1.8 KiB
C
58 lines
1.8 KiB
C
#ifndef _BGC_DUAL_QUATERNION_H_
|
|
#define _BGC_DUAL_QUATERNION_H_
|
|
|
|
#include "quaternion.h"
|
|
|
|
// =================== Types ==================== //
|
|
|
|
typedef struct {
|
|
BGC_FP32_Quaternion real, dual;
|
|
} BGC_FP32_DualQuaternion;
|
|
|
|
typedef struct {
|
|
BGC_FP64_Quaternion real, dual;
|
|
} BGC_FP64_DualQuaternion;
|
|
|
|
// =================== Reset ==================== //
|
|
|
|
inline void bgc_fp32_dual_quaternion_reset(BGC_FP32_DualQuaternion* quaternion)
|
|
{
|
|
bgc_fp32_quaternion_reset(&quaternion->real);
|
|
bgc_fp32_quaternion_reset(&quaternion->dual);
|
|
}
|
|
|
|
inline void bgc_fp64_dual_quaternion_reset(BGC_FP64_DualQuaternion* quaternion)
|
|
{
|
|
bgc_fp64_quaternion_reset(&quaternion->real);
|
|
bgc_fp64_quaternion_reset(&quaternion->dual);
|
|
}
|
|
|
|
// ==================== Copy ==================== //
|
|
|
|
inline void bgc_fp32_dual_quaternion_copy(BGC_FP32_DualQuaternion* destination, const BGC_FP32_DualQuaternion* source)
|
|
{
|
|
bgc_fp32_quaternion_copy(&destination->real, &source->real);
|
|
bgc_fp32_quaternion_copy(&destination->dual, &source->dual);
|
|
}
|
|
|
|
inline void bgc_fp64_dual_quaternion_copy(BGC_FP64_DualQuaternion* destination, const BGC_FP64_DualQuaternion* source)
|
|
{
|
|
bgc_fp64_quaternion_copy(&destination->real, &source->real);
|
|
bgc_fp64_quaternion_copy(&destination->dual, &source->dual);
|
|
}
|
|
|
|
// ==================== Swap ==================== //
|
|
|
|
inline void bgc_fp32_dual_quaternion_swap(BGC_FP32_DualQuaternion* first, BGC_FP32_DualQuaternion* second)
|
|
{
|
|
bgc_fp32_quaternion_swap(&first->real, &second->real);
|
|
bgc_fp32_quaternion_swap(&first->dual, &second->dual);
|
|
}
|
|
|
|
inline void bgc_fp64_dual_quaternion_swap(BGC_FP64_DualQuaternion* first, BGC_FP64_DualQuaternion* second)
|
|
{
|
|
bgc_fp64_quaternion_swap(&first->real, &second->real);
|
|
bgc_fp64_quaternion_swap(&first->dual, &second->dual);
|
|
}
|
|
|
|
#endif
|