Renderer for a collection of PinView objects. More...
#include <PinViewRenderer.h>
Public Member Functions | |
PinViewRenderer (const Rendering::EnvironmentFlatteningService &environmentFlatteningService, Eegeo::Rendering::RenderableFilters &renderableFilters, const Eegeo::Rendering::ITexturePageLayout &texturePageLayout, Rendering::Renderables::BatchedSpriteRenderable *pRenderable, Rendering::Materials::BatchedSpriteMaterial *pMaterial, Rendering::Shaders::BatchedSpriteShader *pShader, const Eegeo::Rendering::ScreenProperties &screenProperties, const bool useLegacyScaling) | |
void | AddView (PinView &viewToAdd) |
void | RemoveView (PinView &viewToRemove) |
void | Update (const Camera::RenderCamera &renderCamera) |
void | UpdateScreenProperties (const Eegeo::Rendering::ScreenProperties &screenProperties) |
bool | TryGetViewsIntersectingScreenPoint (const v2 &screenPoint, std::vector< PinView * > &outIntersectingViews) const |
void | EnqueueRenderables (const Rendering::RenderContext &renderContext, Rendering::RenderQueue &renderQueue) |
Static Public Member Functions | |
static PinViewRenderer * | Create (const Rendering::EnvironmentFlatteningService &environmentFlatteningService, Eegeo::Rendering::RenderableFilters &renderableFilters, Rendering::Shaders::ShaderIdGenerator &shaderIdGenerator, Rendering::Materials::MaterialIdGenerator &materialIdGenerator, Eegeo::Rendering::VertexLayouts::VertexLayoutPool &vertexLayoutPool, Eegeo::Rendering::VertexLayouts::VertexBindingPool &vertexBindingPool, Eegeo::Rendering::GlBufferPool &glBufferPool, const Eegeo::Rendering::ITexturePageLayout &texturePageLayout, const Eegeo::Rendering::TTextureId textureId, const Eegeo::Rendering::LayerIds::Values layerId, const Rendering::ScreenProperties &screenProperties, const bool useLegacyScaling) |
Renderer for a collection of PinView objects.
This class deals with the on-screen representation of a collection of PinView objects.
Eegeo::Pins::PinViewRenderer::PinViewRenderer | ( | const Rendering::EnvironmentFlatteningService & | environmentFlatteningService, |
Eegeo::Rendering::RenderableFilters & | renderableFilters, | ||
const Eegeo::Rendering::ITexturePageLayout & | texturePageLayout, | ||
Rendering::Renderables::BatchedSpriteRenderable * | pRenderable, | ||
Rendering::Materials::BatchedSpriteMaterial * | pMaterial, | ||
Rendering::Shaders::BatchedSpriteShader * | pShader, | ||
const Eegeo::Rendering::ScreenProperties & | screenProperties, | ||
const bool | useLegacyScaling | ||
) |
Create an empty PinViewRenderer object.
renderableFilters | the renderable filters to which the pins will be registered |
texturePageLayout | an ITexturePageLayout instance which will be used to map category ids to texture uvs |
pRenderable | pointer to a renderable that will be used to render sprites. Deleted when class is destroyed. |
pMaterial | pointer to a material that will be used to render sprites. Deleted when class is destroyed. |
pShader | pointer to a shader that will be used to render sprites. Deleted when class is destroyed. |
screenProperties | The ScreenProperties defining screen size and density |
useLegacyScaling | Legacy scaling sizes pins based on a fixed value rather than screen size & density. |
void Eegeo::Pins::PinViewRenderer::AddView | ( | PinView & | viewToAdd | ) |
Add a PinView to the PinViewRenderer.
viewToAdd | The view to add to the renderer. |
|
static |
Factory method for creating an empty PinViewRenderer object.
renderableFilters | the renderable filters to which the pins will be registered |
texturePageLayout | an ITexturePageLayout instance which will be used to map category ids to texture uvs |
textureId | the TextureId associated with the pins texture to be used for rendering pins |
layerId | the layer to which the pins will be rendered |
screenProperties | The ScreenProperties defining screen size and density |
useLegacyScaling | Legacy scaling sizes pins based on a fixed value rather than screen size & density. |
|
virtual |
Enque the renderables for the views to be rendered.
renderContext | the current render context. |
renderQueue | the render queue to which renderables will be enqueued. |
Implements Eegeo::Rendering::IRenderableFilter.
void Eegeo::Pins::PinViewRenderer::RemoveView | ( | PinView & | viewToRemove | ) |
Remove a PinView to the PinViewRenderer.
viewToRemove | The view to remove from the renderer. |
bool Eegeo::Pins::PinViewRenderer::TryGetViewsIntersectingScreenPoint | ( | const v2 & | screenPoint, |
std::vector< PinView * > & | outIntersectingViews | ||
) | const |
Test the PinViews in the renderer for intersection with a given screen point.
screenPoint | The screen point (in screen pixel coordinates) to test for intersection with the PinViews. |
outIntersectingViews | A vector to be populated, in order of increasing distance from the camera, with the PinViews which intersect screenPoint. |
void Eegeo::Pins::PinViewRenderer::Update | ( | const Camera::RenderCamera & | renderCamera | ) |
Update the model-view-projections, bounds and on-screen visibility for the PinViews in the renderer.
void Eegeo::Pins::PinViewRenderer::UpdateScreenProperties | ( | const Eegeo::Rendering::ScreenProperties & | screenProperties | ) |
Update the screen properties of the renderer so it draws pins at the correct size