generated from AfonsoCMSousa/CPP-OpenGLTemplate
fix: physics tweak
This commit is contained in:
parent
d3510b2ce8
commit
a1f868c27b
@ -63,7 +63,7 @@ Particle particle_init(Vec3 position, Color color) {
|
|||||||
p.color = color;
|
p.color = color;
|
||||||
p.velocity = {0.0f, 0.0f, 0.0f};
|
p.velocity = {0.0f, 0.0f, 0.0f};
|
||||||
|
|
||||||
p.life = -2.0f; // INFO: Imorta
|
p.life = -2.0f; // INFO: Imortal
|
||||||
p.dampening = 0.9f;
|
p.dampening = 0.9f;
|
||||||
p.radius = 0.05f;
|
p.radius = 0.05f;
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
@ -22,8 +22,8 @@ const char VERTEX_SHADER_SOURCE[] = "./source/shader/vertex.glsl";
|
|||||||
const char PROGRAM_NAME[] = "Particle Sim";
|
const char PROGRAM_NAME[] = "Particle Sim";
|
||||||
const unsigned int THREAD_COUNT = 1;
|
const unsigned int THREAD_COUNT = 1;
|
||||||
|
|
||||||
const unsigned int SCR_WIDTH = 1920;
|
const unsigned int SCR_WIDTH = 2560;
|
||||||
const unsigned int SCR_HEIGHT = 1080;
|
const unsigned int SCR_HEIGHT = 1440;
|
||||||
const char *glsl_version;
|
const char *glsl_version;
|
||||||
|
|
||||||
const unsigned int PARTICLE_COUNT = 3;
|
const unsigned int PARTICLE_COUNT = 3;
|
||||||
@ -220,7 +220,7 @@ int main() {
|
|||||||
if (particles == NULL) {
|
if (particles == NULL) {
|
||||||
snprintf(errLog, 128, "There was a issue allocating memory for the particle list\n");
|
snprintf(errLog, 128, "There was a issue allocating memory for the particle list\n");
|
||||||
} else {
|
} else {
|
||||||
particles[0] = particle_init({1.000001f, 1.0f, 0.97f}, {1.0f, 0.0f, 0.0f, 255.0f});
|
particles[0] = particle_init({1.000001f, 1.0f, 0.994f}, {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[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});
|
particles[2] = particle_init({0.99995f, 1.4f, 1.004f}, {0.0f, 0.0f, 1.0f, 255.0f});
|
||||||
}
|
}
|
||||||
@ -293,7 +293,7 @@ int main() {
|
|||||||
for (int i = 0; i < THREAD_COUNT; i++)
|
for (int i = 0; i < THREAD_COUNT; i++)
|
||||||
alive_count += thread_params[i].alive_count;
|
alive_count += thread_params[i].alive_count;
|
||||||
|
|
||||||
collision_update(particles, alive_count, 0.06f);
|
collision_update(particles, alive_count, 0.7f);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
glClearColor(0.03f, 0.03f, 0.03f, 1.0f);
|
glClearColor(0.03f, 0.03f, 0.03f, 1.0f);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user