33 #ifndef DART_GUI_TRACKBALL_HPP_
34 #define DART_GUI_TRACKBALL_HPP_
37 #include <Eigen/Geometry>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
53 Trackball(
const Eigen::Vector2d& _center,
double _radius);
66 void draw(
int _winWidth,
int _winHeight);
69 void setTrackball(
const Eigen::Vector2d& _center,
const double _radius);
72 void setCenter(
const Eigen::Vector2d& _center);
94 Eigen::Vector3d
mouseOnSphere(
double _mouseX,
double _mouseY)
const;
99 const Eigen::Vector3d& _from,
const Eigen::Vector3d& _to)
const;
Definition: Trackball.hpp:44
Eigen::Vector3d mStartPos
Definition: Trackball.hpp:108
void updateBall(double _x, double _y)
Update the current rotation to rotate from mStartPos to the projection of (x,y) on trackball,...
Definition: Trackball.cpp:62
Eigen::Matrix3d getRotationMatrix() const
Definition: Trackball.cpp:137
double getRadius() const
Definition: Trackball.cpp:147
Eigen::Quaterniond getCurrQuat() const
Definition: Trackball.cpp:132
Eigen::Vector2d mCenter
Definition: Trackball.hpp:102
Eigen::Quaterniond mCurrQuat
Definition: Trackball.hpp:111
void setQuaternion(const Eigen::Quaterniond &_q)
Definition: Trackball.cpp:127
void draw(int _winWidth, int _winHeight)
Draw the trackball on screen.
Definition: Trackball.cpp:76
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Trackball()
Default constructor.
Definition: Trackball.cpp:41
Eigen::Quaterniond quatFromVectors(const Eigen::Vector3d &_from, const Eigen::Vector3d &_to) const
Compute the quaternion that rotates from vector "from" to vector "to".
Definition: Trackball.cpp:177
double mRadius
Definition: Trackball.hpp:105
void setCenter(const Eigen::Vector2d &_center)
Definition: Trackball.cpp:117
Eigen::Vector3d mouseOnSphere(double _mouseX, double _mouseY) const
Project screen coordinate (x,y) to the trackball.
Definition: Trackball.cpp:152
void applyGLRotation()
Apply the current rotation to openGL env.
Definition: Trackball.cpp:70
void setRadius(const double _radius)
Definition: Trackball.cpp:122
void startBall(double _x, double _y)
Set the starting position to the project of (x,y) on the trackball.
Definition: Trackball.cpp:57
Eigen::Vector2d getCenter() const
Definition: Trackball.cpp:142
void setTrackball(const Eigen::Vector2d &_center, const double _radius)
Definition: Trackball.cpp:110
Definition: BulletCollisionDetector.cpp:65