This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <time.h> // Robert Nystrom | |
| #include <stdio.h> // @munificentbob | |
| #include <stdlib.h> // for Ginny | |
| #define r return // 2008-2019 | |
| #define l(a, b, c, d) for (i y=a;y\ | |
| <b; y++) for (int x = c; x < d; x++) | |
| typedef int i;const i H=40;const i W | |
| =80;i m[40][80];i g(i x){r rand()%x; | |
| }void cave(i s){i w=g(10)+5;i h=g(6) | |
| +3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.IO.Compression; | |
| using System.Text; | |
| // File Format: | |
| // https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md | |
| // Note: I didn't test with with Indexed or Grayscale colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace updaters | |
| { | |
| void EulerUpdater::update(double dt, ParticleData *p) | |
| { | |
| const glm::vec4 globalA{ dt * m_globalAcceleration.x, dt * m_globalAcceleration.y, dt * m_globalAcceleration.z, 0.0 }; | |
| const float localDT = (float)dt; | |
| const unsigned int endId = p->m_countAlive; | |
| for (size_t i = 0; i < endId; ++i) | |
| p->m_acc[i] += globalA; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "particleGenerators.h" | |
| #include <assert.h> | |
| #include <algorithm> | |
| #include <glm/common.hpp> | |
| #include <glm/gtc/random.hpp> | |
| namespace particles | |
| { | |
| namespace generators | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "particles.h" | |
| #include <assert.h> | |
| #include <algorithm> | |
| namespace particles | |
| { | |
| void ParticleData::generate(size_t maxSize) | |
| { | |
| m_count = maxSize; | |
| m_countAlive = 0; |