Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

SphereSectionProjector Class Reference

This projector projects the mouse position onto the section of a sphere that has been sliced by a plane. More...

Inheritance diagram for SphereSectionProjector:

SphereProjector SpherePlaneProjector List of all members.

Public Member Functions

EMMA_EXPORT SphereSectionProjector (float edgeTol=.9, bool orientToEye=true)
 Default constructor.
EMMA_EXPORT SphereSectionProjector (const Sphere &sph, float edgeTol=.9, bool orientToEye=true)
 Constructor taking the sphere.
EMMA_EXPORT ~SphereSectionProjector ()
 Destructor.
virtual EMMA_EXPORT Fusion::Vec3f project (const Fusion::Vec2f &point)
 Apply the projector using the given point, returning the point in three dimensions that it projects to.
virtual EMMA_EXPORT Fusion::Rotation getRotation (const Fusion::Vec3f &point1, const Fusion::Vec3f &point2)
 Computes a rotation based on two points on this projector.
EMMA_EXPORT void setTolerance (float edgeTol)
 Set/get the edge tolerance as a fraction of the radius of the sphere.
EMMA_EXPORT void setRadialFactor (float rad=0.0)
 Set/get the radial rotation factor.
EMMA_EXPORT bool isWithinTolerance (const Fusion::Vec3f &point)
 Find whether this point on the sphere or tolerance plane is within tolerance.

Detailed Description

This projector projects the mouse position onto the section of a sphere that has been sliced by a plane.

The tolerance slice can be specified as a fraction of the radius of the sphere. The projection point will not extend beyond the sliced portion of the sphere.

This projector is good for trackballs that only do pure roll when the mouse is off the sliced portion of the sphere.


Constructor & Destructor Documentation

EMMA_EXPORT SphereSectionProjector float  edgeTol = .9,
bool  orientToEye = true
 

Default constructor.

The default view volume is undefined. The default working space is identity (world space). The default sphere to use has a radius of 1.0 and is centered at (0,0,0). The default edge tolerance is .9. The default eye orientation is true.


Member Function Documentation

virtual EMMA_EXPORT Fusion::Vec3f project const Fusion::Vec2f &  point  )  [virtual]
 

Apply the projector using the given point, returning the point in three dimensions that it projects to.

The point should be normalized from 0-1, with (0,0) at the lower-left.

Implements SphereProjector.

Reimplemented in SpherePlaneProjector.

EMMA_EXPORT void setRadialFactor float  rad = 0.0  )  [inline]
 

Set/get the radial rotation factor.

When the mouse is dragged off of the edge of the sphere, the mouse motion can be classified as either tangential (moving in a circle around the sphere) or radial (moving toward or away from the center). The tangential motion will always map to a rotation around the center, (like the hands of a clock). The radial motion, by default, has no effect. But if you set the radialFactor to be > 0.0, this motion will make the sphere rotate as if the mouse is pulling the top of the sphere out toward the mouse. If radialFactor = 1.0, then pulling has a 'normal' feel. (that is, the mouse motion causes the same amount of rotation as if you had rotated by hitting the actual surface of the sphere, instead of moving off the Default is 0.0

EMMA_EXPORT void setTolerance float  edgeTol  ) 
 

Set/get the edge tolerance as a fraction of the radius of the sphere.

If this is 1.0, the projector is a hemisphere. If this is .1, the projector is a slice of the sphere with radius .1*radius. Default is .9.


Generated on Sat Apr 1 06:08:10 2006 for Emma Content Development Kit by  doxygen 1.4.3