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)
 
IntPtr getHandle ()
 
void Dispose ()
 Explicitly releases references to unmanaged resources. More...
 
bool GetValid ()
 Returns whether the current tracking pose is valid (the tracking was successful). More...
 
bool GetModelViewMatrix (float[] matrix)
 Returns the current camera pose as model-view matrix. More...
 
bool GetT (float[] t)
 Returns the translation $t$ 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 GetR (float[] q)
 Returns the rotation $R$ from the world coordinate system to the camera coordinate system. More...
 
bool SetR (float[] q)
 Sets the rotation $R$ from the world coordinate system to the camera coordinate system. More...
 
bool GetCamPosWorld (float[] pos)
 Returns the position $P_{cam}$ of the camera in world coordinates. More...
 
bool SetCamPosWorld (float[] pos)
 Sets the position $P_{cam}$ of the camera in world coordinates. More...
 
bool SetFromCamera (Camera camera)
 

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() [1/2]

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.

◆ VLExtrinsicDataWrapper() [2/2]

VLExtrinsicDataWrapper.VLExtrinsicDataWrapper ( Quaternion  q,
Vector3  t 
)
inline

Member Function Documentation

◆ 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.

◆ getHandle()

IntPtr VLExtrinsicDataWrapper.getHandle ( )
inline

◆ GetModelViewMatrix()

bool VLExtrinsicDataWrapper.GetModelViewMatrix ( float []  matrix)
inline

Returns the current camera pose as model-view matrix.

The returned matrix assumes a right-handed coordinate system and is stored in the following order (column-major order):

\[ \begin{bmatrix} 0 & 4 & 8 & 12\\ 1 & 5 & 9 & 13\\ 2 & 6 & 10 & 14\\ 3 & 7 & 11 & 15\\ \end{bmatrix} \]

Returns
true, if the model view matrix was gotten successfully; false otherwise.
Parameters
matrixFloat array with 16 elements for storing the model-view matrix.

◆ 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.

◆ SetFromCamera()

bool VLExtrinsicDataWrapper.SetFromCamera ( Camera  camera)
inline

◆ 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.