From 745378f9be37d3825f8854bbf35c6013cfa3a79a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:46:06 -0800 Subject: [PATCH] Fix plAvatar. --- Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp | 10 +++++----- Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp | 8 ++++---- .../Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp | 3 ++- .../Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h | 2 +- .../PubUtilLib/plAvatar/plPhysicalControllerCore.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp | 6 ++++-- 14 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 30e6393f..7d18dcf8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -438,9 +438,9 @@ void plArmatureModBase::AdjustLOD() hsPoint3 delta = ourPos - camPos; float distanceSquared = delta.MagnitudeSquared(); if (distanceSquared < fLODDistance * fLODDistance) - SetLOD(__max(0, fMinLOD)); + SetLOD(max(0, fMinLOD)); else if (distanceSquared < fLODDistance * fLODDistance * 4.0) - SetLOD(__max(1, fMinLOD)); + SetLOD(max(1, fMinLOD)); else SetLOD(2); } @@ -1102,7 +1102,7 @@ hsBool plArmatureMod::MsgReceive(plMessage* msg) plCorrectionMsg *corMsg = plCorrectionMsg::ConvertNoRef(msg); if (corMsg) { - hsMatrix44 &correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); + hsMatrix44 correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); if (fBoneRootAnimator) fBoneRootAnimator->SetCorrection(correction); } @@ -2678,14 +2678,14 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *str hsMatrix44 l2w = SO->GetLocalToWorld(); hsPoint3 worldPos = l2w.GetTranslate(); - char *opaque = IsOpaque() ? "yes" : "no"; + const char *opaque = IsOpaque() ? "yes" : "no"; sprintf(strBuf, "position(world): %.2f, %.2f, %.2f Opaque: %3s", worldPos.fX, worldPos.fY, worldPos.fZ, opaque); debugTxt.DrawString(x, y, strBuf); y += lineHeight; hsPoint3 kPos; - char *kinematic = "n.a."; + const char *kinematic = "n.a."; const char* frozen = "n.a."; if (fController) { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index cf6a7ff1..709ebc58 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -104,7 +104,7 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, char *strBuf, float strength = GetStrength(); const char *onOff = strength > 0 ? "on" : "off"; char blendBar[11] = "||||||||||"; - int bars = (int)__min(10 * strength, 10); + int bars = (int)min(10 * strength, 10); blendBar[bars] = '\0'; if (fAnim) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp index 88003c14..465515aa 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp @@ -330,8 +330,8 @@ void plAvBrainCritter::SightCone(float coneRad) fSightConeAngle = coneRad; // calculate the minimum dot product for the cone of sight (angle/2 vector dotted with straight ahead) - hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0); - hsQuat rotation(fSightConeAngle/2, &hsVector3(0, 1, 0)); + hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0), up(0, 1, 0); + hsQuat rotation(fSightConeAngle/2, &up); viewVector = hsVector3(rotation.Rotate(&viewVector)); viewVector.Normalize(); fSightConeDotMin = straightVector * viewVector; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 884a0f68..59ab447b 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -183,7 +183,7 @@ public: // hsAssert(0, "fixme physx"); float oldSpeed = fabs(fSwimBrain->fCallbackAction->GetTurnStrength()); float thisInc = elapsed * incPerSec; - float newSpeed = __min(oldSpeed + thisInc, maxTurnSpeed); + float newSpeed = min(oldSpeed + thisInc, maxTurnSpeed); fSwimBrain->fCallbackAction->SetTurnStrength(newSpeed * fAvMod->GetKeyTurnStrength() + fAvMod->GetAnalogTurnStrength()); // the turn is actually applied during PhysicsUpdate } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp index 946721a2..c59b5f4f 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPhysicalControllerCore.h" // Generic geom utils. -hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -float AngleRad2d (float x1, float y1, float x3, float y3); +static hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static float AngleRad2d (float x1, float y1, float x3, float y3); inline hsVector3 GetYAxis(hsMatrix44 &mat) { return hsVector3(mat.fMap[1][0], mat.fMap[1][1], mat.fMap[1][2]); @@ -195,7 +195,7 @@ bool plWalkingController::EnableControlledFlight(bool status) fWaitingForGround = true; } else - fControlledFlight = __max(--fControlledFlight, 0); + fControlledFlight = max(--fControlledFlight, 0); return status; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h index b63cfbf7..42a710fa 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h @@ -100,4 +100,4 @@ protected: // Don't try to trigger during this time. }; -#endif plAvLadderMod_INC +#endif //plAvLadderMod_INC diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp index a720ab14..4f1a8166 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp @@ -314,7 +314,8 @@ void plAvTaskSeek::LeaveAge(plArmatureMod *avatar) hsBool plAvTaskSeek::IAnalyze(plArmatureMod *avatar) { avatar->GetPositionAndRotationSim(&fPosition, &fRotation); - fGoalVec.Set(&(hsScalarTriple)(fSeekPos - fPosition)); + hsScalarTriple tmp(fSeekPos - fPosition); + fGoalVec.Set(&tmp); hsVector3 normalizedGoalVec(fGoalVec); normalizedGoalVec.Normalize(); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 5c497296..2e6dc9c3 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "hsStream.h" #include "hsResMgr.h" -#include "plGDispatch.h" +#include "plgDispatch.h" #include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plFixedKey.h" #include "pnSceneObject/plSceneObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp index d961f5c1..4c5f6617 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp @@ -636,7 +636,7 @@ void plAvatarMgr::RemoveOneShot(plOneShotMod *oneshot) if(oneshot == thisOneshot) { - i = fOneShots.erase(i); + fOneShots.erase(i); // destroy our copy of the target name delete[] name; } else { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h index 551af57c..38a0cd29 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h @@ -99,7 +99,7 @@ public: static void HandleSingleSDR(const plStateDataRecord *sdr, plClothingOutfit *clothing = nil, plClosetItem *closetItem = nil); static void PutSingleItemIntoSDR(plClosetItem *item, plStateDataRecord *sdr); - static const plClothingSDLModifier *plClothingSDLModifier::FindClothingSDLModifier(const plSceneObject *obj); + static const plClothingSDLModifier *FindClothingSDLModifier(const plSceneObject *obj); }; #endif // plClothingSDLModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp index 8fcbc8c7..f43af2ec 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plArmatureMod.h" // for LOS enum type #include "plMatrixChannel.h" #include "hsTimer.h" -#include "plPhysx/plSimulationMgr.h" -#include "plPhysx/plPXPhysical.h" +#include "plPhysX/plSimulationMgr.h" +#include "plPhysX/plPXPhysical.h" #include "pnMessage/plSetNetGroupIDMsg.h" #define kSWIMRADIUS 1.1f #define kSWIMHEIGHT 2.8f diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h index ddc2f21a..13cecd34 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h @@ -158,7 +158,7 @@ public: plPointBlend(plPointChannel *channelA, plPointChannel *channelB, plScalarChannel *channelBias); virtual ~plPointBlend(); - plAGChannel * plPointBlend::Remove(plAGChannel *srceToRemove); + plAGChannel * Remove(plAGChannel *srceToRemove); const plPointChannel * GetPointChannelA() const { return fPointA; } void SetPointChannelA(plPointChannel *the_PointA) { fPointA = the_PointA; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h index ff6c66a5..e99c417a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ///////////////////////////////////////////////////////////////////////////////////////// #include "pnModifier/plSingleModifier.h" // base class -#include "pnKeyedobject/plKey.h" // for the notification keys +#include "pnKeyedObject/plKey.h" // for the notification keys #include "hsTemplates.h" // for the array they're kept in ///////////////////////////////////////////////////////////////////////////////////////// @@ -125,4 +125,4 @@ protected: -#endif plSittingModifier_inc +#endif //plSittingModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index 30dd34df..0b174439 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -136,7 +136,8 @@ void plSwimCircularCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, } hsPoint3 center, pos; - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); plKey worldKey = physical->GetSubworld(); if (worldKey) @@ -254,7 +255,8 @@ void plSwimStraightCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, hsPoint3 center, pos; hsVector3 current = fCurrentSO->GetLocalToWorld() * hsVector3(0.f, 1.f, 0.f); - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); physical->GetPositionSim(pos); plKey worldKey = physical->GetSubworld();