void RenderableZoneEntityItem::removeFromScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) { pendingChanges.removeItem(_myMetaItem); if (_model) { _model->removeFromScene(scene, pendingChanges); } }
bool RenderableZoneEntityItem::addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) { _myMetaItem = scene->allocateID(); auto renderData = std::make_shared<RenderableZoneEntityItemMeta>(self); auto renderPayload = std::make_shared<RenderableZoneEntityItemMeta::Payload>(renderData); pendingChanges.resetItem(_myMetaItem, renderPayload); return true; }
bool RenderableParticleEffectEntityItem::addToScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges) { auto particlePayload = std::shared_ptr<ParticlePayload>(new ParticlePayload(shared_from_this())); particlePayload->setPipeline(_untexturedPipeline); _renderItemId = scene->allocateID(); auto renderData = ParticlePayload::Pointer(particlePayload); auto renderPayload = render::PayloadPointer(new ParticlePayload::Payload(renderData)); pendingChanges.resetItem(_renderItemId, renderPayload); _scene = scene; return true; }
bool RenderableModelEntityItem::addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) { _myMetaItem = scene->allocateID(); auto renderData = std::make_shared<RenderableModelEntityItemMeta>(self); auto renderPayload = std::make_shared<RenderableModelEntityItemMeta::Payload>(renderData); pendingChanges.resetItem(_myMetaItem, renderPayload); if (_model) { render::Item::Status::Getters statusGetters; makeEntityItemStatusGetters(getThisPointer(), statusGetters); // note: we don't care if the model fails to add items, we always added our meta item and therefore we return // true so that the system knows our meta item is in the scene! _model->addToScene(scene, pendingChanges, statusGetters, _showCollisionHull); } return true; }
void RenderableParticleEffectEntityItem::removeFromScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges) { pendingChanges.removeItem(_renderItemId); _scene = nullptr; };
void Overlay::removeFromScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) { pendingChanges.removeItem(_renderItemID); render::Item::clearID(_renderItemID); }
bool Overlay::addToScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) { _renderItemID = scene->allocateID(); pendingChanges.resetItem(_renderItemID, std::make_shared<Overlay::Payload>(overlay)); return true; }