library: libRGL
#include "TGLPerspectiveCamera.h"

TGLPerspectiveCamera


class description - header file - source file - inheritance tree (.pdf)

class TGLPerspectiveCamera : public TGLCamera

Inheritance Chart:
TGLCamera
<-
TGLPerspectiveCamera

    public:
TGLPerspectiveCamera(const TGLVector3& hAxis, const TGLVector3& vAxis) virtual ~TGLPerspectiveCamera() virtual void Apply(const TGLBoundingBox& box, const TGLRect* pickRect = 0) const static TClass* Class() void Configure(Double_t fov, Double_t dolly, Double_t* center, Double_t hRotate, Double_t vRotate) virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2) virtual TClass* IsA() const virtual void Reset() virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta) virtual void Setup(const TGLBoundingBox& box) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Bool_t Truck(Int_t x, Int_t y, Int_t xDelta, Int_t yDelta) virtual Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)

Data Members

    private:
TGLVector3 fHAxis ! TGLVector3 fVAxis ! Double_t fDollyMin ! Double_t fDollyDefault ! Double_t fDollyMax ! Double_t fFOV ! Double_t fDolly ! Double_t fVRotate ! Double_t fHRotate ! TGLVertex3 fCenter ! TGLVector3 fTruck ! static Double_t fgFOVMin static Double_t fgFOVDefault static Double_t fgFOVMax static UInt_t fgDollyDeltaSens static UInt_t fgFOVDeltaSens

Class Description

                                                                      
 TGLPerspectiveCamera                                                 
                                                                      
 Perspective projection camera - with characteristic foreshortening.  
                                                                      
 TODO: Currently constrains YOZ plane to be floor - this is never     
 'tipped'. While useful we really need to extend so can:              
 i) Pick any one of the three natural planes of the world to be floor.
 ii) Can use a free arcball style camera with no contraint - integrate
 TArcBall.                                                            

TGLPerspectiveCamera(const TGLVector3 & hAxis, const TGLVector3 & vAxis)
 Construct perspective camera
~TGLPerspectiveCamera()
 Destroy perspective camera
void Setup(const TGLBoundingBox & box)
 Setup camera limits suitible to view the world volume defined by 'box'
 and call Reset() to initialise camera.
void Reset()
 Reset the camera to defaults - reframe the world volume established in Setup()
 in default state. Note: limits defined in Setup() are not adjusted.
Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
 Dolly the camera - 'move camera along eye line, retaining lens focal length'.
 Arguments are:

 'delta' - mouse viewport delta (pixels) - +ive dolly in, -ive dolly out
 'mod1' / 'mod2' - sensitivity modifiers - see TGLCamera::AdjustAndClampVal()

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.
Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)
 Zoom the camera - 'adjust lens focal length, retaining camera position'.
 Arguments are:

 'delta' - mouse viewport delta (pixels) - +ive zoom in, -ive zoom out
 'mod1' / 'mod2' - sensitivity modifiers - see TGLCamera::AdjustAndClampVal()

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.
Bool_t Truck(Int_t x, Int_t y, Int_t xDelta, Int_t yDelta)
 Truck the camera - 'move camera parallel to film plane'. The film
 plane is defined by the EyePoint() / EyeDirection() pair. Define motion
 using center point (x/y) and delta (xDelta/yDelta) - the mouse motion.
 For an orthographic projection this means all objects (regardless of
 camera distance) track the mouse motion.

 Returns kTRUE is redraw required (camera change), kFALSE otherwise.

 Note: Trucking is often mistakenly refered to as 'pan' or 'panning'.
 Panning is swivelling the camera on it's own axis - the eye point.
Bool_t Rotate(Int_t xDelta, Int_t yDelta)
 Rotate the camera round view volume center established in Setup().
 Arguments are:

 xDelta - horizontal delta (pixels)
 YDelta - vertical delta (pixels)

 Deltas are divided by equivalent viewport dimension and scaled
 by full rotation - i.e. translates fraction of viewport to
 fractional rotation.
void Apply(const TGLBoundingBox & sceneBox, const TGLRect * pickRect)
 Apply the camera to the current GL context, setting the viewport, projection
 and modelview matricies. After this verticies etc can be directly entered
 in the world frame. This also updates the cached frustum values, enabling
 all the projection, overlap tests etc defined in TGLCamera to be used.

 Arguments are:
 'box' - view volume box - used to adjust near/far clipping
 'pickRect' - optional picking rect. If non-null, restrict drawing to this
 viewport rect.
void Configure(Double_t fov, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate)
 Configure the camera state

Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLPerspectiveCamera.cxx,v 1.16 2006/02/23 16:44:52 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.