I don't know what I've done
This commit is contained in:
@@ -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.
|
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
|
## Todo
|
||||||
- Reduce corner escaping
|
- Reduce corner escaping
|
||||||
|
|||||||
+16
-8
@@ -5,6 +5,7 @@
|
|||||||
#include <sycl/sycl.hpp>
|
#include <sycl/sycl.hpp>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <array>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@@ -12,11 +13,15 @@ using namespace sycl;
|
|||||||
|
|
||||||
struct Polyparti::ParticleField::ColCode {
|
struct Polyparti::ParticleField::ColCode {
|
||||||
std::vector<XYVector> positions, velocities;
|
std::vector<XYVector> positions, velocities;
|
||||||
float t, lifeTime = 0, startTime = 0;
|
std::vector<float> lifeTime, startTime;
|
||||||
int count, decay = 0, originCounter = 0;
|
int count;
|
||||||
int color[4];
|
std::vector<int> decay, originCounter;
|
||||||
|
std::vector<std::array<int,4> > color;
|
||||||
|
//int color[4];
|
||||||
//float decay = 1.0f;
|
//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
|
// allocate only one queue so we don't reinitialize every step of the calculation
|
||||||
static queue& q_shared() {
|
static queue& q_shared() {
|
||||||
@@ -197,6 +202,9 @@ struct Polyparti::ParticleField::ColCode {
|
|||||||
free(v_ptr, q);
|
free(v_ptr, q);
|
||||||
free(t_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) {
|
void Polyparti::ParticleField::updateField(std::vector<XYVector> verticies, double time) {
|
||||||
if(colcode->t > 0) {
|
/*if(colcode->t > 0) {
|
||||||
++colcode->originCounter;
|
++colcode->originCounter;
|
||||||
} else if (colcode->t < 0) {
|
} else if (colcode->t < 0) {
|
||||||
--colcode->originCounter;
|
--colcode->originCounter;
|
||||||
@@ -236,12 +244,12 @@ void Polyparti::ParticleField::updateField(std::vector<XYVector> verticies, doub
|
|||||||
if (colcode->color[3] <= 0) {
|
if (colcode->color[3] <= 0) {
|
||||||
colcode->dead = true;
|
colcode->dead = true;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(colcode->originCounter >= 0) {
|
//if(colcode->originCounter >= 0) {
|
||||||
colcode->checkCollisions(verticies);
|
colcode->checkCollisions(verticies);
|
||||||
colcode->moveParticles();
|
colcode->moveParticles();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<XYVector>& Polyparti::ParticleField::getPositions() const {
|
const std::vector<XYVector>& Polyparti::ParticleField::getPositions() const {
|
||||||
|
|||||||
Reference in New Issue
Block a user