Развитие SLERP для трёхмерных пространств, а также развитие дуальных чисел, векторов и кватернионов
This commit is contained in:
parent
053af33444
commit
86ea23de7d
23 changed files with 1063 additions and 830 deletions
|
|
@ -145,23 +145,41 @@ typedef struct {
|
|||
BGC_FP64_Quaternion _versor;
|
||||
} BGC_FP64_Turn3;
|
||||
|
||||
// ================ Turn3 Slerp ================= //
|
||||
// =================== Slerp3 =================== //
|
||||
|
||||
typedef struct {
|
||||
float _s0_cos_weight, _s0_sin_weight;
|
||||
float _x1_cos_weight, _x1_sin_weight;
|
||||
float _x2_cos_weight, _x2_sin_weight;
|
||||
float _x3_cos_weight, _x3_sin_weight;
|
||||
BGC_FP32_Quaternion _cosine_weight, _sine_weight;
|
||||
float radians;
|
||||
} BGC_FP32_Turn3Slerp;
|
||||
} BGC_FP32_Slerp3;
|
||||
|
||||
typedef struct {
|
||||
double _s0_cos_weight, _s0_sin_weight;
|
||||
double _x1_cos_weight, _x1_sin_weight;
|
||||
double _x2_cos_weight, _x2_sin_weight;
|
||||
double _x3_cos_weight, _x3_sin_weight;
|
||||
BGC_FP64_Quaternion _cosine_weight, _sine_weight;
|
||||
double radians;
|
||||
} BGC_FP64_Turn3Slerp;
|
||||
} BGC_FP64_Slerp3;
|
||||
|
||||
// ================= Position2 ================== //
|
||||
|
||||
typedef struct {
|
||||
BGC_FP32_Turn2 turn;
|
||||
BGC_FP32_Vector2 shift;
|
||||
} BGC_FP32_Position2;
|
||||
|
||||
typedef struct {
|
||||
BGC_FP64_Turn2 turn;
|
||||
BGC_FP64_Vector2 shift;
|
||||
} BGC_FP64_Position2;
|
||||
|
||||
// ================= Position3 ================== //
|
||||
|
||||
typedef struct {
|
||||
BGC_FP32_Turn3 turn;
|
||||
BGC_FP32_Vector3 shift;
|
||||
} BGC_FP32_Position3;
|
||||
|
||||
typedef struct {
|
||||
BGC_FP64_Turn3 turn;
|
||||
BGC_FP64_Vector3 shift;
|
||||
} BGC_FP64_Position3;
|
||||
|
||||
// =========== Homogeneous 3D Vector ============ //
|
||||
|
||||
|
|
@ -169,13 +187,13 @@ typedef struct {
|
|||
typedef struct
|
||||
{
|
||||
float x1, x2, x3, d0;
|
||||
} BGC_FP32_HgVector3;
|
||||
} BGC_FP32_HmgVector3;
|
||||
|
||||
// Homogeneous 3D Vector
|
||||
typedef struct
|
||||
{
|
||||
double x1, x2, x3, d0;
|
||||
} BGC_FP64_HgVector3;
|
||||
} BGC_FP64_HmgVector3;
|
||||
|
||||
// =========== Homogeneous Matrix3x3 ============ //
|
||||
|
||||
|
|
@ -186,7 +204,7 @@ typedef struct
|
|||
float r2c1, r2c2, r2c3, r2d0;
|
||||
float r3c1, r3c2, r3c3, r3d0;
|
||||
float d0c1, d0c2, d0c3, d0d0;
|
||||
} BGC_FP32_HgMatrix3x3;
|
||||
} BGC_FP32_HmgMatrix3x3;
|
||||
|
||||
// Homogeneous Matrix3x3 based on double type
|
||||
typedef struct
|
||||
|
|
@ -195,36 +213,36 @@ typedef struct
|
|||
double r2c1, r2c2, r2c3, r2d0;
|
||||
double r3c1, r3c2, r3c3, r3d0;
|
||||
double d0c1, d0c2, d0c3, d0d0;
|
||||
} BGC_FP64_HgMatrix3x3;
|
||||
} BGC_FP64_HmgMatrix3x3;
|
||||
|
||||
// ================ Dual Number ================= //
|
||||
// ================ Dual Scalar ================= //
|
||||
|
||||
typedef struct {
|
||||
float real, dual;
|
||||
} BGC_FP32_DualNumber;
|
||||
float real_part, dual_part;
|
||||
} BGC_FP32_DualScalar;
|
||||
|
||||
typedef struct {
|
||||
double real, dual;
|
||||
} BGC_FP64_DualNumber;
|
||||
double real_part, dual_part;
|
||||
} BGC_FP64_DualScalar;
|
||||
|
||||
// ================ Dual Vector ================= //
|
||||
|
||||
typedef struct {
|
||||
BGC_FP32_Vector3 real, dual;
|
||||
BGC_FP32_Vector3 real_part, dual_part;
|
||||
} BGC_FP32_DualVector3;
|
||||
|
||||
typedef struct {
|
||||
BGC_FP64_Vector3 real, dual;
|
||||
BGC_FP64_Vector3 real_part, dual_part;
|
||||
} BGC_FP64_DualVector3;
|
||||
|
||||
// ============== Dual Quaternion =============== //
|
||||
|
||||
typedef struct {
|
||||
BGC_FP32_Quaternion real, dual;
|
||||
BGC_FP32_Quaternion real_part, dual_part;
|
||||
} BGC_FP32_DualQuaternion;
|
||||
|
||||
typedef struct {
|
||||
BGC_FP64_Quaternion real, dual;
|
||||
BGC_FP64_Quaternion real_part, dual_part;
|
||||
} BGC_FP64_DualQuaternion;
|
||||
|
||||
#endif // _BGC_MATRIX_TYPES_H_
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue