Skip to content
This repository
Browse code

psmove_fusion.h: Add Doxygen documentation

  • Loading branch information...
commit 17c228316c570fce4918b5bd9b12306313f0a3fc 1 parent 84e7157
Thomas Perl authored

Showing 1 changed file with 63 additions and 1 deletion. Show diff stats Hide diff stats

  1. 64  include/psmove_fusion.h
64  include/psmove_fusion.h
@@ -46,22 +46,84 @@ extern "C" {
46 46
 
47 47
 #ifndef SWIG
48 48
 struct _PSMoveFusion;
49  
-typedef struct _PSMoveFusion PSMoveFusion;
  49
+typedef struct _PSMoveFusion PSMoveFusion; /*!< Handle to a PS Move Fusion object.
  50
+                                                Obtained via psmove_fusion_new() */
50 51
 #endif
51 52
 
  53
+/**
  54
+ * \brief Create a new PS Move Fusion object
  55
+ *
  56
+ * Creates and returns a new \ref PSMoveFusion object.
  57
+ *
  58
+ * \param tracker The \ref PSMoveTracker instance from which position
  59
+ *                information should be obtained
  60
+ * \param z_near The Z coordinate of the near clipping plane
  61
+ * \param z_far The Z coordinate of the far clipping plane
  62
+ *
  63
+ * \return A new \ref PSMoveFusion handle or \c NULL on error
  64
+ **/
52 65
 ADDAPI PSMoveFusion *
53 66
 ADDCALL psmove_fusion_new(PSMoveTracker *tracker, float z_near, float z_far);
54 67
 
  68
+/**
  69
+ * \brief Get a pointer to the 4x4 projection matrix
  70
+ *
  71
+ * This function returns the OpenGL projection matrix for the camera
  72
+ * used. Usually the return value can be loaded directly into the
  73
+ * GL_PROJECTION matrix of the user application using glLoadMatrix().
  74
+ *
  75
+ * \param fusion A valid \ref PSMoveFusion handle
  76
+ *
  77
+ * \return A pointer to a 16-item (4x4) float array representing
  78
+ *         the current projection matrix. The return value is only
  79
+ *         valid as long as the \ref PSMoveFusion object exists, the
  80
+ *         caller MUST NOT free() the return value.
  81
+ **/
55 82
 ADDAPI float *
56 83
 ADDCALL psmove_fusion_get_projection_matrix(PSMoveFusion *fusion);
57 84
 
  85
+/**
  86
+ * \brief Get a pointer to the 4x4 model-view matrix for a controller
  87
+ *
  88
+ * This function returns the OpenGL model-view matrix for one motion
  89
+ * controller. The coordinate system origin is at the center of the
  90
+ * sphere, aligned with the controller. The returned matrix therefore
  91
+ * describes both the position and orientation of the controller in 3D
  92
+ * space. Usually the return value can be loaded directly into the
  93
+ * GL_MODELVIEW matrix of the user application using glLoadMatrix().
  94
+ *
  95
+ * \param fusion A valid \ref PSMoveFusion handle
  96
+ * \param move A valid \ref PSMove handle
  97
+ *
  98
+ * \return A pointer to a 16-item (4x4) float array representing
  99
+ *         the modelview matrix for the controller. The return value
  100
+ *         is only valid as long as the \ref PSMoveFusion object
  101
+ *         exists, the caller MUST NOT free() the return value.
  102
+ **/
58 103
 ADDAPI float *
59 104
 ADDCALL psmove_fusion_get_modelview_matrix(PSMoveFusion *fusion, PSMove *move);
60 105
 
  106
+/**
  107
+ * \brief Get the 3D position of a controller
  108
+ *
  109
+ * This function returns the 3D position (relative to the camera)
  110
+ * of the motion controller, based on the current projection matrix.
  111
+ *
  112
+ * \param fusion A valid \ref PSMoveFusion handle
  113
+ * \param move A valid \ref PSMove handle
  114
+ * \param x A pointer to store the X part of the position vector
  115
+ * \param y A pointer to store the Y part of the position vector
  116
+ * \param z A pointer to store the Z part of the position vector
  117
+ **/
61 118
 ADDAPI void
62 119
 ADDCALL psmove_fusion_get_position(PSMoveFusion *fusion, PSMove *move,
63 120
         float *x, float *y, float *z);
64 121
 
  122
+/**
  123
+ * \brief Destroy an existing fusion instance and free allocated resources
  124
+ *
  125
+ * \param fusion A valid \ref PSMoveFusion handle
  126
+ **/
65 127
 ADDAPI void
66 128
 ADDCALL psmove_fusion_free(PSMoveFusion *fusion);
67 129
 

0 notes on commit 17c2283

Please sign in to comment.
Something went wrong with that request. Please try again.