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

Method initObjects

Engine/source/ts/tsShape.cpp:423–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected