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

Method initObjects

Engine/source/ts/tsShape.cpp:430–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430void TSShape::initObjects()
431{
432 S32 numSubShapes = subShapeFirstNode.size();
433 AssertFatal(numSubShapes == subShapeFirstObject.size(), "TSShape::initObjects");
434
435 S32 i, j;
436
437 // set up parent/child relationships on nodes and objects
438 for (i = 0; i<nodes.size(); i++)
439 nodes[i].firstObject = nodes[i].firstChild = nodes[i].nextSibling = -1;
440 for (i = 0; i<nodes.size(); i++)
441 {
442 S32 parentIndex = nodes[i].parentIndex;
443 if (parentIndex >= 0)
444 {
445 if (nodes[parentIndex].firstChild<0)
446 nodes[parentIndex].firstChild = i;
447 else
448 {
449 S32 child = nodes[parentIndex].firstChild;
450 while (nodes[child].nextSibling >= 0)
451 child = nodes[child].nextSibling;
452 nodes[child].nextSibling = i;
453 }
454 }
455 }
456 for (i = 0; i<objects.size(); i++)
457 {
458 objects[i].nextSibling = -1;
459
460 S32 nodeIndex = objects[i].nodeIndex;
461 if (nodeIndex >= 0)
462 {
463 if (nodes[nodeIndex].firstObject<0)
464 nodes[nodeIndex].firstObject = i;
465 else
466 {
467 S32 objectIndex = nodes[nodeIndex].firstObject;
468 while (objects[objectIndex].nextSibling >= 0)
469 objectIndex = objects[objectIndex].nextSibling;
470 objects[objectIndex].nextSibling = i;
471 }
472 }
473 }
474
475 mFlags = 0;
476 for (i = 0; i<sequences.size(); i++)
477 {
478 if (!sequences[i].animatesScale())
479 continue;
480
481 U32 curVal = mFlags & AnyScale;
482 U32 newVal = sequences[i].flags & AnyScale;
483 mFlags &= ~(AnyScale);
484 mFlags |= getMax(curVal, newVal); // take the larger value (can only convert upwards)
485 }
486
487 // set up alphaIn and alphaOut vectors...

Callers

nothing calls this directly

Calls 8

getMaxFunction · 0.85
warnfFunction · 0.50
sizeMethod · 0.45
animatesScaleMethod · 0.45
setSizeMethod · 0.45
getNumPolysMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected