void TSStatic::_onResourceChanged( const Torque::Path &path ) { if ( path != Path( mShapeName ) ) return; _createShape(); _updateShouldTick(); }
bool TSStatic::onAdd() { PROFILE_SCOPE(TSStatic_onAdd); if ( isServerObject() ) { // Handle the old "usePolysoup" field SimFieldDictionary* fieldDict = getFieldDictionary(); if ( fieldDict ) { StringTableEntry slotName = StringTable->insert( "usePolysoup" ); SimFieldDictionary::Entry * entry = fieldDict->findDynamicField( slotName ); if ( entry ) { // Was "usePolysoup" set? bool usePolysoup = dAtob( entry->value ); // "usePolysoup" maps to the new VisibleMesh type if ( usePolysoup ) mCollisionType = VisibleMesh; // Remove the field in favor on the new "collisionType" field fieldDict->setFieldValue( slotName, "" ); } } } if ( !Parent::onAdd() ) return false; // Setup the shape. if ( !_createShape() ) { Con::errorf( "TSStatic::onAdd() - Shape creation failed!" ); return false; } setRenderTransform(mObjToWorld); // Register for the resource change signal. ResourceManager::get().getChangedSignal().notify( this, &TSStatic::_onResourceChanged ); addToScene(); _updateShouldTick(); return true; }
void gkPhysicsController::createShape(void) { GK_ASSERT(!m_shape && m_object); m_shape = _createShape(); }