summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-12-03 12:04:16 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-12-03 12:04:16 -0800
commit1eb98bdd3407b8f74674e125ca928f95957b0294 (patch)
tree14ca7879c8b0df761d96e4241eecc245d86681e2 /include
parent89feae7c12dd703804c93f784f9bd7e39fcc7f60 (diff)
Add missing implementations of C++ wrapper functions
Diffstat (limited to 'include')
-rw-r--r--include/glu3.h50
1 files changed, 46 insertions, 4 deletions
diff --git a/include/glu3.h b/include/glu3.h
index f67c554..b735ba8 100644
--- a/include/glu3.h
+++ b/include/glu3.h
@@ -653,7 +653,13 @@ GLfloat gluDot2(const GLUvec4 &, const GLUvec4 &);
*
* \sa gluCross4v
*/
-GLUvec4 gluCross(const GLUvec4 &, const GLUvec4 &);
+inline GLUvec4 gluCross(const GLUvec4 &u, const GLUvec4 &v)
+{
+ GLUvec4 t;
+
+ gluCross4v(& t, & u, & v);
+ return t;
+}
/**
* Normalize a vec4
@@ -662,7 +668,13 @@ GLUvec4 gluCross(const GLUvec4 &, const GLUvec4 &);
*
* \sa gluNormalize4v
*/
-GLUvec4 gluNormalize(const GLUvec4 &);
+inline GLUvec4 gluNormalize(const GLUvec4 &v)
+{
+ GLUvec4 t;
+
+ gluNormalize4v(& t, & v);
+ return t;
+}
/**
* Calculate the length of a vec4
@@ -671,7 +683,10 @@ GLUvec4 gluNormalize(const GLUvec4 &);
*
* \sa gluLength4v
*/
-GLfloat gluLength(const GLUvec4 &);
+inline GLfloat gluLength(const GLUvec4 &u)
+{
+ return gluLength4v(& u);
+}
/**
* Calculate the squared length of a vec4
@@ -680,7 +695,10 @@ GLfloat gluLength(const GLUvec4 &);
*
* \sa gluLengthSqr4v
*/
-GLfloat gluLengthSqr(const GLUvec4 &);
+inline GLfloat gluLengthSqr(const GLUvec4 &u)
+{
+ return gluLengthSqr4v(& u);
+}
/**
* Calculate a scaling transformation matrix from a vector
@@ -705,6 +723,30 @@ inline GLUmat4 gluScale(const GLUvec4 &u)
return result;
}
+/**
+ * Calculate a scaling transformation matrix from a vector
+ *
+ * A scaling transformation matrix is created using the x, y, and z
+ * components of \c u. Specifically, the matrix generated is:
+ *
+ * \f$\left( \begin{tabular}{cccc}
+ * $x$ & $0$ & $0$ & $0$ \\
+ * $0$ & $y$ & $0$ & $0$ \\
+ * $0$ & $0$ & $z$ & $0$ \\
+ * $0$ & $0$ & $0$ & $1$ \\
+ * \end{tabular} \right)\f$
+ *
+ * \sa gluScale4v
+ */
+inline GLUmat4 gluScale(GLfloat x, GLfloat y, GLfloat z)
+{
+ GLUvec4 u(x, y, z, 1.0);
+ GLUmat4 result;
+
+ gluScale4v(& result, & u);
+ return result;
+}
+
/** \name Translation matrix
*/
/*@{*/