Receives location provider events and when position tracking is enabled, will animate the camera to that location.
More...
Receives location provider events and when position tracking is enabled, will animate the camera to that location.
Must be registered with VgMyLocationManager before it will receive location notification.
Flags used to determine the behavior of the tracking camera.
Enumerator |
---|
ePositionTrackerPosition |
The camera tracks the location's position.
To determine where the position appears on the screen see VgMyPositionTracker::setPositionOnMap()
|
ePositionTrackerHeading |
The camera tracks the location's heading.
|
ePositionTrackerAltitude |
The camera is set to a specified altitude.
To determine the altitude see VgMyPositionTracker::setAltitude
|
ePositionTrackerPitch |
The camera is set to a specified pitch.
To determine the altitude see VgMyPositionTracker::setPitch IMPORTANT: This feature will not function correctly when used in conjunction with global view.
|
VgMyPositionTracker::VgMyPositionTracker |
( |
VgApplication::VgIApplication * |
pVgApplication, |
|
|
VgMyLayerAndCameraHandler * |
pLayerAndCameraHandler, |
|
|
int |
pTrackerFlags |
|
) |
| |
Constructor.
- Parameters
-
pVgApplication | VgIApplication to use. Can't be NULL |
pLayerAndCameraHandler | The interface which allows this class to manipulate the camera. |
pTrackerFlags | Determines how the camera should behave when a new location is received. |
VgMyPositionTracker::~VgMyPositionTracker |
( |
| ) |
|
Add a listener to this position tracker.
- Parameters
-
pPositionTrackerListener | The position tracker listener to add. Currently, only one listener supported. If there is already a position tracking listener, this will override an existing one. |
void VgMyPositionTracker::disable |
( |
| ) |
|
Disable the Position Tracker.
void VgMyPositionTracker::enable |
( |
| ) |
|
Enable the Position Tracker.
double VgMyPositionTracker::getAltitude |
( |
| ) |
|
- Returns
- Retrieves the camera's altitude used when tracking.
double VgMyPositionTracker::getPitch |
( |
| ) |
|
- Returns
- Retrieves the camera's pitch used when tracking.
bool VgMyPositionTracker::isEnabled |
( |
| ) |
|
- Returns
- The current enabled/disabled state of the position tracker.
void VgMyPositionTracker::notifyAccuracyDidChange |
( |
const std::string & |
pProvider, |
|
|
double |
pAccuracy |
|
) |
| |
|
virtual |
Called when the accuracy has changed.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
pAccuracy | The new accuracy |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyContextDidChange |
( |
const std::string & |
pProvider, |
|
|
int |
pContext |
|
) |
| |
|
virtual |
Called when the context has changed.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
pContext | The new context |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyFloorDidChange |
( |
const std::string & |
pProvider, |
|
|
const std::string & |
pFloor |
|
) |
| |
|
virtual |
Called when the floor has changed.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
pFloor | The new floor |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyHeadingDidChange |
( |
const std::string & |
pProvider, |
|
|
double |
pHeading |
|
) |
| |
|
virtual |
Called when the heading has changed.
Heading is the horizontal direction of travel of this device, and is not related to the device orientation.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
pHeading | The new heading. The valid range for the heading is [0.0, 360.0]. Where 0.0 is North, and increasing values starts towards the East. |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyLocationProviderDisabled |
( |
const std::string & |
pProvider | ) |
|
|
virtual |
Called when the provider is disabled.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyLocationProviderEnabled |
( |
const std::string & |
pProvider | ) |
|
|
virtual |
Called when the provider is enabled.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyPositionDidChange |
( |
const std::string & |
pProvider, |
|
|
const VgEngine::VgPosition & |
pPosition |
|
) |
| |
|
virtual |
Called when the location has changed.
- Parameters
-
pProvider | The location provider responsible for sending the notification |
pPosition | The new position |
Implements VgMyLocationListener.
void VgMyPositionTracker::notifyStatusDidChange |
( |
const std::string & |
pProvider, |
|
|
int |
pStatus |
|
) |
| |
|
virtual |
Called when the status has changed.
- Parameters
-
pProvider | The location provider responsible for sending the notification. |
pStatus | The new status. See for available values. |
Implements VgMyLocationListener.
Remove a listener to this position tracker.
- Parameters
-
pPositionTrackerListener | The position tracker listener to remove. |
void VgMyPositionTracker::setAltitude |
( |
double |
pAltitude | ) |
|
Sets the camera's altitude that's used when tracking.
This value is only used if the ePositionTrackerAltitude flag is active.
- Parameters
-
pAltitude | The altitude to set. If pAltitude falls outside of the manipulator limits, then the limit value will be used. |
void VgMyPositionTracker::setPitch |
( |
double |
pPitch | ) |
|
Sets the camera's pitch that's used when tracking.
This value is only used if the ePositionTrackerPitch flag is active. pPitch The pitch value to use when tracking a position. Accepted values are [0.0 to -90.0].
void VgMyPositionTracker::setPositionOnMap |
( |
const double |
pX, |
|
|
const double |
pY |
|
) |
| |
Sets the screen location where the current position will appear.
These values are only used when the ePositionTrackerPosition flag is active.
- Parameters
-
pX | the normalized X screen coordinate (0 is on the left of the screen, 1 on the right). |
pY | the normalized Y screen coordinate (0 is on the bottom of the screen, 1 on the top). |
double VgMyPositionTracker::mAltitude |
|
protected |
The altitude to use when in tracking mode.
double VgMyPositionTracker::mCurrentHeading |
|
protected |
std::string VgMyPositionTracker::mCurrentLayer |
|
protected |
VgEngine::VgPosition VgMyPositionTracker::mCurrentPosition |
|
protected |
bool VgMyPositionTracker::mIsEnabled |
|
protected |
double VgMyPositionTracker::mOriginalPitch |
|
protected |
The camera's original pitch is recorded in order so that it can be reset when tracking is disabled.
double VgMyPositionTracker::mPitch |
|
protected |
The pitch to use when in tracking mode.
VgEngine::VgPosition VgMyPositionTracker::mPreviousPosition |
|
protected |
int VgMyPositionTracker::mTrackerFlags |
|
protected |
VgApplication::VgIApplication* VgMyPositionTracker::mVgApplication |
|
protected |
double VgMyPositionTracker::mXPositionOnMap |
|
protected |
double VgMyPositionTracker::mYPositionOnMap |
|
protected |
The documentation for this class was generated from the following file: