Esempio n. 1
0
    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();
    }
Esempio n. 2
0
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);
}
Esempio n. 3
0
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);
}
Esempio n. 4
0
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() ) );
}
Esempio n. 5
0
NodeSmartReference NewNullModel ()
{
	return NodeSmartReference((new NullModelNode)->node());
}