Развитие дуальный чисел, векторов и кватернионов, а также гомогенных векторов и матриц
This commit is contained in:
parent
3f96b661a9
commit
b87518cd3f
21 changed files with 1787 additions and 1511 deletions
|
|
@ -9,166 +9,166 @@
|
|||
|
||||
inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* matrix)
|
||||
{
|
||||
matrix->row1_col1 = 0.0f;
|
||||
matrix->row1_col2 = 0.0f;
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
||||
matrix->row2_col1 = 0.0f;
|
||||
matrix->row2_col2 = 0.0f;
|
||||
matrix->r2c1 = 0.0f;
|
||||
matrix->r2c2 = 0.0f;
|
||||
|
||||
matrix->row3_col1 = 0.0f;
|
||||
matrix->row3_col2 = 0.0f;
|
||||
matrix->r3c1 = 0.0f;
|
||||
matrix->r3c2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* matrix)
|
||||
{
|
||||
matrix->row1_col1 = 0.0;
|
||||
matrix->row1_col2 = 0.0;
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
||||
matrix->row2_col1 = 0.0;
|
||||
matrix->row2_col2 = 0.0;
|
||||
matrix->r2c1 = 0.0;
|
||||
matrix->r2c2 = 0.0;
|
||||
|
||||
matrix->row3_col1 = 0.0;
|
||||
matrix->row3_col2 = 0.0;
|
||||
matrix->r3c1 = 0.0;
|
||||
matrix->r3c2 = 0.0;
|
||||
}
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* destination, const BGC_FP32_Matrix2x3* source)
|
||||
{
|
||||
destination->row1_col1 = source->row1_col1;
|
||||
destination->row1_col2 = source->row1_col2;
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
||||
destination->row2_col1 = source->row2_col1;
|
||||
destination->row2_col2 = source->row2_col2;
|
||||
destination->r2c1 = source->r2c1;
|
||||
destination->r2c2 = source->r2c2;
|
||||
|
||||
destination->row3_col1 = source->row3_col1;
|
||||
destination->row3_col2 = source->row3_col2;
|
||||
destination->r3c1 = source->r3c1;
|
||||
destination->r3c2 = source->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* destination, const BGC_FP64_Matrix2x3* source)
|
||||
{
|
||||
destination->row1_col1 = source->row1_col1;
|
||||
destination->row1_col2 = source->row1_col2;
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
||||
destination->row2_col1 = source->row2_col1;
|
||||
destination->row2_col2 = source->row2_col2;
|
||||
destination->r2c1 = source->r2c1;
|
||||
destination->r2c2 = source->r2c2;
|
||||
|
||||
destination->row3_col1 = source->row3_col1;
|
||||
destination->row3_col2 = source->row3_col2;
|
||||
destination->r3c1 = source->r3c1;
|
||||
destination->r3c2 = source->r3c2;
|
||||
}
|
||||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* matrix1, BGC_FP32_Matrix2x3* matrix2)
|
||||
{
|
||||
const float row1_col1 = matrix2->row1_col1;
|
||||
const float row1_col2 = matrix2->row1_col2;
|
||||