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

Method _initMount

Engine/source/T3D/guiObjectView.cpp:671–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

getNodeWorldTransformMethod · 0.80
errorfFunction · 0.50
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