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

Method mountObject

Engine/source/scene/sceneObject.cpp:1243–1276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1241//-----------------------------------------------------------------------------
1242
1243void SceneObject::mountObject( SceneObject *obj, S32 node, const MatrixF &xfm )
1244{
1245 if ( obj->mMount.object == this )
1246 {
1247 // Already mounted to this
1248 // So update our node and xfm which may have changed.
1249 obj->mMount.node = node;
1250 obj->mMount.xfm = xfm;
1251 }
1252 else
1253 {
1254 if ( obj->mMount.object )
1255 obj->unmount();
1256
1257 obj->mMount.object = this;
1258 obj->mMount.node = node;
1259 obj->mMount.link = mMount.list;
1260 obj->mMount.xfm = xfm;
1261 mMount.list = obj;
1262
1263 // Assign PIDs to both objects
1264 if ( isServerObject() )
1265 {
1266 obj->getOrCreatePersistentId();
1267 if ( !obj->mMountPID )
1268 {
1269 obj->mMountPID = getOrCreatePersistentId();
1270 obj->mMountPID->incRefCount();
1271 }
1272 }
1273
1274 obj->onMount( this, node );
1275 }
1276}
1277
1278//-----------------------------------------------------------------------------
1279

Callers 4

unpackUpdateMethod · 0.45
resolveMountPIDMethod · 0.45
sceneObject.cppFile · 0.45
worldEditor.cppFile · 0.45

Calls 4

unmountMethod · 0.45
incRefCountMethod · 0.45
onMountMethod · 0.45

Tested by

no test coverage detected