10 #ifndef EIGEN_GPUHELPER_H 11 #define EIGEN_GPUHELPER_H 13 #include <Eigen/Geometry> 17 using namespace Eigen;
31 void popProjectionMode2D();
40 template<
typename Scalar,
int _Flags>
50 template<
typename Scalar,
int _Flags>
53 template<
typename Scalar,
typename Derived>
63 inline void forceMatrixTarget(GLenum matrixTarget) {glMatrixMode(mCurrentMatrixTarget=matrixTarget);}
65 inline void setMatrixTarget(GLenum matrixTarget);
69 template<
typename Scalar,
int _Flags>
72 template<
typename Scalar,
typename Derived>
79 inline void pushMatrix(GLenum matrixTarget);
83 inline void popMatrix(GLenum matrixTarget);
85 void drawVector(
const Vector3f&
position,
const Vector3f& vec,
const Color& color,
float aspect = 50.);
86 void drawVectorBox(
const Vector3f& position,
const Vector3f& vec,
const Color& color,
float aspect = 50.);
87 void drawUnitCube(
void);
88 void drawUnitSphere(
int level=0);
91 inline void draw(GLenum mode, uint nofElement);
94 inline void draw(GLenum mode, uint start, uint
end);
97 inline void draw(GLenum mode,
const std::vector<uint>* pIndexes);
136 if (matrixTarget != mCurrentMatrixTarget)
137 glMatrixMode(mCurrentMatrixTarget=matrixTarget);
140 template<
typename Scalar,
int _Flags>
143 setMatrixTarget(matrixTarget);
147 template<
typename Scalar,
typename Derived>
152 setMatrixTarget(matrixTarget);
156 template<
typename Scalar,
int _Flags>
159 setMatrixTarget(matrixTarget);
165 setMatrixTarget(matrixTarget);
169 template<
typename Scalar,
int _Flags>
172 pushMatrix(matrixTarget);
176 template<
typename Scalar,
typename Derived>
181 pushMatrix(matrixTarget);
187 setMatrixTarget(matrixTarget);
193 glDrawArrays(mode, 0, nofElement);
199 glDrawElements(mode, pIndexes->size(), GL_UNSIGNED_INT, &(pIndexes->front()));
204 glDrawArrays(mode, start, end-start);
207 #endif // EIGEN_GPUHELPER_H void draw(GLenum mode, uint nofElement)
draw the nofElement first elements
Generic expression of a matrix where all coefficients are defined by a functor.
GLenum mCurrentMatrixTarget
void forceMatrixTarget(GLenum matrixTarget)
static void multMatrix(const Matrix< double, 4, 4, _Flags, 4, 4 > &mat)
static void multMatrix(const Matrix< double, 4, 4, _Flags, 4, 4 > &mat)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
static void loadMatrix(const Matrix< float, 4, 4, _Flags, 4, 4 > &mat)
Namespace containing all symbols from the Eigen library.
void popMatrix(GLenum matrixTarget)
void pushMatrix(const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
static void loadMatrix(const Matrix< float, 4, 4, _Flags, 4, 4 > &mat)
static void multMatrix(const Matrix< float, 4, 4, _Flags, 4, 4 > &mat)
void loadMatrix(const Eigen::Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
static void multMatrix(const Matrix< float, 4, 4, _Flags, 4, 4 > &mat)
static void loadMatrix(const Matrix< double, 4, 4, _Flags, 4, 4 > &mat)
static void loadMatrix(const Matrix< double, 4, 4, _Flags, 4, 4 > &mat)
void setMatrixTarget(GLenum matrixTarget)
The matrix class, also used for vectors and row-vectors.
void multMatrix(const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
Point3 position(const NavState &X, OptionalJacobian< 3, 9 > H)