Реорганизация проекта: перенос определения всех типов в один файл, перегруппировка функций в файлах
This commit is contained in:
parent
c7d9263154
commit
053af33444
45 changed files with 1001 additions and 980 deletions
|
|
@ -1,20 +1,11 @@
|
|||
#ifndef _BGC_VECTOR2_H_INCLUDED_
|
||||
#define _BGC_VECTOR2_H_INCLUDED_
|
||||
|
||||
#include "utilities.h"
|
||||
#include "angle.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x1, x2;
|
||||
} BGC_FP32_Vector2;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double x1, x2;
|
||||
} BGC_FP64_Vector2;
|
||||
#include "./utilities.h"
|
||||
#include "./types.h"
|
||||
#include "./angle.h"
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
|
|
@ -186,38 +177,74 @@ inline void bgc_fp64_vector2_subtract(BGC_FP64_Vector2* difference, const BGC_FP
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_vector2_multiply(BGC_FP32_Vector2* product, const BGC_FP32_Vector2* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_vector2_multiply_by_real(BGC_FP32_Vector2* product, const BGC_FP32_Vector2* multiplicand, const float multiplier)
|
||||
{
|
||||
product->x1 = multiplicand->x1 * multiplier;
|
||||
product->x2 = multiplicand->x2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_vector2_multiply(BGC_FP64_Vector2* product, const BGC_FP64_Vector2* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_vector2_multiply_by_real(BGC_FP64_Vector2* product, const BGC_FP64_Vector2* multiplicand, const double multiplier)
|
||||
{
|
||||
product->x1 = multiplicand->x1 * multiplier;
|
||||
product->x2 = multiplicand->x2 * multiplier;
|
||||
}
|
||||
|
||||
// ============ Left Vector Product ============= //
|
||||
|
||||
inline void bgc_fp32_vector2_multiply_by_matrix2x2(BGC_FP32_Vector2* product, const BGC_FP32_Vector2* vector, const BGC_FP32_Matrix2x2* matrix)
|
||||
{
|
||||
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_vector2_multiply_by_matrix2x2(BGC_FP64_Vector2* product, const BGC_FP64_Vector2* vector, const BGC_FP64_Matrix2x2* matrix)
|
||||
{
|
||||
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||