MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / animateNodes

Method animateNodes

Engine/source/ts/tsAnimate.cpp:61–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59//-------------------------------------------------------------------------------------
60
61void TSShapeInstance::animateNodes(S32 ss)
62{
63 PROFILE_SCOPE( TSShapeInstance_animateNodes );
64
65 if (!mShape->nodes.size())
66 return;
67
68 // @todo: When a node is added, we need to make sure to resize the nodeTransforms array as well
69 mNodeTransforms.setSize(mShape->nodes.size());
70
71 // temporary storage for node transforms
72 smNodeCurrentRotations.setSize(mShape->nodes.size());
73 smNodeCurrentTranslations.setSize(mShape->nodes.size());
74 smNodeLocalTransforms.setSize(mShape->nodes.size());
75 smRotationThreads.setSize(mShape->nodes.size());
76 smTranslationThreads.setSize(mShape->nodes.size());
77
78 TSIntegerSet rotBeenSet;
79 TSIntegerSet tranBeenSet;
80 TSIntegerSet scaleBeenSet;
81 rotBeenSet.setAll(mShape->nodes.size());
82 tranBeenSet.setAll(mShape->nodes.size());
83 scaleBeenSet.setAll(mShape->nodes.size());
84 smNodeLocalTransformDirty.clearAll();
85
86 S32 i,j,nodeIndex,a,b,start,end,firstBlend = mThreadList.size();
87 for (i=0; i<mThreadList.size(); i++)
88 {
89 TSThread * th = mThreadList[i];
90
91 const TSShape::Sequence* threadSequence = th->getSequence();
92
93 if (threadSequence->isBlend())
94 {
95 // blend sequences need default (if not set by other sequence)
96 // break rather than continue because the rest will be blends too
97 firstBlend = i;
98 break;
99 }
100 rotBeenSet.takeAway(threadSequence->rotationMatters);
101 tranBeenSet.takeAway(threadSequence->translationMatters);
102 scaleBeenSet.takeAway(threadSequence->scaleMatters);
103 }
104 rotBeenSet.takeAway(mCallbackNodes);
105 rotBeenSet.takeAway(mHandsOffNodes);
106 rotBeenSet.overlap(mMaskRotationNodes);
107
108 TSIntegerSet maskPosNodes=mMaskPosXNodes;
109 maskPosNodes.overlap(mMaskPosYNodes);
110 maskPosNodes.overlap(mMaskPosZNodes);
111 tranBeenSet.overlap(maskPosNodes);
112
113 tranBeenSet.takeAway(mCallbackNodes);
114 tranBeenSet.takeAway(mHandsOffNodes);
115 // can't add masked nodes since x, y, & z masked separately...
116 // we'll set default regardless of mask status
117
118 // all the nodes marked above need to have the default transform

Callers

nothing calls this directly

Calls 15

setMatrixFunction · 0.85
getMaxFunction · 0.85
takeAwayMethod · 0.80
getQuatFMethod · 0.80
sizeMethod · 0.45
setSizeMethod · 0.45
setAllMethod · 0.45
clearAllMethod · 0.45
getSequenceMethod · 0.45
isBlendMethod · 0.45
overlapMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected