mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
particle emitter bounds box fix
take the distance particles can move over thier lifetime into account for emitter bounds. in addition, don't zero out the y axis
This commit is contained in:
parent
6fe51cd9c3
commit
cf0c7a2d11
1 changed files with 7 additions and 3 deletions
|
|
@ -1551,9 +1551,13 @@ void ParticleEmitter::updateBBox()
|
|||
|
||||
for (Particle* part = part_list_head.next; part != NULL; part = part->next)
|
||||
{
|
||||
Point3F particleSize(part->size * 0.5f, 0.0f, part->size * 0.5f);
|
||||
minPt.setMin( part->pos - particleSize );
|
||||
maxPt.setMax( part->pos + particleSize );
|
||||
for (Particle* part = part_list_head.next; part != NULL; part = part->next)
|
||||
{
|
||||
Point3F particleSize(part->size * 0.5f);
|
||||
F32 motion = getMax((part->vel.len() * part->totalLifetime / 1000.0f), 1.0f);
|
||||
minPt.setMin(part->pos - particleSize - Point3F(motion));
|
||||
maxPt.setMax(part->pos + particleSize + Point3F(motion));
|
||||
}
|
||||
}
|
||||
|
||||
mObjBox = Box3F(minPt, maxPt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue