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

Function eraseStates

Engine/source/ts/tsShapeEdit.cpp:505–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503
504/// Erase animation keyframes (translation, rotation etc)
505template<class T> S32 eraseStates(Vector<T>& vec, const TSIntegerSet& matters, S32 base, S32 numKeyframes, S32 index=-1)
506{
507 S32 dest, count;
508 if (index == -1)
509 {
510 // Erase for all nodes/objects
511 dest = base;
512 count = numKeyframes * matters.count();
513 }
514 else
515 {
516 // Erase for the indexed node/object only
517 dest = base + matters.count(index)*numKeyframes;
518 count = numKeyframes;
519 }
520
521 // Erase the values
522 if (count)
523 {
524 if ((dest + count) < vec.size())
525 dCopyArray(&vec[dest], &vec[dest + count], vec.size() - (dest + count));
526 vec.decrement(count);
527 }
528 return count;
529}
530
531bool TSShape::removeNode(const String& name)
532{

Callers 3

removeNodeMethod · 0.85
removeObjectMethod · 0.85
removeSequenceMethod · 0.85

Calls 4

dCopyArrayFunction · 0.85
decrementMethod · 0.80
countMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected