fixed bug with rotating particles(x-offset was inverted before ) + lots of new particle related data

This commit is contained in:
Titus Tscharntke 2010-03-12 04:00:51 +00:00
parent cb0ea38d74
commit b8082e83ce
1 changed files with 2 additions and 2 deletions

View File

@ -391,8 +391,8 @@ void UnitParticleSystem::initParticle(Particle *p, int particleIndex){
else
{// rotate it according to rotation
float rad=degToRad(rotation);
p->pos= Vec3f(pos.x+x+offset.z*sinf(rad)-offset.x*cosf(rad), pos.y+random.randRange(-radius/2, radius/2)+offset.y, pos.z+y+(offset.z*cosf(rad)+offset.x*sinf(rad)));
p->speed=Vec3f(p->speed.z*sinf(rad)-p->speed.x*cosf(rad),p->speed.y,(p->speed.z*cosf(rad)+p->speed.x*sinf(rad)));
p->pos= Vec3f(pos.x+x+offset.z*sinf(rad)+offset.x*cosf(rad), pos.y+random.randRange(-radius/2, radius/2)+offset.y, pos.z+y+(offset.z*cosf(rad)-offset.x*sinf(rad)));
p->speed=Vec3f(p->speed.z*sinf(rad)+p->speed.x*cosf(rad),p->speed.y,(p->speed.z*cosf(rad)-p->speed.x*sinf(rad)));
}
}