add ParticlesPreset

This commit is contained in:
MihailRis
2024-11-03 14:25:29 +03:00
parent 83ddbda90b
commit 9728c674fc
5 changed files with 47 additions and 14 deletions
+2 -1
View File
@@ -23,7 +23,7 @@ Emitter::Emitter(
texture(texture),
spawnInterval(spawnInterval),
count(count),
behaviour() {
preset() {
this->prototype.emitter = this;
}
@@ -47,6 +47,7 @@ void Emitter::update(
position = entity->getTransform().pos;
}
}
const float maxDistance = preset.maxDistance;
if (glm::distance2(position, cameraPosition) > maxDistance * maxDistance) {
if (count > 0) {
if (spawnInterval < FLT_EPSILON) {