Skip to content
Snippets Groups Projects
Verified Commit 2f7b80cf authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Potential fix for invalid dt

parent 956ad604
No related branches found
No related tags found
1 merge request!103Added project wobble_bobble and refactored some parts of the framework
......@@ -82,8 +82,10 @@ void main() {
}
}
if (mass > 0.0f) {
velocity += force * dt / mass;
if (dt > 0.0f) {
if (mass > 0.0f) {
velocity += force * dt / mass;
}
}
bvec3 lowerID = lessThanEqual(gl_GlobalInvocationID, ivec3(0));
......
......@@ -22,7 +22,9 @@ void main() {
float size = particles[gl_GlobalInvocationID.x].minimal.size;
vec3 velocity = particles[gl_GlobalInvocationID.x].minimal.velocity;
position = position + velocity * dt;
if (dt > 0.0f) {
position = position + velocity * dt;
}
for (uint i = 0; i < 3; i++) {
if (position[i] - size < 0.0f) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment