Улучшение читаемости примеров для векторов, добавление описания функций 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

@ -45,15 +45,15 @@ Example of use:
int main()
{
BGC_FP32_Vector3 my_vector1, my_vector2;
BGC_FP32_Vector3 v1, v2;
my_vector1.x = -2.0f;
my_vector1.y = 7.4f;
my_vector1.z = 1.8f;
v1.x = -2.0f;
v1.y = 7.4f;
v1.z = 1.8f;
bgc_fp32_vector3_copy(&my_vector2, &my_vector1);
bgc_fp32_vector3_copy(&v2, &v1);
printf("x = %f, y = %f, z = %f\n", my_vector2.x, my_vector2.y, my_vector2.z);
printf("x = %f, y = %f, z = %f\n", v2.x, v2.y, v2.z);
return 0;
}

View file

@ -44,15 +44,15 @@ destination->z = source->z;
int main()
{
BGC_FP32_Vector3 my_vector1, my_vector2;
BGC_FP32_Vector3 v1, v2;
my_vector1.x = -2.0f;
my_vector1.y = 7.4f;
my_vector1.z = 1.8f;
v1.x = -2.0f;
v1.y = 7.4f;
v1.z = 1.8f;
bgc_fp32_vector3_copy(&my_vector2, &my_vector1);
bgc_fp32_vector3_copy(&v2, &v1);
printf("x = %f, y = %f, z = %f\n", my_vector2.x, my_vector2.y, my_vector2.z);
printf("x = %f, y = %f, z = %f\n", v2.x, v2.y, v2.z);
return 0;
}

View file

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

View file

@ -37,11 +37,11 @@ vector->z = 0;
int main()
{
BGC_FP32_Vector3 my_vector;
BGC_FP32_Vector3 v;
bgc_fp32_vector3_reset(&my_vector);
bgc_fp32_vector3_reset(&v);
printf("x = %f, y = %f, z = %f\n", my_vector.x, my_vector.y, my_vector.z);
printf("x = %f, y = %f, z = %f\n", v.x, v.y, v.z);
return 0;
}

View file

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

View file

@ -41,11 +41,11 @@ destination->z = z;
int main()
{
BGC_FP32_Vector3 my_vector;
BGC_FP32_Vector3 v;
bgc_fp32_vector3_set_values(&my_vector, -2.2f, 7.1f, 10.01f);
bgc_fp32_vector3_set_values(&v, -2.2f, 7.1f, 10.01f);
printf("x = %f, y = %f, z = %f\n", my_vector.x, my_vector.y, my_vector.z);
printf("x = %f, y = %f, z = %f\n", v.x, v.y, v.z);
return 0;
}

View file

@ -34,15 +34,15 @@ Example of use:
int main()
{
BGC_FP32_Vector3 my_vector1, my_vector2;
BGC_FP32_Vector3 v1, v2;
bgc_fp32_vector3_set_values(&my_vector1, -2, 7, 5);
bgc_fp32_vector3_set_values(&my_vector2, 10, -1, -3);
bgc_fp32_vector3_set_values(&v1, -2, 7, 5);
bgc_fp32_vector3_set_values(&v2, 10, -1, -3);
bgc_fp32_vector3_swap(&my_vector1, &my_vector2);
bgc_fp32_vector3_swap(&v1, &v2);
printf("Vector #1: x = %f, y = %f, z = %f\n", my_vector1.x, my_vector1.y, my_vector1.z);
printf("Vector #2: x = %f, y = %f, z = %f\n", my_vector2.x, my_vector2.y, my_vector2.z);
printf("Vector #1: x = %f, y = %f, z = %f\n", v1.x, v1.y, v1.z);
printf("Vector #2: x = %f, y = %f, z = %f\n", v2.x, v2.y, v2.z);
return 0;
}

View file

@ -34,15 +34,15 @@ inline void bgc_fp64_vector3_swap(BGC_FP64_Vector3* const vector1, BGC_FP64_Vect
int main()
{
BGC_FP32_Vector3 my_vector1, my_vector2;
BGC_FP32_Vector3 v1, v2;
bgc_fp32_vector3_set_values(&my_vector1, -2, 7, 5);
bgc_fp32_vector3_set_values(&my_vector2, 10, -1, -3);
bgc_fp32_vector3_set_values(&v1, -2, 7, 5);
bgc_fp32_vector3_set_values(&v2, 10, -1, -3);
bgc_fp32_vector3_swap(&my_vector1, &my_vector2);
bgc_fp32_vector3_swap(&v1, &v2);
printf("Vector #1: x = %f, y = %f, z = %f\n", my_vector1.x, my_vector1.y, my_vector1.z);
printf("Vector #2: x = %f, y = %f, z = %f\n", my_vector2.x, my_vector2.y, my_vector2.z);
printf("Vector #1: x = %f, y = %f, z = %f\n", v1.x, v1.y, v1.z);
printf("Vector #2: x = %f, y = %f, z = %f\n", v2.x, v2.y, v2.z);
return 0;
}