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

Method addObject

Engine/source/ts/tsShapeEdit.cpp:660–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658//-----------------------------------------------------------------------------
659
660S32 TSShape::addObject(const String& objName, S32 subShapeIndex)
661{
662 S32 objIndex = subShapeNumObjects[subShapeIndex];
663
664 // Add object to subshape
665 subShapeNumObjects[subShapeIndex]++;
666 for (S32 i = subShapeIndex + 1; i < subShapeFirstObject.size(); i++)
667 subShapeFirstObject[i]++;
668
669 TSShape::Object obj;
670 obj.nameIndex = addName(objName);
671 obj.nodeIndex = 0;
672 obj.numMeshes = 0;
673 obj.startMeshIndex = (objIndex == 0) ? 0 : objects[objIndex-1].startMeshIndex + objects[objIndex-1].numMeshes;
674 obj.firstDecal = 0;
675 obj.nextSibling = 0;
676 objects.insert(objIndex, obj);
677
678 // Add default object state
679 TSShape::ObjectState state;
680 state.frameIndex = 0;
681 state.matFrameIndex = 0;
682 state.vis = 1.0f;
683 objectStates.insert(objIndex, state);
684
685 // Fixup sequences
686 for (S32 i = 0; i < sequences.size(); i++)
687 sequences[i].baseObjectState++;
688
689 return objIndex;
690}
691
692void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh)
693{

Callers 6

onAddMethod · 0.45
processNodeLightsFunction · 0.45
colladaLights.cppFile · 0.45
onAddMethod · 0.45
findOrCreateMethod · 0.45
terrImport.cppFile · 0.45

Calls 2

sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected