Browse Source

Fix plParticleSystem and plAgeLoadedMsg.

Darryl Pogue 13 years ago
parent
commit
dbced518cb
  1. 1
      Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h
  2. 3
      Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp
  3. 3
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp
  4. 6
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp
  5. 5
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp

1
Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h

@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plAgeLoadedMsg_INC #ifndef plAgeLoadedMsg_INC
#define plAgeLoadedMsg_INC #define plAgeLoadedMsg_INC
#include "pnUtils/pnUtils.h"
#include "pnMessage/plMessage.h" #include "pnMessage/plMessage.h"
// //

3
Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp

@ -104,7 +104,8 @@ void plConvexVolume::Update(const hsMatrix44 &l2w)
{ {
// Since fN is an hsVector3, it will only apply the rotational aspect of the transform... // Since fN is an hsVector3, it will only apply the rotational aspect of the transform...
fWorldPlanes[i].fN = l2w * fLocalPlanes[i].fN; fWorldPlanes[i].fN = l2w * fLocalPlanes[i].fN;
planePt.Set(&(fLocalPlanes[i].fN * fLocalPlanes[i].fD)); hsVector3 tmp = fLocalPlanes[i].fN * fLocalPlanes[i].fD;
planePt.Set(&tmp);
fWorldPlanes[i].fD = -(l2w * planePt).InnerProduct(fWorldPlanes[i].fN); fWorldPlanes[i].fD = -(l2w * planePt).InnerProduct(fWorldPlanes[i].fN);
} }
} }

3
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp

@ -759,7 +759,8 @@ hsBool plParticleFlockEffect::ApplyEffect(const plEffectTargetInfo& target, Int3
goal = fDissenterTarget; goal = fDissenterTarget;
hsVector3 goalDir; hsVector3 goalDir;
goalDir.Set(&(goal - pos)); hsPoint3 tmp = goal - pos;
goalDir.Set(&tmp);
hsScalar distSq = goalDir.MagnitudeSquared(); hsScalar distSq = goalDir.MagnitudeSquared();
goalDir.Normalize(); goalDir.Normalize();

6
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp

@ -410,7 +410,11 @@ void plParticleEmitter::IUpdateParticles(hsScalar delta)
// This is the only orientation option (so far) that requires an update here // This is the only orientation option (so far) that requires an update here
if (fMiscFlags & (kOrientationVelocityBased | kOrientationVelocityStretch | kOrientationVelocityFlow)) if (fMiscFlags & (kOrientationVelocityBased | kOrientationVelocityStretch | kOrientationVelocityFlow))
fParticleCores[i].fOrientation.Set(&(*currVelocity * delta)); // mf - want the orientation to be a delposition {
// mf - want the orientation to be a delposition
hsVector3 tmp = *currVelocity * delta;
fParticleCores[i].fOrientation.Set(&tmp);
}
else if( fParticleExts[i].fRadsPerSec != 0 ) else if( fParticleExts[i].fRadsPerSec != 0 )
{ {
hsScalar sinX, cosX; hsScalar sinX, cosX;

5
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp

@ -216,7 +216,8 @@ hsBool plSimpleParticleGenerator::AddAutoParticles(plParticleEmitter *emitter, f
if( fPartRadsPerSecRange > 0 ) if( fPartRadsPerSecRange > 0 )
radsPerSec = fPartRadsPerSecRange * sRandom.RandMinusOneToOne(); radsPerSec = fPartRadsPerSecRange * sRandom.RandMinusOneToOne();
emitter->AddParticle(currStart, initDirection * initVelocity, tile, fXSize, fYSize, currSizeVar, hsVector3 tmp = initDirection * initVelocity;
emitter->AddParticle(currStart, tmp, tile, fXSize, fYSize, currSizeVar,
invMass, initLife, orientation, miscFlags, radsPerSec); invMass, initLife, orientation, miscFlags, radsPerSec);
} }
@ -451,4 +452,4 @@ void plOneTimeParticleGenerator::Write(hsStream* s, hsResMgr *mgr)
fPosition[i].Write(s); fPosition[i].Write(s);
fDirection[i].Write(s); fDirection[i].Write(s);
} }
} }

Loading…
Cancel
Save