ROOT logo
ROOT » GRAF3D » GL » TGLPerspectiveCamera

class TGLPerspectiveCamera: public TGLCamera


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.

Function Members (Methods)

public:
TGLPerspectiveCamera(const TGLVector3& hAxis, const TGLVector3& vAxis)
virtual~TGLPerspectiveCamera()
Bool_tTGLCamera::AdjustAndClampVal(Double_t& val, Double_t min, Double_t max, Int_t screenShift, Int_t screenShiftRange, Bool_t mod1, Bool_t mod2) const
Double_tTGLCamera::AdjustDelta(Double_t screenShift, Double_t deltaFactor, Bool_t mod1, Bool_t mod2) const
virtual voidApply(const TGLBoundingBox& box, const TGLRect* pickRect = 0) const
static TClass*Class()
virtual voidConfigure(Double_t fov, Double_t dolly, Double_t* center, Double_t hRotate, Double_t vRotate)
virtual Bool_tTGLCamera::Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
voidTGLCamera::DrawDebugAids() const
TGLVector3TGLCamera::EyeDirection() const
TGLVertex3TGLCamera::EyePoint() const
TGLVertex3TGLCamera::FrustumCenter() const
EOverlapTGLCamera::FrustumOverlap(const TGLBoundingBox& box) const
const TGLPlane&TGLCamera::FrustumPlane(TGLCamera::EFrustumPlane plane) const
const TGLMatrix&TGLCamera::GetCamBase() const
const TGLMatrix&TGLCamera::GetCamTrans() const
Double_t*TGLCamera::GetCenterVec()
Bool_tTGLCamera::GetExternalCenter()
Double_tTGLCamera::GetFarClip() const
Double_t*TGLCamera::GetFixDefCenterVec()
Double_tGetFOV() const
Double_tTGLCamera::GetNearClip() const
Double_tTGLCamera::GetTheta() const
Float_tTGLCamera::GetVAxisMinAngle()
voidTGLCamera::IncTimeStamp()
virtual TClass*IsA() const
Bool_tTGLCamera::IsCacheDirty() const
virtual Bool_tTGLCamera::IsOrthographic() const
virtual Bool_tIsPerspective() const
Bool_tTGLCamera::OfInterest(const TGLBoundingBox& box, Bool_t ignoreSize) const
TGLMatrix&TGLCamera::RefCamBase()
TGLMatrix&TGLCamera::RefCamTrans()
TGLMatrix&TGLCamera::RefLastNoPickProjM() const
const TGLMatrix&TGLCamera::RefModelViewMatrix() const
TGLRect&TGLCamera::RefViewport()
const TGLRect&TGLCamera::RefViewport() const
virtual voidReset()
voidTGLCamera::ResetInterest()
virtual Bool_tTGLCamera::Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
virtual Bool_tTGLCamera::RotateRad(Double_t hRotate, Double_t vRotate)
voidTGLCamera::SetCenterVec(Double_t x, Double_t y, Double_t z)
voidTGLCamera::SetCenterVecWarp(Double_t x, Double_t y, Double_t z)
voidTGLCamera::SetExternalCenter(Bool_t x)
voidTGLCamera::SetFixDefCenter(Bool_t x)
voidTGLCamera::SetFixDefCenterVec(Double_t x, Double_t y, Double_t z)
virtual voidSetup(const TGLBoundingBox& box, Bool_t reset = kTRUE)
voidTGLCamera::SetVAxisMinAngle(Float_t x)
voidTGLCamera::SetViewport(const TGLRect& viewport)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
UInt_tTGLCamera::TimeStamp() const
virtual Bool_tTruck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Bool_tTGLCamera::UpdateInterest(Bool_t force)
TGLVector3TGLCamera::ViewportDeltaToWorld(const TGLVertex3& worldRef, Double_t viewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat = 0) const
EOverlapTGLCamera::ViewportOverlap(const TGLBoundingBox& box) const
pair<Bool_t,TGLVertex3>TGLCamera::ViewportPlaneIntersection(const TPoint& viewport, const TGLPlane& worldPlane) const
pair<Bool_t,TGLVertex3>TGLCamera::ViewportPlaneIntersection(Double_t viewportX, Double_t viewportY, const TGLPlane& worldPlane) const
TGLRectTGLCamera::ViewportRect(const TGLBoundingBox& box, TGLBoundingBox::EFace face) const
TGLRectTGLCamera::ViewportRect(const TGLBoundingBox& box, const TGLBoundingBox::EFace* face = 0) const
TGLLine3TGLCamera::ViewportToWorld(const TPoint& viewport) const
TGLVertex3TGLCamera::ViewportToWorld(const TGLVertex3& viewportVertex, TGLMatrix* modviewMat = 0) const
TGLLine3TGLCamera::ViewportToWorld(Double_t viewportX, Double_t viewportY) const
voidTGLCamera::WindowToViewport(TPoint& point) const
voidTGLCamera::WindowToViewport(TGLRect& rect) const
voidTGLCamera::WindowToViewport(TGLVertex3& vertex) const
voidTGLCamera::WindowToViewport(Int_t&, Int_t& y) const
TGLVector3TGLCamera::WorldDeltaToViewport(const TGLVertex3& worldRef, const TGLVector3& worldDelta) const
TGLVertex3TGLCamera::WorldToViewport(const TGLVertex3& worldVertex, TGLMatrix* modviewMat = 0) const
virtual Bool_tZoom(Int_t delta, Bool_t mod1, Bool_t mod2)
protected:
voidTGLCamera::UpdateCache() const

Data Members

public:
enum TGLCamera::EFrustumPlane { kNear
kLeft
kRight
kTop
kBottom
kFar
kPlanesPerFrustum
};
protected:
Bool_tTGLCamera::fCacheDirty! cached items dirty?
TGLMatrixTGLCamera::fCamBase! tranformation to center and rotation from up to x vector
TGLMatrixTGLCamera::fCamTrans! transformation relative to fCamTrans
TGLVector3*TGLCamera::fCenter! current camera center
TGLMatrixTGLCamera::fClipM! object space clip matrix (cached)
TGLVector3TGLCamera::fDefCenter! deafult camera center
Double_tTGLCamera::fDollyDefault! default distnce from viewing centre
Double_tTGLCamera::fDollyDistance! unit distance for camera movement in fwd/bck direction
TGLVector3TGLCamera::fExtCenter! external camera center
Bool_tTGLCamera::fExternalCenter! use external center insead of scene center
TGLVector3TGLCamera::fFDCenter! fixed deafult camera center
Double_tTGLCamera::fFarClip! last applied far-clip
Bool_tTGLCamera::fFixDefCenter! use fixed default center
TGLPlaneTGLCamera::fFrustumPlanes[6]! frustum planes (cached)
TGLBoundingBoxTGLCamera::fInterestBox! the interest box - created in UpdateInterest()
Double_tTGLCamera::fLargestSeen! largest box diagonal seen in OfInterest() - used when
TGLMatrixTGLCamera::fLastNoPickProjM! no-pick projection matrix (cached)
TGLMatrixTGLCamera::fModVM! modelView matrix (cached)
Double_tTGLCamera::fNearClip! last applied near-clip
TGLMatrixTGLCamera::fProjM! projection matrix (cached)
UInt_tTGLCamera::fTimeStamp! timestamp
Float_tTGLCamera::fVAxisMinAngle! minimal allowed angle between up and fCamTrans Z vector
TGLRectTGLCamera::fViewport! viewport (GL coords - origin bottom left)
static UInt_tTGLCamera::fgDollyDeltaSens
private:
Double_tfFOV!
static Double_tfgFOVDefault
static UInt_tfgFOVDeltaSens
static Double_tfgFOVMax
static Double_tfgFOVMin

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGLPerspectiveCamera(const TGLVector3& hAxis, const TGLVector3& vAxis)
 Construct perspective camera
~TGLPerspectiveCamera()
 Destroy perspective camera
void Setup(const TGLBoundingBox& box, Bool_t reset = kTRUE)
 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 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 xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
 Truck the camera - 'move camera parallel to film plane'.
 Returns kTRUE is redraw required (camera change), kFALSE otherwise.
void Apply(const TGLBoundingBox& box, const TGLRect* pickRect = 0) const
 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, Double_t hRotate, Double_t vRotate)
 Configure the camera state.
   fov     - set directly field-of-view in degrees (default = 30);
   dolly   - additional move along the camera forward direction;
   center  - new camera center (can be 0 for no change);
   hRotate - additional "up/down" rotation in radians;
   vRotate - additional "left/right" rotation in radians.
Bool_t IsPerspective() const
{ return kTRUE; }
Double_t GetFOV() const
{ return fFOV; }