Переименование типов в соответствии со стилем POSIX, отказ от префикса bg_
This commit is contained in:
parent
d2a25823a5
commit
605afabd94
25 changed files with 1109 additions and 1035 deletions
|
|
@ -9,29 +9,172 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif // _WINDOWS_
|
#endif // _WINDOWS_
|
||||||
|
|
||||||
BgFP32Vector3* allocate_vectors3(const unsigned int amount)
|
typedef struct {
|
||||||
|
// fp32_versor_t versor1, versor2, result;
|
||||||
|
fp32_matrix3x3_t matrix;
|
||||||
|
fp32_vector3_t vector1, vector2;
|
||||||
|
} fp32_structure_t;
|
||||||
|
|
||||||
|
fp32_structure_t* allocate_structures(const unsigned int amount)
|
||||||
{
|
{
|
||||||
return calloc(amount, sizeof(BgFP32Vector3));
|
return calloc(amount, sizeof(fp32_structure_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
BgFP32Vector3* make_zero_vectors3(const unsigned int amount)
|
fp32_structure_t* make_structures(const unsigned int amount)
|
||||||
{
|
{
|
||||||
BgFP32Vector3* list = allocate_vectors3(amount);
|
fp32_structure_t* list = allocate_structures(amount);
|
||||||
|
|
||||||
|
if (list == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float multiplier = 2.0f / RAND_MAX;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < amount; i++) {
|
||||||
|
/*
|
||||||
|
fp32_versor_set_values(
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
&list[i].versor1
|
||||||
|
);
|
||||||
|
|
||||||
|
fp32_versor_set_values(
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
&list[i].versor2
|
||||||
|
);
|
||||||
|
|
||||||
|
fp32_versor_reset(&list[i].result);
|
||||||
|
*/
|
||||||
|
fp32_matrix3x3_set_to_identity(&list[i].matrix);
|
||||||
|
|
||||||
|
fp32_vector3_set_values(
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
rand() * multiplier - 1.0f,
|
||||||
|
&list[i].vector1
|
||||||
|
);
|
||||||
|
|
||||||
|
fp32_vector3_reset(&list[i].vector2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_versor(const fp32_versor_t* versor)
|
||||||
|
{
|
||||||