Продолжение переименования типов и функций
This commit is contained in:
parent
605afabd94
commit
3b6efaafa9
25 changed files with 768 additions and 916 deletions
|
|
@ -31,7 +31,6 @@
|
||||||
<Add directory="../basic-geometry" />
|
<Add directory="../basic-geometry" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
<Linker>
|
<Linker>
|
||||||
<Add option="-O2" />
|
|
||||||
<Add option="-s" />
|
<Add option="-s" />
|
||||||
<Add library="basic-geometry" />
|
<Add library="basic-geometry" />
|
||||||
<Add library="m" />
|
<Add library="m" />
|
||||||
|
|
|
||||||
|
|
@ -10,19 +10,19 @@
|
||||||
#endif // _WINDOWS_
|
#endif // _WINDOWS_
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
// fp32_versor_t versor1, versor2, result;
|
versor_fp32_t versor1, versor2, result;
|
||||||
fp32_matrix3x3_t matrix;
|
matrix3x3_fp32_t matrix;
|
||||||
fp32_vector3_t vector1, vector2;
|
vector3_fp32_t vector1, vector2;
|
||||||
} fp32_structure_t;
|
} structure_fp32_t;
|
||||||
|
|
||||||
fp32_structure_t* allocate_structures(const unsigned int amount)
|
structure_fp32_t* allocate_structures(const unsigned int amount)
|
||||||
{
|
{
|
||||||
return calloc(amount, sizeof(fp32_structure_t));
|
return calloc(amount, sizeof(structure_fp32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
fp32_structure_t* make_structures(const unsigned int amount)
|
structure_fp32_t* make_structures(const unsigned int amount)
|
||||||
{
|
{
|
||||||
fp32_structure_t* list = allocate_structures(amount);
|
structure_fp32_t* list = allocate_structures(amount);
|
||||||
|
|
||||||
if (list == 0) {
|
if (list == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -31,8 +31,7 @@ fp32_structure_t* make_structures(const unsigned int amount)
|
||||||
const float multiplier = 2.0f / RAND_MAX;
|
const float multiplier = 2.0f / RAND_MAX;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < amount; i++) {
|
for (unsigned int i = 0; i < amount; i++) {
|
||||||
/*
|
versor_fp32_set_values(
|
||||||
fp32_versor_set_values(
|
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
|
|
@ -40,7 +39,7 @@ fp32_structure_t* make_structures(const unsigned int amount)
|
||||||
&list[i].versor1
|
&list[i].versor1
|
||||||
);
|
);
|
||||||
|
|
||||||
fp32_versor_set_values(
|
versor_fp32_set_values(
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
|
|
@ -48,54 +47,54 @@ fp32_structure_t* make_structures(const unsigned int amount)
|
||||||
&list[i].versor2
|
&list[i].versor2
|
||||||
);
|
);
|
||||||
|
|
||||||
fp32_versor_reset(&list[i].result);
|
versor_reset_fp32(&list[i].result);
|
||||||
*/
|
|
||||||
fp32_matrix3x3_set_to_identity(&list[i].matrix);
|
|
||||||
|
|
||||||
fp32_vector3_set_values(
|
matrix3x3_fp32_set_to_identity(&list[i].matrix);
|
||||||
|
|
||||||
|
vector3_set_fp32(
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
rand() * multiplier - 1.0f,
|
rand() * multiplier - 1.0f,
|
||||||
&list[i].vector1
|
&list[i].vector1
|
||||||
);
|
);
|
||||||
|
|
||||||
fp32_vector3_reset(&list[i].vector2);
|
vector3_reset_fp32(&list[i].vector2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_versor(const fp32_versor_t* versor)
|
void print_versor_fp32(const versor_fp32_t* versor)
|
||||||
{
|
{
|
||||||
printf("Versor (%f, %f, %f, %f)\n", versor->s0, versor->x1, versor->x2, versor->x3);
|
printf("Versor (%f, %f, %f, %f)\n", versor->s0, versor->x1, versor->x2, versor->x3);
|
||||||
}
|
}
|
||||||
|
|
||||||