33 #ifndef DART_GUI_TRACKBALL_HPP_
34 #define DART_GUI_TRACKBALL_HPP_
37 #include <Eigen/Geometry>
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
52 Trackball(
const Eigen::Vector2d& _center,
double _radius);
65 void draw(
int _winWidth,
int _winHeight);
68 void setTrackball(
const Eigen::Vector2d& _center,
const double _radius);
71 void setCenter(
const Eigen::Vector2d& _center);
93 Eigen::Vector3d
mouseOnSphere(
double _mouseX,
double _mouseY)
const;
98 const Eigen::Vector3d& _to)
const;
Definition: Trackball.hpp:43
Eigen::Vector3d mStartPos
Definition: Trackball.hpp:107
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:59
Eigen::Matrix3d getRotationMatrix() const
Definition: Trackball.cpp:124
double getRadius() const
Definition: Trackball.cpp:132
Eigen::Quaterniond getCurrQuat() const
Definition: Trackball.cpp:120
Eigen::Vector2d mCenter
Definition: Trackball.hpp:101
Eigen::Quaterniond mCurrQuat
Definition: Trackball.hpp:110
void setQuaternion(const Eigen::Quaterniond &_q)
Definition: Trackball.cpp:116
void draw(int _winWidth, int _winHeight)
Draw the trackball on screen.
Definition: Trackball.cpp:71
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:156
double mRadius
Definition: Trackball.hpp:104
void setCenter(const Eigen::Vector2d &_center)
Definition: Trackball.cpp:108
Eigen::Vector3d mouseOnSphere(double _mouseX, double _mouseY) const
Project screen coordinate (x,y) to the trackball.
Definition: Trackball.cpp:136
void applyGLRotation()
Apply the current rotation to openGL env.
Definition: Trackball.cpp:66
void setRadius(const double _radius)
Definition: Trackball.cpp:112
void startBall(double _x, double _y)
Set the starting position to the project of (x,y) on the trackball.
Definition: Trackball.cpp:55
Eigen::Vector2d getCenter() const
Definition: Trackball.cpp:128
void setTrackball(const Eigen::Vector2d &_center, const double _radius)
Definition: Trackball.cpp:102
Definition: BulletCollisionDetector.cpp:63