14#include "TGLIncludes.h"
143 return Truck(-xstep, -ystep);
158 const TGLRect * pickRect)
const
175 glMatrixMode(GL_PROJECTION);
177 glMatrixMode(GL_MODELVIEW);
182 glMatrixMode(GL_PROJECTION);
192 glMatrixMode(GL_MODELVIEW);
200 gluLookAt(pos[0], pos[1], pos[2],
201 center[0], center[1], center[2],
202 up[0], up[1], up[2]);
208 modifiedCache =
kTRUE;
219 for (
UInt_t i=0; i<8; i++) {
220 currentDist = clipPlane.
DistanceTo(sceneBox[i]);
239 glMatrixMode(GL_PROJECTION);
248 gluPickMatrix(rect.
X(), rect.
Y(), rect.
Width(), rect.
Height(),
258 glMatrixMode(GL_MODELVIEW);
282 }
else if (
fFOV < 0.1) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLMatrix fLastNoPickProjM
! no-pick projection matrix (cached)
TGLVector3 EyeDirection() const
Extract the camera eye direction (vector), running from EyePoint() Camera must have valid frustum cac...
virtual Bool_t RotateRad(Double_t hRotate, Double_t vRotate)
Rotate camera around center.
Bool_t fCacheDirty
! cached items dirty?
Double_t fNearClip
! last applied near-clip
Bool_t AdjustAndClampVal(Double_t &val, Double_t min, Double_t max, Int_t screenShift, Int_t screenShiftRange, Bool_t mod1, Bool_t mod2) const
Adjust a passed REFERENCE value 'val', based on screenShift delta.
TGLRect fViewport
! viewport (GL coords - origin bottom left)
void WindowToViewport(Int_t &, Int_t &y) const
void UpdateCache() const
Update internally cached frustum values.
void SetCenterVec(Double_t x, Double_t y, Double_t z)
Set camera center vector.
Double_t fFarClip
! last applied far-clip
TGLCamera(const TGLCamera &)=delete
TGLVertex3 EyePoint() const
Return the camera eye point (vertex) in world space Camera must have valid frustum cache - call Apply...
Double_t AdjustDelta(Double_t screenShift, Double_t deltaFactor, Bool_t mod1, Bool_t mod2) const
Adjust a passed screen value and apply modifiers.
16 component (4x4) transform matrix - column MAJOR as per GL.
TGLVector3 GetBaseVec(Int_t b) const
TGLVector3 GetTranslation() const
Return the translation component of matrix.
void Setup(const TGLBoundingBox &box, Bool_t reset=kTRUE) override
Setup camera limits suitable to view the world volume defined by 'box' and call Reset() to initialise...
void Configure(Double_t fov, Double_t dolly, Double_t center[3], Double_t hRotate, Double_t vRotate) override
Configure the camera state.
Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2) override
Zoom the camera - 'adjust lens focal length, retaining camera position'.
static UInt_t fgFOVDeltaSens
void Apply(const TGLBoundingBox &box, const TGLRect *pickRect=nullptr) const override
Apply the camera to the current GL context, setting the viewport, projection and modelview matrices.
~TGLPerspectiveCamera() override
Destroy perspective camera.
TGLPerspectiveCamera()
Construct default XOZ perspective camera.
Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2) override
Truck the camera - 'move camera parallel to film plane'.
static Double_t fgFOVDefault
void Reset() override
Reset the camera to defaults - reframe the world volume established in Setup() in default state.
3D plane class - of format Ax + By + Cz + D = 0
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
Viewport (pixel base) 2D rectangle class.
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
const Double_t * CArr() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Hypot(Double_t x, Double_t y)
Returns sqrt(x*x + y*y).
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.