void Entity::onAttachToModel(Model& model) { if (m_hostModel != NULL) { ASSERT_MSG( false, "This entity is already attached to a model"); } m_hostModel = &model; onAttached(model); unsigned int count = m_children.size(); for (unsigned int i = 0; i < count; ++i) { m_children[i]->onAttachToModel(model); } }
void Entity::onObjectLoaded() { __super::onObjectLoaded(); if ( m_parent ) { onAttached( *m_parent ); } // copy the managed children to the runtime children array unsigned int count = m_managedChildren.size(); m_children.resize( count ); for( unsigned int i = 0; i < count; ++i ) { m_children[i] = m_managedChildren[i]; } // inform that the children have been attached Children children = m_children; for ( Children::iterator it = children.begin(); it != children.end(); ++it ) { onChildAttached( **it ); } }
void BaseRenderNodeAnimator::attach(RenderNode* target) { mTarget = target; onAttached(); }