Переименование методов на распространённые названия
This commit is contained in:
parent
039b26305a
commit
b621191698
14 changed files with 192 additions and 192 deletions
|
|
@ -6,11 +6,11 @@ extern inline void bgc_fp64_vector3_reset(BGC_FP64_Vector3* vector);
|
|||
extern inline void bgc_fp32_vector3_make(BGC_FP32_Vector3* destination, const float x1, const float x2, const float x3);
|
||||
extern inline void bgc_fp64_vector3_make(BGC_FP64_Vector3* destination, const double x1, const double x2, const double x3);
|
||||
|
||||
extern inline float bgc_fp32_vector3_get_square_modulus(const BGC_FP32_Vector3* vector);
|
||||
extern inline double bgc_fp64_vector3_get_square_modulus(const BGC_FP64_Vector3* vector);
|
||||
extern inline float bgc_fp32_vector3_get_squared_length(const BGC_FP32_Vector3* vector);
|
||||
extern inline double bgc_fp64_vector3_get_squared_length(const BGC_FP64_Vector3* vector);
|
||||
|
||||
extern inline float bgc_fp32_vector3_get_modulus(const BGC_FP32_Vector3* vector);
|
||||
extern inline double bgc_fp64_vector3_get_modulus(const BGC_FP64_Vector3* vector);
|
||||
extern inline float bgc_fp32_vector3_get_length(const BGC_FP32_Vector3* vector);
|
||||
extern inline double bgc_fp64_vector3_get_length(const BGC_FP64_Vector3* vector);
|
||||
|
||||
extern inline int bgc_fp32_vector3_is_zero(const BGC_FP32_Vector3* vector);
|
||||
extern inline int bgc_fp64_vector3_is_zero(const BGC_FP64_Vector3* vector);
|
||||
|
|
@ -109,14 +109,14 @@ extern inline int bgc_fp64_vector3_get_attitude(const BGC_FP64_Vector3* vector1,
|
|||
|
||||
float bgc_fp32_vector3_get_angle(const BGC_FP32_Vector3* vector1, const BGC_FP32_Vector3* vector2, const int angle_unit)
|
||||
{
|
||||
const float square_modulus1 = bgc_fp32_vector3_get_square_modulus(vector1);
|
||||
const float square_modulus1 = bgc_fp32_vector3_get_squared_length(vector1);
|
||||
|
||||
// square_modulus1 != square_modulus1 is check for NaN value at square_modulus1
|
||||
if (square_modulus1 <= BGC_FP32_SQUARE_EPSILON || square_modulus1 != square_modulus1) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
const float square_modulus2 = bgc_fp32_vector3_get_square_modulus(vector2);
|
||||
const float square_modulus2 = bgc_fp32_vector3_get_squared_length(vector2);
|
||||
|
||||
// square_modulus2 != square_modulus2 is check for NaN value at square_modulus2
|
||||
if (square_modulus2 <= BGC_FP32_SQUARE_EPSILON || square_modulus2 != square_modulus2) {
|
||||
|
|
@ -129,21 +129,21 @@ float bgc_fp32_vector3_get_angle(const BGC_FP32_Vector3* vector1, const BGC_FP32
|
|||
|
||||
const float scalar = bgc_fp32_vector3_get_dot_product(vector1, vector2);
|
||||
|
||||
const float cross = bgc_fp32_vector3_get_modulus(&cross_product);
|
||||
const float cross = bgc_fp32_vector3_get_length(&cross_product);
|
||||
|
||||
return bgc_fp32_radians_to_units(atan2f(cross, scalar), angle_unit);
|
||||
}
|
||||
|
||||
double bgc_fp64_vector3_get_angle(const BGC_FP64_Vector3* vector1, const BGC_FP64_Vector3* vector2, const int angle_unit)
|
||||
{
|
||||
const double square_modulus1 = bgc_fp64_vector3_get_square_modulus(vector1);
|
||||
const double square_modulus1 = bgc_fp64_vector3_get_squared_length(vector1);
|
||||
|
||||
// square_modulus1 != square_modulus1 is check for NaN value at square_modulus1
|
||||
if (square_modulus1 <= BGC_FP64_SQUARE_EPSILON || square_modulus1 != square_modulus1) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const double square_modulus2 = bgc_fp64_vector3_get_square_modulus(vector2);
|
||||
const double square_modulus2 = bgc_fp64_vector3_get_squared_length(vector2);
|
||||
|
||||
// square_modulus2 != square_modulus2 is check for NaN value at square_modulus2
|
||||
if (square_modulus2 <= BGC_FP64_SQUARE_EPSILON || square_modulus2 != square_modulus2) {
|
||||
|
|
@ -156,7 +156,7 @@ double bgc_fp64_vector3_get_angle(const BGC_FP64_Vector3* vector1, const BGC_FP6
|
|||
|
||||
const double scalar = bgc_fp64_vector3_get_dot_product(vector1, vector2);
|
||||
|
||||
const double cross = bgc_fp64_vector3_get_modulus(&cross_product);
|
||||
const double cross = bgc_fp64_vector3_get_length(&cross_product);
|
||||
|
||||
return bgc_fp64_radians_to_units(atan2(cross, scalar), angle_unit);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue