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

Method mountObject

Engine/source/scene/sceneObject.cpp:1063–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1061//-----------------------------------------------------------------------------
1062
1063void SceneObject::mountObject( SceneObject *obj, S32 node, const MatrixF &xfm )
1064{
1065 if ( obj->mMount.object == this )
1066 {
1067 // Already mounted to this
1068 // So update our node and xfm which may have changed.
1069 obj->mMount.node = node;
1070 obj->mMount.xfm = xfm;
1071 }
1072 else
1073 {
1074 if ( obj->mMount.object )
1075 obj->unmount();
1076
1077 obj->mMount.object = this;
1078 obj->mMount.node = node;
1079 obj->mMount.link = mMount.list;
1080 obj->mMount.xfm = xfm;
1081 mMount.list = obj;
1082
1083 // Assign PIDs to both objects
1084 if ( isServerObject() )
1085 {
1086 obj->getOrCreatePersistentId();
1087 if ( !obj->mMountPID )
1088 {
1089 obj->mMountPID = getOrCreatePersistentId();
1090 obj->mMountPID->incRefCount();
1091 }
1092 }
1093
1094 obj->onMount( this, node );
1095 }
1096}
1097
1098//-----------------------------------------------------------------------------
1099

Callers 3

unpackUpdateMethod · 0.45
resolveMountPIDMethod · 0.45
sceneObject.cppFile · 0.45

Calls 4

unmountMethod · 0.45
incRefCountMethod · 0.45
onMountMethod · 0.45

Tested by

no test coverage detected