| 254 | } |
| 255 | |
| 256 | bool TSStatic::onAdd() |
| 257 | { |
| 258 | PROFILE_SCOPE(TSStatic_onAdd); |
| 259 | |
| 260 | if ( isServerObject() ) |
| 261 | { |
| 262 | // Handle the old "usePolysoup" field |
| 263 | SimFieldDictionary* fieldDict = getFieldDictionary(); |
| 264 | |
| 265 | if ( fieldDict ) |
| 266 | { |
| 267 | StringTableEntry slotName = StringTable->insert( "usePolysoup" ); |
| 268 | |
| 269 | SimFieldDictionary::Entry * entry = fieldDict->findDynamicField( slotName ); |
| 270 | |
| 271 | if ( entry ) |
| 272 | { |
| 273 | // Was "usePolysoup" set? |
| 274 | bool usePolysoup = dAtob( entry->value ); |
| 275 | |
| 276 | // "usePolysoup" maps to the new VisibleMesh type |
| 277 | if ( usePolysoup ) |
| 278 | mCollisionType = VisibleMesh; |
| 279 | |
| 280 | // Remove the field in favor on the new "collisionType" field |
| 281 | fieldDict->setFieldValue( slotName, "" ); |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | if ( !Parent::onAdd() ) |
| 287 | return false; |
| 288 | |
| 289 | // Setup the shape. |
| 290 | if ( !_createShape() ) |
| 291 | { |
| 292 | Con::errorf( "TSStatic::onAdd() - Shape creation failed!" ); |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | setRenderTransform(mObjToWorld); |
| 297 | |
| 298 | // Register for the resource change signal. |
| 299 | ResourceManager::get().getChangedSignal().notify( this, &TSStatic::_onResourceChanged ); |
| 300 | |
| 301 | addToScene(); |
| 302 | |
| 303 | if ( isClientObject() ) |
| 304 | { |
| 305 | mCubeReflector.unregisterReflector(); |
| 306 | |
| 307 | if ( reflectorDesc ) |
| 308 | mCubeReflector.registerReflector( this, reflectorDesc ); |
| 309 | } |
| 310 | |
| 311 | _updateShouldTick(); |
| 312 | |
| 313 | // Accumulation and environment mapping |
nothing calls this directly
no test coverage detected