void setNode (scene::Node* node) { ModelCache::iterator i = ModelCache_find(m_path, m_name); if (i != g_modelCache.end()) { (*i).value = NodeSmartReference(*node); } setModel(NodeSmartReference(*node)); connectMap(); }
static ModelCache::iterator ModelCache_insert (const std::string& path, const std::string& name, scene::Node& node) { if (g_modelCache_enabled) { return g_modelCache.insert(ModelKey(path, name), NodeSmartReference(node)); } return g_modelCache.insert(ModelKey("", ""), g_nullModel); }
static NodeSmartReference Entity_create (EntityCreator& entityTable, EntityClass* entityClass, const KeyValues& keyValues) { scene::Node& entity(entityTable.createEntity(entityClass)); for (KeyValues::const_iterator i = keyValues.begin(); i != keyValues.end(); ++i) { Node_getEntity(entity)->setKeyValue((*i).first, (*i).second); } return NodeSmartReference(entity); }
void pushElement( const XMLElement& element ){ ASSERT_MESSAGE( string_equal( element.name(), "entity" ), PARSE_ERROR ); constructor( node(), NodeSmartReference( m_entityTable.createEntity( GlobalEntityClassManager().findOrInsert( "", true ) ) ) ); constructor( primitive(), makeReference( node().get() ) ); }
NodeSmartReference NewNullModel () { return NodeSmartReference((new NullModelNode)->node()); }