mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add ParticlesPreset
This commit is contained in:
parent
83ddbda90b
commit
9728c674fc
5 changed files with 47 additions and 14 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue