Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void World::FillPortalsWorldWithVisibleObstaclesFrom(World& w)
- {
- ResourceCache* cache = context->GetSubsystem<ResourceCache>();
- Material* black = cache->GetResource<Material>("Materials/black.xml"); // notexture unlit black mat (for override white portals on screen)
- if (black)
- if (w.scene)
- {
- PODVector<Node*> nodes;
- w.scene->GetChildrenWithComponent<StaticModel>(nodes, true);
- for (int i = 0; i < nodes.Size(); i++)
- {
- Node* n = nodes[i];
- if (n)
- {
- StaticModel* model = n->GetComponent<StaticModel>();
- if (model)
- {
- Node* newNode = scene->CreateChild(n->GetName(), LOCAL);
- StaticModel* newModel = newNode->CreateComponent<StaticModel>();
- newModel->SetModel(model->GetModel());
- newModel->SetMaterial(black);
- newNode->SetWorldPosition(n->GetWorldPosition());
- newNode->SetWorldRotation(n->GetWorldRotation());
- newNode->SetWorldScale(n->GetWorldScale());
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement