void ProxyEntity::initializeToProxy(const ProxyObjectPtr &ppo) { assert( ppo ); assert( !mProxy || (mProxy->getObjectReference() == ppo->getObjectReference()) ); setIsAggregate(ppo->isAggregate()); /** FIXME: ADDING AND REMOVING LISTENERS COULD INVALIDATE ITERATORS */ if (mProxy) { mProxy->ProxyObjectProvider::removeListener(this); mProxy->PositionProvider::removeListener(this); mProxy->MeshProvider::removeListener(this); } mProxy = ppo; mProxy->ProxyObjectProvider::addListener(this); mProxy->PositionProvider::addListener(this); mProxy->MeshProvider::addListener(this); checkDynamic(); }