Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций

This commit is contained in:
Andrey Pokidov 2026-01-30 19:37:49 +07:00
parent d33daf4e2d
commit f7e41645fe
87 changed files with 4580 additions and 4051 deletions

View file

@ -9,35 +9,35 @@ static const int _TEST_FP32_CLOSE_VERSOR_PAIR_AMOUNT = 10;
static const TestVersorPairFP32 _TEST_FP32_CLOSE_VERSOR_PAIR_LIST[] = {
{
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 1.0f + 0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f, 0.0f }
{ 1.0f + 0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f, 0.0f }
},
{
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 1.0f - 0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f, 0.0f }
{ 1.0f - 0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f, 0.0f }
},
{
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f + 0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f }
{ 0.0f, 1.0f + 0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f }
},
{
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f - 0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f }
{ 0.0f, 1.0f - 0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f }
},
{
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f + 0.75f * BGC_EPSYLON_FP32, 0.0f }
{ 0.0f, 0.0f, 1.0f + 0.75f * BGC_FP32_EPSYLON, 0.0f }
},
{
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f - 0.75f * BGC_EPSYLON_FP32, 0.0f }
{ 0.0f, 0.0f, 1.0f - 0.75f * BGC_FP32_EPSYLON, 0.0f }
},
{
{ 0.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f + 0.75f * BGC_EPSYLON_FP32 }
{ 0.0f, 0.0f, 0.0f, 1.0f + 0.75f * BGC_FP32_EPSYLON }
},
{
{ 0.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f - 0.75f * BGC_EPSYLON_FP32 }
{ 0.0f, 0.0f, 0.0f, 1.0f - 0.75f * BGC_FP32_EPSYLON }
},
{
{ 0.70710678f, 0.0f, 0.70710675f, 0.0f },
@ -54,35 +54,35 @@ static const int _TEST_FP32_DIFFERENT_VERSOR_PAIR_AMOUNT = 10;
static const TestVersorPairFP32 _TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[] = {
{
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 1.0f + 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f, 0.0f }
{ 1.0f + 1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f, 0.0f }
},
{
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 1.0f - 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f, 0.0f }
{ 1.0f - 1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f, 0.0f }
},
{
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f + 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f }
{ 0.0f, 1.0f + 1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f }
},
{
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f - 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f }
{ 0.0f, 1.0f - 1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f }
},
{
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f + 1.25f * BGC_EPSYLON_FP32, 0.0f }
{ 0.0f, 0.0f, 1.0f + 1.25f * BGC_FP32_EPSYLON, 0.0f }
},
{
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f - 1.25f * BGC_EPSYLON_FP32, 0.0f }
{ 0.0f, 0.0f, 1.0f - 1.25f * BGC_FP32_EPSYLON, 0.0f }
},
{
{ 0.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f + 1.25f * BGC_EPSYLON_FP32 }
{ 0.0f, 0.0f, 0.0f, 1.0f + 1.25f * BGC_FP32_EPSYLON }
},
{
{ 0.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f - 1.25f * BGC_EPSYLON_FP32 }
{ 0.0f, 0.0f, 0.0f, 1.0f - 1.25f * BGC_FP32_EPSYLON }
},
{
{ 0.707106f, 0.0f, 0.707107f, 0.0f },
@ -96,11 +96,11 @@ static const TestVersorPairFP32 _TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[] = {
void test_versor_are_close_fp32()
{
print_testing_name("bgc_versor_are_close_fp32");
print_testing_name("bgc_fp32_versor_are_close");
// Testing close pairs of versors:
for (int i = 0; i < _TEST_FP32_CLOSE_VERSOR_PAIR_AMOUNT; i++) {
if (!bgc_versor_are_close_fp32(&_TEST_FP32_CLOSE_VERSOR_PAIR_LIST[i].first, &_TEST_FP32_CLOSE_VERSOR_PAIR_LIST[i].second)) {
if (!bgc_fp32_versor_are_close(&_TEST_FP32_CLOSE_VERSOR_PAIR_LIST[i].first, &_TEST_FP32_CLOSE_VERSOR_PAIR_LIST[i].second)) {
print_testing_error("A pair of close versors was not recognized");
return;
}
@ -108,7 +108,7 @@ void test_versor_are_close_fp32()
// Testing different pairs of versors:
for (int i = 0; i < _TEST_FP32_DIFFERENT_VERSOR_PAIR_AMOUNT; i++) {
if (bgc_versor_are_close_fp32(&_TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[i].first, &_TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[i].second)) {
if (bgc_fp32_versor_are_close(&_TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[i].first, &_TEST_FP32_DIFFERENT_VERSOR_PAIR_LIST[i].second)) {
print_testing_error("A pair of different versors was recognized as close versors");
return;
}
@ -125,35 +125,35 @@ static const int _TEST_FP64_CLOSE_VERSOR_PAIR_AMOUNT = 10;
static const TestVersorPairFP64 _TEST_FP64_CLOSE_VERSOR_PAIR_LIST[] = {
{
{ 1.0, 0.0, 0.0, 0.0 },
{ 1.0 + 0.75 * BGC_EPSYLON_FP64, 0.0, 0.0, 0.0 }
{ 1.0 + 0.75 * BGC_FP64_EPSYLON, 0.0, 0.0, 0.0 }
},
{
{ 1.0, 0.0, 0.0, 0.0 },
{ 1.0 - 0.75 * BGC_EPSYLON_FP64, 0.0, 0.0, 0.0 }
{ 1.0 - 0.75 * BGC_FP64_EPSYLON, 0.0, 0.0, 0.0 }
},
{
{ 0.0, 1.0, 0.0, 0.0 },
{ 0.0, 1.0 + 0.75 * BGC_EPSYLON_FP64, 0.0, 0.0 }
{ 0.0, 1.0 + 0.75 * BGC_FP64_EPSYLON, 0.0, 0.0 }
},
{
{ 0.0, 1.0, 0.0, 0.0 },
{ 0.0, 1.0 - 0.75 * BGC_EPSYLON_FP64, 0.0, 0.0 }
{ 0.0, 1.0 - 0.75 * BGC_FP64_EPSYLON, 0.0, 0.0 }
},
{
{ 0.0, 0.0, 1.0, 0.0 },
{ 0.0, 0.0, 1.0 + 0.75 * BGC_EPSYLON_FP64, 0.0 }
{ 0.0, 0.0, 1.0 + 0.75 * BGC_FP64_EPSYLON, 0.0 }
},
{
{ 0.0, 0.0, 1.0, 0.0 },
{ 0.0, 0.0, 1.0 - 0.75 * BGC_EPSYLON_FP64, 0.0 }
{ 0.0, 0.0, 1.0 - 0.75 * BGC_FP64_EPSYLON, 0.0 }
},
{
{ 0.0, 0.0, 0.0, 1.0 },
{ 0.0, 0.0, 0.0, 1.0 + 0.75 * BGC_EPSYLON_FP64 }
{ 0.0, 0.0, 0.0, 1.0 + 0.75 * BGC_FP64_EPSYLON }
},
{
{ 0.0, 0.0, 0.0, 1.0 },
{ 0.0, 0.0, 0.0, 1.0 - 0.75 * BGC_EPSYLON_FP64 }
{ 0.0, 0.0, 0.0, 1.0 - 0.75 * BGC_FP64_EPSYLON }
},
{
{ 0.7071067811865475244, 0.0, 0.7071067811865465244, 0.0 },
@ -170,35 +170,35 @@ static const int _TEST_FP64_DIFFERENT_VERSOR_PAIR_AMOUNT = 10;
static const TestVersorPairFP64 _TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[] = {
{
{ 1.0, 0.0, 0.0, 0.0 },
{ 1.0 + 1.25 * BGC_EPSYLON_FP64, 0.0, 0.0, 0.0 }
{ 1.0 + 1.25 * BGC_FP64_EPSYLON, 0.0, 0.0, 0.0 }
},
{
{ 1.0, 0.0, 0.0, 0.0 },
{ 1.0 - 1.25 * BGC_EPSYLON_FP64, 0.0, 0.0, 0.0 }
{ 1.0 - 1.25 * BGC_FP64_EPSYLON, 0.0, 0.0, 0.0 }
},
{
{ 0.0, 1.0, 0.0, 0.0 },
{ 0.0, 1.0 + 1.25 * BGC_EPSYLON_FP64, 0.0, 0.0 }
{ 0.0, 1.0 + 1.25 * BGC_FP64_EPSYLON, 0.0, 0.0 }
},
{
{ 0.0, 1.0, 0.0, 0.0 },
{ 0.0, 1.0 - 1.25 * BGC_EPSYLON_FP64, 0.0, 0.0 }
{ 0.0, 1.0 - 1.25 * BGC_FP64_EPSYLON, 0.0, 0.0 }
},
{
{ 0.0, 0.0, 1.0, 0.0 },
{ 0.0, 0.0, 1.0 + 1.25 * BGC_EPSYLON_FP64, 0.0 }
{ 0.0, 0.0, 1.0 + 1.25 * BGC_FP64_EPSYLON, 0.0 }
},
{
{ 0.0, 0.0, 1.0, 0.0 },
{ 0.0, 0.0, 1.0 - 1.25 * BGC_EPSYLON_FP64, 0.0 }
{ 0.0, 0.0, 1.0 - 1.25 * BGC_FP64_EPSYLON, 0.0 }
},
{
{ 0.0, 0.0, 0.0, 1.0 },
{ 0.0, 0.0, 0.0, 1.0 + 1.25 * BGC_EPSYLON_FP64 }
{ 0.0, 0.0, 0.0, 1.0 + 1.25 * BGC_FP64_EPSYLON }
},
{
{ 0.0, 0.0, 0.0, 1.0 },
{ 0.0, 0.0, 0.0, 1.0 - 1.25 * BGC_EPSYLON_FP64 }
{ 0.0, 0.0, 0.0, 1.0 - 1.25 * BGC_FP64_EPSYLON }
},
{
{ 0.7071067811866, 0.0, 0.7071067811865, 0.0 },
@ -212,11 +212,11 @@ static const TestVersorPairFP64 _TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[] = {
void test_versor_are_close_fp64()
{
print_testing_name("bgc_versor_are_close_fp64");
print_testing_name("bgc_fp64_versor_are_close");
// Testing close pairs of versors:
for (int i = 0; i < _TEST_FP64_CLOSE_VERSOR_PAIR_AMOUNT; i++) {
if (!bgc_versor_are_close_fp64(&_TEST_FP64_CLOSE_VERSOR_PAIR_LIST[i].first, &_TEST_FP64_CLOSE_VERSOR_PAIR_LIST[i].second)) {
if (!bgc_fp64_versor_are_close(&_TEST_FP64_CLOSE_VERSOR_PAIR_LIST[i].first, &_TEST_FP64_CLOSE_VERSOR_PAIR_LIST[i].second)) {
print_testing_error("A pair of close versors was not recognized");
return;
}
@ -224,7 +224,7 @@ void test_versor_are_close_fp64()
// Testing different pairs of versors:
for (int i = 0; i < _TEST_FP64_DIFFERENT_VERSOR_PAIR_AMOUNT; i++) {
if (bgc_versor_are_close_fp64(&_TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[i].first, &_TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[i].second)) {
if (bgc_fp64_versor_are_close(&_TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[i].first, &_TEST_FP64_DIFFERENT_VERSOR_PAIR_LIST[i].second)) {
print_testing_error("A pair of different versors was recognized as close versors");
return;
}