From dbced518cb45959080782000ce6a3fd0d8c7896e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:20:26 -0700 Subject: [PATCH] Fix plParticleSystem and plAgeLoadedMsg. --- Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h | 1 - .../Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp | 3 ++- .../Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp | 3 ++- .../PubUtilLib/plParticleSystem/plParticleEmitter.cpp | 6 +++++- .../PubUtilLib/plParticleSystem/plParticleGenerator.cpp | 5 +++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h index 4699883b..2e00fcf3 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plAgeLoadedMsg_INC #define plAgeLoadedMsg_INC -#include "pnUtils/pnUtils.h" #include "pnMessage/plMessage.h" // diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp index 056ebf16..97529b7a 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp +++ b/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... 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); } } diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp index 7e0b9fbf..838a4574 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp @@ -759,7 +759,8 @@ hsBool plParticleFlockEffect::ApplyEffect(const plEffectTargetInfo& target, Int3 goal = fDissenterTarget; hsVector3 goalDir; - goalDir.Set(&(goal - pos)); + hsPoint3 tmp = goal - pos; + goalDir.Set(&tmp); hsScalar distSq = goalDir.MagnitudeSquared(); goalDir.Normalize(); diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp index 06ffa6ce..fe865742 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp +++ b/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 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 ) { hsScalar sinX, cosX; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp index 49351249..c0e0b044 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp @@ -216,7 +216,8 @@ hsBool plSimpleParticleGenerator::AddAutoParticles(plParticleEmitter *emitter, f if( fPartRadsPerSecRange > 0 ) 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); } @@ -451,4 +452,4 @@ void plOneTimeParticleGenerator::Write(hsStream* s, hsResMgr *mgr) fPosition[i].Write(s); fDirection[i].Write(s); } -} \ No newline at end of file +}