| 1241 | //----------------------------------------------------------------------------- |
| 1242 | |
| 1243 | void 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 |
no test coverage detected