feat: COLISIONS AND RADIUS INCLUDED

This commit is contained in:
AfonsoCMSousa
2026-03-24 01:15:07 +00:00
parent 45ed43a968
commit d3510b2ce8
3 changed files with 8 additions and 12 deletions
+5 -9
View File
@@ -20,13 +20,13 @@ const char FRAGMENT_SHADER_SOURCE[] = "./source/shader/fragment.glsl";
const char VERTEX_SHADER_SOURCE[] = "./source/shader/vertex.glsl";
const char PROGRAM_NAME[] = "Particle Sim";
const unsigned int THREAD_COUNT = 8;
const unsigned int THREAD_COUNT = 1;
const unsigned int SCR_WIDTH = 1920;
const unsigned int SCR_HEIGHT = 1080;
const char *glsl_version;
const unsigned int PARTICLE_COUNT = 2000;
const unsigned int PARTICLE_COUNT = 3;
GLFWwindow *window;
unsigned int VBO, VAO;
@@ -220,13 +220,9 @@ int main() {
if (particles == NULL) {
snprintf(errLog, 128, "There was a issue allocating memory for the particle list\n");
} else {
for (unsigned long long i = 0; i < PARTICLE_COUNT; i++) {
float x = ((float)rand() / RAND_MAX) * 2.0f - 1.0f; // Random x between -1 and 1
float y = ((float)rand() / RAND_MAX) * 2.0f - 1.0f; // Random y between -1 and 1
float z = ((float)rand() / RAND_MAX) * 2.0f - 1.0f; // Random z between -1 and 1
particles[i] = particle_init({x, 2, z}, {1.0f, 0.5f, 0.2f, 1.0f});
}
particles[0] = particle_init({1.000001f, 1.0f, 0.97f}, {1.0f, 0.0f, 0.0f, 255.0f});
particles[1] = particle_init({1.0f, 1.2f, 1.0f}, {0.0f, 1.0f, 0.0f, 255.0f});
particles[2] = particle_init({0.99995f, 1.4f, 1.004f}, {0.0f, 0.0f, 1.0f, 255.0f});
}
float current_time;