#include <Flek/FArcball_Control.H>
The FArcball_Control class provides a convenient 3d rotation Control. This class is used by Fl_Gl_Arcball_Window to provide a user friendly rotation manipulator.
FArcball_Control::FArcball_Control();
Default constructor.FArcball_Control::FArcball_Control(const FArcball_Control& ab);
Copy constructor. This constructor copies the values from another FArcball_Control.Parameters
ab The FArcball_Control that this FArcball_Control should copy it's values from. FArcball_Control::FArcball_Control(const FVector3& cen, double rad);
Two argument constructor. This constructor sets the initial center and radius of the arcball.Parameters
cen The center for all subsequent rotation operations. radius The radius of the sphere used for determining where the user sweeps a rotation arc. The radius is relative to the window, where the value 1.0 would be the size of the window.
AxisSet FArcball_Control::axis();
Gets the current axis.Return Value
The current axis. Possible values include CameraAxes, BodyAxes and NoAxes.void FArcball_Control::axis(AxisSet set);
Sets the current axis.
int FArcball_Control::axis_index();
Gets the axis index.Return Value
The axis index.
void FArcball_Control::begin_drag();
Start dragging the mouse.
void FArcball_Control::center(const FVector3& cen);
Sets the center of the arcball.Parameters
cen The center for all subsequent rotation operations. void FArcball_Control::center(double x, double y, double z);
Sets the center of the arcball.Parameters
x The x coordinate center for all subsequent rotation operations. y The y coordinate center for all subsequent rotation operations. z The z coordinate center for all subsequent rotation operations. FVector3 FArcball_Control::center();
Gets the center of the arcball.Return Value
The center of the arcball.
bool FArcball_Control::dragging();
Gets wether or not we are currently dragging the mouse.Return Value
True if we are dragging the mouse, else false.
void FArcball_Control::end_drag();
End dragging the mouse.
FVector3 & FArcball_Control::from();
Gets the "from" point.Return Value
The point on the arcball we are rotating from (initial click).
void FArcball_Control::mouse(double x, double y);
Register an x-y mouse event.Parameters
x The new x coordinate of the mouse. y The new y coordinate of the mouse.
FArcball_Control& FArcball_Control::operator =(const FArcball_Control& ab);
The assignment operator. This method assigns the values contained in this arcball to that of another.Parameters
ab The FArcball_Control that this FArcball_Control should copy it's values from.
void FArcball_Control::place(const FVector3& cen, double rad);
Sets the center of the arcball and it's radius.Parameters
cen The center for all subsequent rotation operations. radius The radius of the sphere used for determining where the user sweeps a rotation arc. The radius is relative to the window, where the value 1.0 would be the size of the window.
FQuaternion FArcball_Control::quaternion_value();
Gets the rotation quaternion.Return Value
The current arcball quaternion.
double FArcball_Control::radius();
Gets the arcball radius.Return Value
The arcball radius relative to the size of the viewport. Where 1.0 equals a diameter equal to the size of the viewport.void FArcball_Control::radius(const double r);
Sets the arcball radius.Parameters
The arcball radius. Good values are usually less than 1.0.
FVecFArcball_Control::tor3 & to();
Gets the "to" point.Return Value
The point on the arcball we are rotating to.
void FArcball_Control::update();
Update the arcball transformation matrix.
FMatrix4x4 FArcball_Control::value();
Gets the arcball transformation matrix.Return Value
The current arcball transforamtion matrix.
FArcball_Control::~FArcball_Control();
The destructor.
FVector3 FArcball_Control::constrainToAxis(const FVector3& loose, const FVector3& axis);
Force sphere point to be perpendicular to axis.
int FArcball_Control::nearestConstraintAxis(const FVector3& loose, FVector3 * axes, int nAxes);
Find the index of nearest arc of axis set.
FQuaternion FArcball_Control::quatFromBallPoints(const FVector3& from, const FVector3& to);
Construct a unit quaternion from two points on unit sphere
void FArcball_Control::quatToBallPoints(const FQuaternion& q, FVector3& arcFrom, FVector3& arcTo);
Convert a unit quaternion to two points on unit sphere Assumes that the given quaternion is a unit quaternion
void FArcball_Control::update(void);
Using vDown, vNow, dragging, and asAxisSet, compute rotation etc.