All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Eegeo::Pins::PinView Class Reference

A view object representing a Pin in the world as 2.5D billboard sprite. More...

#include <PinView.h>

Inheritance diagram for Eegeo::Pins::PinView:
Eegeo::NonCopyable

Public Member Functions

 PinView (Pin &pin, const Eegeo::Geometry::Bounds3D &modelVertexBounds)
 
 ~PinView ()
 
PinGetPin () const
 
void SetScale (float value)
 
float GetScale () const
 
void SetDimensions (const v2 &value)
 
v2 GetDimensions () const
 
void SetEcefOrigin (const dv3 &ecefOrigin)
 
const dv3GetEcefOrigin () const
 
float GetHeightAboveTerrain () const
 
void SetModelViewProjection (const m44 &modelViewProjection)
 
const m44GetModelViewProjection () const
 
void UpdateBounds (int screenWidth, int screenHeight)
 
const Geometry::Bounds3DGetViewSpaceBounds () const
 
const Geometry::Bounds2DGetScreenSpaceBounds () const
 
void SetTransform (const m44 &transform)
 
void SetTransformOrigin (const dv3 &ecefOrigin)
 
const m44GetTransform () const
 
const dv3GetTransformOrigin () const
 
void SetColor (const v4 &color)
 
const v4GetColor () const
 

Additional Inherited Members

- Protected Member Functions inherited from Eegeo::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 

Detailed Description

A view object representing a Pin in the world as 2.5D billboard sprite.

This class deals with the concerns of displaying a Pin in the 3D scene as a 2.5D billboard sprite.

Constructor & Destructor Documentation

Eegeo::Pins::PinView::PinView ( Pin pin,
const Eegeo::Geometry::Bounds3D modelVertexBounds 
)

Create a new PinView with a given sprite.

Parameters
pinThe Pin model that the view represents.
modelVertexBoundsthe bounds of the pin in model space (this should typically be a bounds with x, y size, but with the z component set to 0)
Eegeo::Pins::PinView::~PinView ( )

Delete a PinView and its underlying sprite.

Member Function Documentation

const v4 & Eegeo::Pins::PinView::GetColor ( ) const

Get the color tint of the PinView. The X,Y,Z, and W components refer to Red, Green, Blue and Alpha values between 0 and 1.

Returns
The color vector applied to the Pin.
v2 Eegeo::Pins::PinView::GetDimensions ( ) const

Get the world space dimensions for the sprite

Returns
The dimensions in metres (x component = width, y component = height)
const dv3 & Eegeo::Pins::PinView::GetEcefOrigin ( ) const

Retrieve the position of the PinView.

Returns
The world position at which the PinView's sprite will be rendered.
float Eegeo::Pins::PinView::GetHeightAboveTerrain ( ) const

Retrieve the height of the PinView above the terrrain in metres.

Returns
The height of the PinView above the terrain in metres.
const m44 & Eegeo::Pins::PinView::GetModelViewProjection ( ) const

Retrieve the model-view-projection matrix to be used for positioning and orienting the PinView's sprite.

Returns
The model-view-projection matrix being used to render the PinView's sprite.
Pin & Eegeo::Pins::PinView::GetPin ( ) const

Retrieve the Pin model that the view represents.

Returns
The view's Pin model.
float Eegeo::Pins::PinView::GetScale ( ) const

Retrieve the uniform scale for the view.

Returns
The uniform scale value for the view.
const Geometry::Bounds2D & Eegeo::Pins::PinView::GetScreenSpaceBounds ( ) const

Retrieve the 2D bounds of the PinView in Screen space. This method returns the last set of bounds that were calculated by a call to UpdateBounds().

Returns
The bounds of the PinView in screen pixels.
const m44 & Eegeo::Pins::PinView::GetTransform ( ) const

Get the transform matrix for the Pin.

Returns
the transform matrix multiplied against the Pin's final position.
const dv3 & Eegeo::Pins::PinView::GetTransformOrigin ( ) const

Get the origin point to apply the Pin Transform in ECEF.

Returns
the ECEF origin the transform is applied at.
const Geometry::Bounds3D & Eegeo::Pins::PinView::GetViewSpaceBounds ( ) const

Retrieve the 3D bounds of the PinView in View space. This method returns the last set of bounds that were calculated by a call to UpdateBounds().

Returns
The bounds of the PinView in normalized device coordinates.
void Eegeo::Pins::PinView::SetColor ( const v4 color)

Set the color tint of the PinView. The X,Y,Z, and W components will refer to Red, Green, Blue and Alpha values between 0 and 1.

Parameters
Thecolor vector to apply to the Pin.
void Eegeo::Pins::PinView::SetDimensions ( const v2 value)

Set the world space dimensions for the sprite

Parameters
valuethe dimensions in metres (x component = width, y component = height)
void Eegeo::Pins::PinView::SetEcefOrigin ( const dv3 ecefOrigin)

Set the position of the PinView within the world.

Parameters
ecefOriginThe world position at which the PinView's sprite will be rendered.
void Eegeo::Pins::PinView::SetModelViewProjection ( const m44 modelViewProjection)

Set the model-view-projection matrix that will be used to position and orient the PinView's sprite.

Parameters
modelViewProjectionThe model-view-projection matrix to set.
void Eegeo::Pins::PinView::SetScale ( float  value)

Set the uniform scale for the view.

Parameters
valueThe uniform scale value for the view.
void Eegeo::Pins::PinView::SetTransform ( const m44 transform)

Set a transform matrix for the Pin. This transforms the final pin position in relation to the Pin Transform Origin.

Parameters
thetransform matrix to multiply against the Pin's position.
void Eegeo::Pins::PinView::SetTransformOrigin ( const dv3 ecefOrigin)

Set the origin point to apply the Pin Transform in ECEF.

Parameters
theECEF origin the transform will be applied at.
void Eegeo::Pins::PinView::UpdateBounds ( int  screenWidth,
int  screenHeight 
)

Update the bounds for the PinView based on it's current model-view-projection matrix.

Parameters
screenWidthThe width of the screen in pixels.
screenHeightThe height of the screen in pixels.

The documentation for this class was generated from the following files: