| 1061 | //----------------------------------------------------------------------------- |
| 1062 | |
| 1063 | void 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 |
no test coverage detected