Переименование проектов / Renaming of projects
This commit is contained in:
parent
da61a9bf7c
commit
beb237fd4e
44 changed files with 6588 additions and 9 deletions
328
basic-geometry/matrix3x2.h
Normal file
328
basic-geometry/matrix3x2.h
Normal file
|
|
@ -0,0 +1,328 @@
|
|||
#ifndef _GEOMETRY_MATRIX3X2_H_
|
||||
#define _GEOMETRY_MATRIX3X2_H_
|
||||
|
||||
#include "vector2.h"
|
||||
#include "vector3.h"
|
||||
#include "matrixes.h"
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_reset(BgFP32Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
matrix->r1c3 = 0.0f;
|
||||
|
||||
matrix->r2c1 = 0.0f;
|
||||
matrix->r2c2 = 0.0f;
|
||||
matrix->r2c3 = 0.0f;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_reset(BgFP64Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
matrix->r1c3 = 0.0;
|
||||
|
||||
matrix->r2c1 = 0.0;
|
||||
matrix->r2c2 = 0.0;
|
||||
matrix->r2c3 = 0.0;
|
||||
}
|
||||
|
||||
// ============= Set from twin type ============= //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_set_from_fp64(const BgFP64Matrix3x2* from, BgFP32Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = (float) from->r1c1;
|
||||
to->r1c2 = (float) from->r1c2;
|
||||
to->r1c3 = (float) from->r1c3;
|
||||
|
||||
to->r2c1 = (float) from->r2c1;
|
||||
to->r2c2 = (float) from->r2c2;
|
||||
to->r2c3 = (float) from->r2c3;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_set_from_fp32(const BgFP32Matrix3x2* from, BgFP64Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = from->r1c1;
|
||||
to->r1c2 = from->r1c2;
|
||||
to->r1c3 = from->r1c3;
|
||||
|
||||
to->r2c1 = from->r2c1;
|
||||
to->r2c2 = from->r2c2;
|
||||
to->r2c3 = from->r2c3;
|
||||
}
|
||||
|
||||
// =============== Set transposed =============== //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_set_transposed(const BgFP32Matrix2x3* from, BgFP32Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = from->r1c1;
|
||||
to->r1c2 = from->r2c1;
|
||||
to->r1c3 = from->r3c1;
|
||||
|
||||
to->r2c1 = from->r1c2;
|
||||
to->r2c2 = from->r2c2;
|
||||
to->r2c3 = from->r3c2;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_set_transposed(const BgFP64Matrix2x3* from, BgFP64Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = from->r1c1;
|
||||
to->r1c2 = from->r2c1;
|
||||
to->r1c3 = from->r3c1;
|
||||
|
||||
to->r2c1 = from->r1c2;
|
||||
to->r2c2 = from->r2c2;
|
||||
to->r2c3 = from->r3c2;
|
||||
}
|
||||
|
||||
// =============== Set transposed =============== //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_set_transposed_fp64(const BgFP64Matrix2x3* from, BgFP32Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = (float) from->r1c1;
|
||||
to->r1c2 = (float) from->r2c1;
|
||||
to->r1c3 = (float) from->r3c1;
|
||||
|
||||
to->r2c1 = (float) from->r1c2;
|
||||
to->r2c2 = (float) from->r2c2;
|
||||
to->r2c3 = (float) from->r3c2;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_set_transposed_fp32(const BgFP32Matrix2x3* from, BgFP64Matrix3x2* to)
|
||||
{
|
||||
to->r1c1 = from->r1c1;
|
||||
to->r1c2 = from->r2c1;
|
||||
to->r1c3 = from->r3c1;
|
||||
|
||||
to->r2c1 = from->r1c2;
|
||||
to->r2c2 = from->r2c2;
|
||||
to->r2c3 = from->r3c2;
|
||||
}
|
||||
|
||||
// ================= Set Row 1 ================== //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_set_row1(const float c1, const float c2, const float c3, BgFP32Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r1c1 = c1;
|
||||
matrix->r1c2 = c2;
|
||||
matrix->r1c3 = c3;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_set_row1(const double c1, const double c2, const double c3, BgFP64Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r1c1 = c1;
|
||||
matrix->r1c2 = c2;
|
||||
matrix->r1c3 = c3;
|
||||
}
|
||||
|
||||
// ================= Set Row 2 ================== //
|
||||
|
||||
static inline void bg_fp32_matrix3x2_set_row2(const float c1, const float c2, const float c3, BgFP32Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r2c1 = c1;
|
||||
matrix->r2c2 = c2;
|
||||
matrix->r2c3 = c3;
|
||||
}
|
||||
|
||||
static inline void bg_fp64_matrix3x2_set_row2(const double c1, const double c2, const double c3, BgFP64Matrix3x2* matrix)
|
||||
{
|
||||
matrix->r2c1 = c1;
|
||||