I don't know what I've done

This commit is contained in:
2026-08-19 00:51:05 -07:00
parent f2c7c0d882
commit 0f1e1ee4e3
3 changed files with 17 additions and 9 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ You'll need these even if you don't compile with cmake until SYCL gets native LL
All simulation code uses single-precision floating point arithmetic to ensure compatability with (integrated) graphics packages that do not support 64-bit floating point.
polypartiCL is licensed with the 3-clause BSD license.
polypartiCL is licensed with the 3-clause BSD license. Initial development of GLSL shaders (./shaders/*.fs) was assisted by generative AI (Claude Sonnet).
## Todo
- Reduce corner escaping
View File
+16 -8
View File
@@ -5,6 +5,7 @@
#include <sycl/sycl.hpp>
#include <exception>
#include <vector>
#include <array>
#include <fstream>
#include <algorithm>
@@ -12,11 +13,15 @@ using namespace sycl;
struct Polyparti::ParticleField::ColCode {
std::vector<XYVector> positions, velocities;
float t, lifeTime = 0, startTime = 0;
int count, decay = 0, originCounter = 0;
int color[4];
std::vector<float> lifeTime, startTime;
int count;
std::vector<int> decay, originCounter;
std::vector<std::array<int,4> > color;
//int color[4];
//float decay = 1.0f;
bool dies = false, dead = false;
//bool dies = false, dead = false;
std::vector<bool> dies, dead;
float t;
// allocate only one queue so we don't reinitialize every step of the calculation
static queue& q_shared() {
@@ -197,6 +202,9 @@ struct Polyparti::ParticleField::ColCode {
free(v_ptr, q);
free(t_ptr, q);
}
void updateSpecs() {
}
};
@@ -224,7 +232,7 @@ void Polyparti::ParticleField::deleteParticle(int index) {
}
void Polyparti::ParticleField::updateField(std::vector<XYVector> verticies, double time) {
if(colcode->t > 0) {
/*if(colcode->t > 0) {
++colcode->originCounter;
} else if (colcode->t < 0) {
--colcode->originCounter;
@@ -236,12 +244,12 @@ void Polyparti::ParticleField::updateField(std::vector<XYVector> verticies, doub
if (colcode->color[3] <= 0) {
colcode->dead = true;
}
}
}*/
if(colcode->originCounter >= 0) {
//if(colcode->originCounter >= 0) {
colcode->checkCollisions(verticies);
colcode->moveParticles();
}
//}
}
const std::vector<XYVector>& Polyparti::ParticleField::getPositions() const {