1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Deprecate and remove hsStlSortUtils

This commit is contained in:
2013-01-01 20:08:52 -08:00
parent 8158a43dfe
commit 74e06e3984
20 changed files with 25 additions and 344 deletions

View File

@ -68,7 +68,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPhysical.h"
#include "plQuality.h"
#include "hsResMgr.h"
#include "hsStlSortUtils.h"
#include "hsStream.h"
#include "hsStringTokenizer.h"
#include "hsTemplates.h"

View File

@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsStlSortUtils.h"
#include "plComponent.h"
#include "plComponentReg.h"
@ -77,10 +76,6 @@ struct nodeTMInfo
// A vector of matrix samples
typedef std::vector<nodeTMInfo *> plSampleVec;
// PLSAMPLEVECMAP
// A map relating bone names to plSampleVecs
typedef std::map<char *, plSampleVec *, stringSorter> plSampleVecMap;
/////////////
//
// PROTOTYPES
@ -530,233 +525,3 @@ int LimitTransform(INode* node, Matrix3* nodeTM)
*/
return false;
}
/*
//////////
// ARCHIVE
//////////
// Stuff we're not using but that looks kind of handy and which we might use again at some point.
/////////////////////////////////
/////////////////////////////////
/// SAMPLETREEMOTION
/// Sample motion for all of the non-bip bones in the heirarchy.
/// Need to sample the motion before rearranging the hierarchy and then
/// apply it after rearranging; hence the intermediate storage format.
// SAMPLETREEMOTION
// Sample all the (non-bip) motion in the whole tree
plSampleVecMap *SampleTreeMotion(INode* node, INode* parent, int sampleRate, Interface *theInterface)
{
Interval interval = theInterface->GetAnimRange();
TimeValue start = interval.Start(); // in ticks
TimeValue end = interval.End();
plSampleVecMap *ourMap = new plSampleVecMap();
sampleRate *= GetTicksPerFrame(); // convert sample rate to ticks
SampleTreeMotionRecurse(node, parent, sampleRate, start, end, ourMap);
return ourMap;
}
// SAMPLETREEMOTIONRECURSE
void SampleTreeMotionRecurse(INode * node, INode* parent, int sampleRate,
TimeValue start, TimeValue end, plSampleVecMap *ourMap)
{
// if it's not a bip, sample the fuck out of it
if(!HasBipController(node))
{
char *nodeName = node->GetName();
char *nameCopy = new char[strlen(nodeName) + 1];
strcpy(nameCopy, nodeName);
plSampleVec *branch = SampleNodeMotion(node, parent, sampleRate, start, end);
(*ourMap)[nameCopy] = branch;
}
// whether it's a bip or not, paw through its children
for(int i = 0; i < node->NumberOfChildren(); i++)
{
INode *child = node->GetChildNode(i);
SampleTreeMotionRecurse(child, node, sampleRate, start, end, ourMap);
}
}
// GETPARTS
void GetParts(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAssert(parts, "nil parts");
// decomp matrix
gemAffineParts ap;
hsMatrix44 tXform = plMaxNodeBase::Matrix3ToMatrix44(mat3Array[i]->fMat3);
decomp_affine(tXform.fMap, &ap);
AP_SET((*parts), ap);
}
// MAKEROTKEY
Quat MakeRotKey(INode *node, INode *parent, TimeValue t)
{
AffineParts parts = GetLocalNodeParts(node, parent, t);
Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w);
if( parts.f < 0.f )
{
// q = Quat(parts.q.x, parts.q.y, parts.q.z, -parts.q.w);
}
else
{
// q=Quat(-parts.q.x, -parts.q.y, -parts.q.z, parts.q.w);
}
return q;
}
Quat GetRotKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array)
{
Matrix3 m = mat3Array[i]->fMat3;
AffineParts parts;
decomp_affine(m, &parts);
Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w);
return q;
}
// GETROTKEY
Quat GetRotKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
Quat q;
if( parts->fF < 0.f )
{
q = Quat(parts->fQ.fX, parts->fQ.fY, parts->fQ.fZ, -parts->fQ.fW); // ??? why are we inverting W?
#if 0
if( false)
{
Point3 ax;
float ang;
AngAxisFromQ(q, &ang, ax);
//ang -= M_PI;
ax = -ax;
q = QFromAngAxis(ang, ax);
}
#endif
}
else
{
q=Quat(-parts->fQ.fX, -parts->fQ.fY, -parts->fQ.fZ, parts->fQ.fW);
}
return q;
}
// MAKEPOSKEY
Point3 MakePosKey(INode *node, INode *parent, TimeValue t)
{
AffineParts parts = GetLocalNodeParts(node, parent, t);
return Point3(parts.t.x, parts.t.y, parts.t.z);
}
// GETPOSKEY
Point3 GetPosKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
return Point3(parts->fT.fX, parts->fT.fY, parts->fT.fZ);
}
// MAKESCALEKEY
ScaleValue MakeScaleKey(INode *node, INode *parent, TimeValue t)
{
Matrix3 m1 = node->GetNodeTM(t);
hsMatrix44 hsM = plMaxNodeBase::Matrix3ToMatrix44(m1);
gemAffineParts ap;
hsAffineParts hsParts;
decomp_affine(hsM.fMap, &ap);
AP_SET(hsParts, ap);
Point3 sAx1;
sAx1=Point3(hsParts.fK.fX, hsParts.fK.fY, hsParts.fK.fZ);
if( hsParts.fF < 0.f )
{
sAx1=-sAx1;
}
Quat sQ1(hsParts.fU.fX, hsParts.fU.fY, hsParts.fU.fZ, hsParts.fU.fW);
// return ScaleValue(sAx, sQ);
AffineParts parts = GetLocalNodeParts(node, parent, t);
Point3 sAx(parts.k.x, parts.k.y, parts.k.z);
if( parts.f < 0.f )
{
sAx=-sAx;
}
Quat sQ(parts.u.x, parts.u.y, parts.u.z, parts.u.w);
return ScaleValue(sAx, sQ);
}
// GETSCALEKEY
ScaleValue GetScaleKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
Point3 sAx;
sAx=Point3(parts->fK.fX, parts->fK.fY, parts->fK.fZ);
if( parts->fF < 0.f )
{
sAx=-sAx;
}
Quat sQ(parts->fU.fX, parts->fU.fY, parts->fU.fZ, parts->fU.fW);
return ScaleValue(sAx, sQ);
}
// GETLOCALNODEPARTS
AffineParts GetLocalNodeParts(INode *node, INode *parent, TimeValue t)
{
Matrix3 localTM = node->GetNodeTM(t); // world transform of source node
INode *parent2 = node->GetParentNode();
// localize it
Matrix3 parentTMX = parent->GetNodeTM(t);
Matrix3 parentTM = parent2->GetNodeTM(t);
Matrix3 invParent = Inverse(parentTM);
localTM *= invParent;
AffineParts parts;
decomp_affine(localTM, &parts);
return parts;
}
*/

View File

@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <map>
#include <vector>
#include "hsStlSortUtils.h"
#include "plString.h"
class plErrorMsg;
@ -88,4 +87,4 @@ void GetSegment(const char *note, float time, SegmentMap *segMap, plErrorMsg *pE
bool DoesHaveStopPoints(Animatable *anim);
#endif
#endif

View File

@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsResMgr.h"
#include "hsStlSortUtils.h"
#include "hsWindows.h"
#include <iparamm2.h>
@ -597,7 +596,7 @@ void plResponderProc::ICreateMenu()
{
fhMenu = CreatePopupMenu();
std::map<const char *, HMENU, stringSorter> menus;
std::map<plString, HMENU> menus;
int cmdID = 0;
for (int i = 0; i < gResponderCmds.size(); i++)