Улучшение читаемости примеров для векторов, добавление описания функций copy и swap для кватернионов

This commit is contained in:
Andrey Pokidov 2026-03-30 01:48:07 +07:00
parent cc3ce1f327
commit f402f68516
22 changed files with 325 additions and 77 deletions

View file

@ -43,14 +43,14 @@ Example of use:
int main()
{
BGC_FP32_Vector2 my_vector1, my_vector2;
BGC_FP32_Vector2 v1, v2;
my_vector1.x = -2.0f;
my_vector1.y = 7.4f;
v1.x = -2.0f;
v1.y = 7.4f;
bgc_fp32_vector2_copy(&my_vector2, &my_vector1);
bgc_fp32_vector2_copy(&v2, &v1);
printf("x = %f, y = %f\n", my_vector2.x, my_vector2.y);
printf("x = %f, y = %f\n", v2.x, v2.y);
return 0;
}

View file

@ -43,14 +43,14 @@ destination->y = source->y;
int main()
{
BGC_FP32_Vector2 my_vector1, my_vector2;
BGC_FP32_Vector2 v1, v2;
my_vector1.x = -2.0f;
my_vector1.y = 7.4f;
v1.x = -2.0f;
v1.y = 7.4f;
bgc_fp32_vector2_copy(&my_vector2, &my_vector1);
bgc_fp32_vector2_copy(&v2, &v1);
printf("x = %f, y = %f\n", my_vector2.x, my_vector2.y);
printf("x = %f, y = %f\n", v2.x, v2.y);
return 0;
}

View file

@ -36,11 +36,11 @@ Example of use:
int main()
{
BGC_FP32_Vector2 my_vector;
BGC_FP32_Vector2 v;
bgc_fp32_vector2_reset(&my_vector);
bgc_fp32_vector2_reset(&v);
printf("x = %f, y = %f\n", my_vector.x, my_vector.y);
printf("x = %f, y = %f\n", v.x, v.y);
return 0;
}

View file

@ -36,11 +36,11 @@ NULL (0) также считается некорректным.
int main()
{
BGC_FP32_Vector2 my_vector;
BGC_FP32_Vector2 v;
bgc_fp32_vector2_reset(&my_vector);
bgc_fp32_vector2_reset(&v);
printf("x = %f, y = %f\n", my_vector.x, my_vector.y);
printf("x = %f, y = %f\n", v.x, v.y);
return 0;
}

View file

@ -39,11 +39,11 @@ Example of use:
int main()
{
BGC_FP32_Vector2 my_vector;
BGC_FP32_Vector2 v;
bgc_fp32_vector2_set_values(&my_vector, -2.2f, 7.1f);
bgc_fp32_vector2_set_values(&v, -2.2f, 7.1f);
printf("x = %f, y = %f\n", my_vector.x, my_vector.y);
printf("x = %f, y = %f\n", v.x, v.y);
return 0;
}

View file

@ -39,11 +39,11 @@ destination->y = y;
int main()
{
BGC_FP32_Vector2 my_vector;
BGC_FP32_Vector2 v;
bgc_fp32_vector2_set_values(&my_vector, -2.2f, 7.1f);
bgc_fp32_vector2_set_values(&v, -2.2f, 7.1f);
printf("x = %f, y = %f\n", my_vector.x, my_vector.y);
printf("x = %f, y = %f\n", v.x, v.y);
return 0;
}

View file

@ -36,16 +36,16 @@ Example of use:
int main()
{
BGC_FP32_Vector2 my_vector1, my_vector2;
BGC_FP32_Vector2 v1, v2;
bgc_fp32_vector2_set_values(&my_vector1, -2, 7);
bgc_fp32_vector2_set_values(&my_vector2, 10, -1);
bgc_fp32_vector2_set_values(&v1, -2, 7);
bgc_fp32_vector2_set_values(&v2, 10, -1);
bgc_fp32_vector2_swap(&my_vector1, &my_vector2);
bgc_fp32_vector2_swap(&v1, &v2);
printf("Vector #1: x = %f, y = %f\n", my_vector1.x, my_vector1.y);
printf("Vector #2: x = %f, y = %f\n", my_vector2.x, my_vector2.y);
printf("Vector #1: x = %f, y = %f\n", v1.x, v1.y);
printf("Vector #2: x = %f, y = %f\n", v2.x, v2.y);
return 0;
}

View file

@ -34,16 +34,16 @@ inline void bgc_fp64_vector2_swap(BGC_FP64_Vector2* const vector1, BGC_FP64_Vect
int main()
{
BGC_FP32_Vector2 my_vector1, my_vector2;
BGC_FP32_Vector2 v1, v2;
bgc_fp32_vector2_set_values(&my_vector1, -2, 7);
bgc_fp32_vector2_set_values(&my_vector2, 10, -1);
bgc_fp32_vector2_set_values(&v1, -2, 7);
bgc_fp32_vector2_set_values(&v2, 10, -1);
bgc_fp32_vector2_swap(&my_vector1, &my_vector2);
bgc_fp32_vector2_swap(&v1, &v2);
printf("Vector #1: x = %f, y = %f\n", my_vector1.x, my_vector1.y);
printf("Vector #2: x = %f, y = %f\n", my_vector2.x, my_vector2.y);
printf("Vector #1: x = %f, y = %f\n", v1.x, v1.y);
printf("Vector #2: x = %f, y = %f\n", v2.x, v2.y);
return 0;
}