documentation

VLInitCameraBehaviour Class Reference

Camera used to define the initial pose. More...

Inherits VLWorkerReferenceBehaviour.

Public Member Functions

void Reset ()
 Restores the original transformation of the InitCamera. More...
 
string GetInitPoseAsString ()
 Get the init pose values which are calculated using the init camera set in the VLInitCameraBehaviour. More...
 

Data Fields

Camera initCamera
 Reference to the Camera behaviour. More...
 
int backgroundLayer = 8
 Layer with the camera image background. More...
 
bool useLastValidPose
 Use the last valid camera pose as initialization pose. More...
 
bool overwriteOnLoad
 Overwrite init camera transformation with values from tracking configuration on tracking start. More...
 

Additional Inherited Members

- Protected Member Functions inherited from VLWorkerReferenceBehaviour
bool InitWorkerReference ()
 Initializes the workerBehaviour and worker member variables. More...
 
- Protected Attributes inherited from VLWorkerReferenceBehaviour
VLWorkerBehaviour workerBehaviour
 Reference to used VLWorkerBehaviour. More...
 
VLWorker worker
 

Detailed Description

Camera used to define the initial pose.

It's possible to change the camera position and orientation at runtime. The new initial pose will then be used while the tracking is lost.

If there is no VLInitCameraBehaviour in the scene or the VLInitCameraBehaviour is disabled, then the initial pose from the tracking configuration file will be used.

Please make sure, that there is only one active VLInitCameraBehaviour in the scene. Otherwise both behaviours will try to set the initial pose, which will lead to unexpected behaviour.

Right now this behaviour does not work with the HoloLens model-based tracking. In that case please use the VLHoloLensInitCameraBehaviour or VLHoloLensInitCamera prefab instead.

Member Function Documentation

◆ GetInitPoseAsString()

string VLInitCameraBehaviour.GetInitPoseAsString ( )
inline

Get the init pose values which are calculated using the init camera set in the VLInitCameraBehaviour.

This way the init pose can be re-used e.g. in the tracking configuration.

Returns
Init pose values as string in json format

◆ Reset()

void VLInitCameraBehaviour.Reset ( )
inline

Restores the original transformation of the InitCamera.

This might be useful if the InitCamera was transformed in some awkward way for some reason (e.g. because useLastValidPose is set to true and the tracking failed) and we quickly want to restore the original state.

If overwriteOnLoad is set to false, then this will restore the transformation during the initialization of the VLInitCameraBehaviour. If overwriteOnLoad is set to true, then this will restore the transformation from the tracking configuration.

Field Documentation

◆ backgroundLayer

int VLInitCameraBehaviour.backgroundLayer = 8

Layer with the camera image background.

This layer will not be rendered.

◆ initCamera

Camera VLInitCameraBehaviour.initCamera

Reference to the Camera behaviour.

If this is not defined, then the Camera component attached to the current GameObject will be used automatically.

◆ overwriteOnLoad

bool VLInitCameraBehaviour.overwriteOnLoad

Overwrite init camera transformation with values from tracking configuration on tracking start.

The InitCamera can then be transformed afterwards, but will get overwritten again after loading a new tracking configuration.

◆ useLastValidPose

bool VLInitCameraBehaviour.useLastValidPose

Use the last valid camera pose as initialization pose.

Since this might results in an awkward InitCamera transformation, it's recommended to give the user the option to restore the original pose using the Reset function.