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

Method _initMount

Engine/source/T3D/guiObjectView.cpp:670–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668//------------------------------------------------------------------------------
669
670void GuiObjectView::_initMount()
671{
672 AssertFatal( mModel, "GuiObjectView::_initMount - No model loaded!" );
673
674 if( !mMountedModel )
675 return;
676
677 mMountTransform.identity();
678
679 // Look up the node to which to mount to.
680
681 if( !mMountNodeName.isEmpty() )
682 {
683 mMountNode = mModel->getShape()->findNode( mMountNodeName );
684 if( mMountNode == -1 )
685 {
686 Con::errorf( "GuiObjectView::_initMount - No node '%s' on '%s'",
687 mMountNodeName.c_str(),
688 mModelName.c_str()
689 );
690
691 return;
692 }
693 }
694
695 // Make sure mount node is valid.
696
697 if( mMountNode != -1 && mMountNode >= mModel->getShape()->nodes.size() )
698 {
699 Con::errorf( "GuiObjectView::_initMount - Mount node index '%i' out of range for '%s'",
700 mMountNode,
701 mModelName.c_str()
702 );
703
704 mMountNode = -1;
705 return;
706 }
707
708 // Look up node on the mounted model from
709 // which to mount to the primary model's node.
710
711 S32 mountPoint = mMountedModel->getShape()->findNode( "mountPoint" );
712 if( mountPoint != -1 )
713 {
714 mMountedModel->getShape()->getNodeWorldTransform( mountPoint, &mMountTransform ),
715 mMountTransform.inverse();
716 }
717}
718
719//=============================================================================
720// Console Methods.

Callers

nothing calls this directly

Calls 9

errorfFunction · 0.85
getNodeWorldTransformMethod · 0.80
identityMethod · 0.45
isEmptyMethod · 0.45
findNodeMethod · 0.45
getShapeMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
inverseMethod · 0.45

Tested by

no test coverage detected