void OnReceiveWorldCell ( SharedResourcePtr resource ) { std::cout << "WorldCell::" << resource->getName().toStdString() << std::endl; Assets::WorldCellPtr cell = resource.dynamicCast<Assets::WorldCell> (); for ( int i = 0 ; i < cell->getSize < QUuid > ( "GameObjects" ) ; i ++ ) { fetchResource ( cell->get < QUuid > ( "GameObjects", i ) ); } }
void OnReceiveWorld ( SharedResourcePtr resource ) { std::cout << "World::" << resource->getName().toStdString() << std::endl; Assets::WorldPtr world = resource.dynamicCast<Assets::World> (); for ( int i = 0 ; i < world->getSize < QUuid > ( "Cells" ) ; i ++ ) { fetchResource ( world->get < QUuid > ( "Cells", i ) ); } }
void OnReceiveMesh ( SharedResourcePtr resource ) { std::cout << "Mesh::" << resource->getName().toStdString() << std::endl; Assets::MeshPtr mesh = resource.dynamicCast<Assets::Mesh> (); for ( unsigned int i = 0 ; i < mesh->getSize < Assets::MaterialGroup* > ( "MaterialGroups" ) ; i ++ ) { Assets::MaterialGroup* grp = mesh->get < Assets::MaterialGroup* > ( "MaterialGroups", i ); fetchResource ( grp->get < QUuid > ( "Material" ) ); } }
void OnReceiveGameEntity ( SharedResourcePtr resource ) { std::cout << "GameEntity::" << resource->getName().toStdString() << std::endl; Assets::GameEntityPtr ge = resource.dynamicCast<Assets::GameEntity> (); for ( int i = 0 ; i < ge->getSize < Assets::GameEntityElement* > ( "Elements" ) ; i ++ ) { Assets::GameEntityElement* elt = ge->get < Assets::GameEntityElement* > ( "Elements", i ); for ( int j = 0 ; j < elt->getSize < QUuid > ( "Resources" ) ; j ++ ) { fetchResource ( elt->get < QUuid > ( "Resources", j ) ); } } }
void OnReceiveWavefrontMaterial ( SharedResourcePtr resource ) { QUuid fake; std::cout << "WavefrontMaterial::" << resource->getName().toStdString() << std::endl; Assets::MaterialPtr material = resource.dynamicCast<WavefrontMaterial> (); if ( fake != material->get < Texture > ( "AmbientMap" ).imageID ) fetchResource ( material->get < Texture > ( "AmbientMap" ).imageID ); if ( fake != material->get < Texture > ( "DiffuseMap" ).imageID ) fetchResource ( material->get < Texture > ( "DiffuseMap" ).imageID ); if ( fake != material->get < Texture > ( "SpecularMap" ).imageID ) fetchResource ( material->get < Texture > ( "SpecularMap" ).imageID ); if ( fake != material->get < Texture > ( "SpecularExponentMap" ).imageID ) fetchResource ( material->get < Texture > ( "SpecularExponentMap" ).imageID ); if ( fake != material->get < Texture > ( "DissolveMap" ).imageID ) fetchResource ( material->get < Texture > ( "DissolveMap" ).imageID ); if ( fake != material->get < Texture > ( "DecalMap" ).imageID ) fetchResource ( material->get < Texture > ( "DecalMap" ).imageID ); if ( fake != material->get < Texture > ( "DisplacementMap" ).imageID ) fetchResource ( material->get < Texture > ( "DisplacementMap" ).imageID ); if ( fake != material->get < Texture > ( "BumpMap" ).imageID ) fetchResource ( material->get < Texture > ( "BumpMap" ).imageID ); if ( fake != material->get < Texture > ( "ReflectionMap" ).imageID ) fetchResource ( material->get < Texture > ( "ReflectionMap" ).imageID ); }
void OnReceiveLight ( SharedResourcePtr resource ) { std::cout << "Light::" << resource->getName().toStdString() << std::endl; Assets::LightPtr light = resource.dynamicCast<Assets::Light> (); }
void OnReceiveGameObject ( SharedResourcePtr resource ) { std::cout << "GameObject::" << resource->getName().toStdString() << std::endl; Assets::GameObjectPtr go = resource.dynamicCast<Assets::GameObject> (); fetchResource ( go->get < QUuid > ( "Entity" ) ); }
void OnReceiveImage ( SharedResourcePtr resource ) { std::cout << "Image::" << resource->getName().toStdString() << std::endl; Assets::ImagePtr image = resource.dynamicCast<Assets::Image> (); }