The Fast Light Environment Kit



class FArcball_Control

Include Files

#include <Flek/FArcball_Control.H>

Description

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.

Methods


Method Descriptions

FArcball_Control

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
abThe 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
cenThe center for all subsequent rotation operations.
radiusThe 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.

axis

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.

axis_index

int FArcball_Control::axis_index();

Gets the axis index.

Return Value
The axis index.

begin_drag

void FArcball_Control::begin_drag();

Start dragging the mouse.

center

void FArcball_Control::center(const FVector3& cen);

Sets the center of the arcball.

Parameters
cenThe center for all subsequent rotation operations.

void FArcball_Control::center(double x, double y, double z);

Sets the center of the arcball.

Parameters
xThe x coordinate center for all subsequent rotation operations.
yThe y coordinate center for all subsequent rotation operations.
zThe 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.

dragging

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.

end_drag

void FArcball_Control::end_drag();

End dragging the mouse.

from

FVector3 & FArcball_Control::from();

Gets the "from" point.

Return Value
The point on the arcball we are rotating from (initial click).

mouse

void FArcball_Control::mouse(double x, double y);

Register an x-y mouse event.

Parameters
xThe new x coordinate of the mouse.
yThe new y coordinate of the mouse.

operator =

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
abThe FArcball_Control that this FArcball_Control should copy it's values from.

place

void FArcball_Control::place(const FVector3& cen, double rad);

Sets the center of the arcball and it's radius.

Parameters
cenThe center for all subsequent rotation operations.
radiusThe 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.

quaternion_value

FQuaternion FArcball_Control::quaternion_value();

Gets the rotation quaternion.

Return Value
The current arcball quaternion.

radius

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
Thearcball radius. Good values are usually less than 1.0.

to

FVecFArcball_Control::tor3 & to();

Gets the "to" point.

Return Value
The point on the arcball we are rotating to.

update

void FArcball_Control::update();

Update the arcball transformation matrix.

value

FMatrix4x4 FArcball_Control::value();

Gets the arcball transformation matrix.

Return Value
The current arcball transforamtion matrix.

~FArcball_Control

FArcball_Control::~FArcball_Control();

The destructor.

constrainToAxis

FVector3 FArcball_Control::constrainToAxis(const FVector3& loose, const FVector3& axis);

Force sphere point to be perpendicular to axis.

nearestConstraintAxis

int FArcball_Control::nearestConstraintAxis(const FVector3& loose, FVector3 * axes, int nAxes);

Find the index of nearest arc of axis set.

quatFromBallPoints

FQuaternion FArcball_Control::quatFromBallPoints(const FVector3& from, const FVector3& to);

Construct a unit quaternion from two points on unit sphere

quatToBallPoints

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

update

void FArcball_Control::update(void);

Using vDown, vNow, dragging, and asAxisSet, compute rotation etc.

© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001