documentation

VLExtrinsicDataWrapper Class Reference

The VLExtrinsicDataWrapper is a wrapper for an ExtrinsicData object. ExtrinsicData objects represent the extrinsic camera parameters (position and orientation). More...

Inherits IDisposable.

Public Member Functions

 VLExtrinsicDataWrapper (IntPtr handle, bool owner)
 Constructor of VLExtrinsicDataWrapper. More...
 
 VLExtrinsicDataWrapper (Quaternion q, Vector3 t)
 
VLExtrinsicDataWrapper Clone ()
 Creates a copy of this object and returns a Wrapper of it. More...
 
void Dispose ()
 Explicitly releases references to unmanaged resources. More...
 
bool GetCamPosWorld (float[] pos)
 Returns the position $P_{cam}$ of the camera in world coordinates. More...
 
IntPtr getHandle ()
 
Matrix4x4 GetModelViewMatrix ()
 Returns the current camera pose as model-view matrix. More...
 
bool GetR (float[] q)
 Returns the rotation $R$ from the world coordinate system to the camera coordinate system. More...
 
bool GetT (float[] t)
 Returns the translation $t$ from the world coordinate system to the camera coordinate system. More...
 
bool GetValid ()
 Returns whether the current tracking pose is valid (the tracking was successful). More...
 
bool SetCamPosWorld (float[] pos)
 Sets the position $P_{cam}$ of the camera in world coordinates. More...
 
bool SetFromCamera (Camera camera)
 
bool SetR (float[] q)
 Sets the rotation $R$ from the world coordinate system to the camera coordinate system. More...
 
bool SetT (float[] t)
 Sets the translation $t$ from the world coordinate system to the camera coordinate system. More...
 
bool SetValid (bool value)
 

Detailed Description

The VLExtrinsicDataWrapper is a wrapper for an ExtrinsicData object. ExtrinsicData objects represent the extrinsic camera parameters (position and orientation).

See also
VLDataSetWrapper.GetExtrinsicData

Constructor & Destructor Documentation

◆ VLExtrinsicDataWrapper()

VLExtrinsicDataWrapper.VLExtrinsicDataWrapper ( IntPtr  handle,
bool  owner 
)
inline

Constructor of VLExtrinsicDataWrapper.

Don't call this constructor directly. Use the VLAbstractApplicationWrapper.GetDataSet and VLDataSetWrapper.GetIntrinsicData methods instead.

Parameters
handleHandle to the native object.
ownertrue, if the VLExtrinsicDataWrapper is the owner of the native object; false, otherwise.

Member Function Documentation

◆ Clone()

VLExtrinsicDataWrapper VLExtrinsicDataWrapper.Clone ( )
inline

Creates a copy of this object and returns a Wrapper of it.

Returns
A wrapper of a copy of this object.

◆ Dispose()

void VLExtrinsicDataWrapper.Dispose ( )
inline

Explicitly releases references to unmanaged resources.

Call Dispose when you are finished using the VLExtrinsicDataWrapper. The Dispose method leaves the VLExtrinsicDataWrapper in an unusable state. After calling Dispose, you must release all references to the VLExtrinsicDataWrapper so the garbage collector can reclaim the memory that the VLExtrinsicDataWrapper was occupying.

◆ GetCamPosWorld()

bool VLExtrinsicDataWrapper.GetCamPosWorld ( float []  pos)
inline

Returns the position $P_{cam}$ of the camera in world coordinates.

Internally the position $P_{cam}$ will be computed from the transformation $(R,t)$ which transforms a 3D point from world coordinates into camera coordinates ( $P_{cam} = -R^{-1}t$).

Returns
true, if the position was acquired successfully; false otherwise.
Parameters
posFloat array with 3 elements $(x,y,z)$ for storing the position.

◆ GetModelViewMatrix()

Matrix4x4 VLExtrinsicDataWrapper.GetModelViewMatrix ( )
inline

Returns the current camera pose as model-view matrix.

The returned matrix assumes a right-handed coordinate system. Throws an InvalidOperationExcception, if the ModelViewMatrix is invalid or can not be retrieved.

◆ GetR()

bool VLExtrinsicDataWrapper.GetR ( float []  q)
inline

Returns the rotation $R$ from the world coordinate system to the camera coordinate system.

Please notice, that $(R,t)$ represents the transformation of a 3D point $P_w$ from world coordinates into a 3D point $P_c$ in camera coordinates: $P_c = RP_w + t$.

Returns
true, if the rotation was acquired successfully; false otherwise.
Parameters
qFloat array with 4 elements $(x,y,z,w)$ for storing the rotation as quaternion.

◆ GetT()

bool VLExtrinsicDataWrapper.GetT ( float []  t)
inline

Returns the translation $t$ from the world coordinate system to the camera coordinate system.

Please notice, that $(R,t)$ represents the transformation of a 3D point $P_w$ from world coordinates into a 3D point $P_c$ in camera coordinates: $P_c = RP_w + t$.

Returns
true, if the translation was acquired successfully; false otherwise.
Parameters
tFloat array with 3 elements $(x,y,z)$ for storing the translation.

◆ GetValid()

bool VLExtrinsicDataWrapper.GetValid ( )
inline

Returns whether the current tracking pose is valid (the tracking was successful).

Returns
true, if the current tracking pose is valid; false otherwise.

◆ SetCamPosWorld()

bool VLExtrinsicDataWrapper.SetCamPosWorld ( float []  pos)
inline

Sets the position $P_{cam}$ of the camera in world coordinates.

Internally this will be stored as a transformation $(R,t)$ of a 3D point from world coordinates into camera coordinates ( $t = -RP_{cam}$).

Returns
true, if the position was acquired successfully; false otherwise.
Parameters
posFloat array with 3 elements $(x,y,z)$, which contains the position.

◆ SetR()

bool VLExtrinsicDataWrapper.SetR ( float []  q)
inline

Sets the rotation $R$ from the world coordinate system to the camera coordinate system.

Please notice, that $(R,t)$ represents the transformation of a 3D point $P_w$ from world coordinates into a 3D point $P_c$ in camera coordinates: $P_c = RP_w + t$.

Returns
true, if the rotation was set successfully; false otherwise.
Parameters
qFloat array with 4 elements $(x,y,z,w)$, which contains the rotation as quaternion.

◆ SetT()

bool VLExtrinsicDataWrapper.SetT ( float []  t)
inline

Sets the translation $t$ from the world coordinate system to the camera coordinate system.

Please notice, that $(R,t)$ represents the transformation of a 3D point $P_w$ from world coordinates into a 3D point $P_c$ in camera coordinates: $P_c = RP_w + t$.

Returns
true, if the translation was set successfully; false otherwise.
Parameters
tFloat array with 3 elements $(x,y,z)$, which contain the translation.