26 lines
744 B
C
26 lines
744 B
C
|
#include "../src/rand/xoshiro256.h"
|
||
|
#include <stdio.h>
|
||
|
#include "../src/QuadTree/QuadTree.h"
|
||
|
|
||
|
static QuadTree tree;
|
||
|
|
||
|
typedef struct Particle_s {
|
||
|
QuadTreeLeaf position;
|
||
|
} Particle;
|
||
|
|
||
|
static Particle particles[100];
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
QuadTree_Create(&tree, 10000, 10000, NULL);
|
||
|
|
||
|
Xoshiro256State rand_state = { 0, 10, 0, 0 };
|
||
|
|
||
|
for (size_t i = 0; i < sizeof(particles) / sizeof(particles[0]); i++) {
|
||
|
particles[i].position.x = xoshiro256_next(&rand_state) % 10000;
|
||
|
particles[i].position.y = xoshiro256_next(&rand_state) % 10000;
|
||
|
printf("%f %f\n", particles[i].position.y, particles[i].position.x);
|
||
|
QuadTree_Insert(&tree, &particles[i].position);
|
||
|
}
|
||
|
}
|