1 #include <GLviewer/GLProjectionParametersBase.hh>
2 #include <Base/Math/Vector3.hh>
3 #include <Base/Geometry/RMatrixBase.hh>
4 #include "FlyControl.hh"
7 #include <Gui/biasgl.h>
64 controlledObject_->GetExtrinsics(C,R);
65 R.
Mult(direction, temp);
68 controlledObject_->SetExtrinsics(
HomgPoint3D(C), R);
75 if (x1-x2 == 0 && y1-y2 == 0) {
82 glGetIntegerv(GL_VIEWPORT, viewport);
83 double width = viewport[2];
84 double height = viewport[3];
87 controlledObject_->GetExtrinsics(C, up);
88 RMatrix R = controlledObject_->GetMyselfAsProjectionParameterBase()->GetR();
93 double x = x1 / width * 2.0;
94 double y = y1 / height * 2.0;
99 double z = sqrt(2.0) - x * x - y * y;
113 x = x2 / width * 2.0;
114 y = y2 / height * 2.0;
119 z = sqrt(2.0) - x * x - y * y;
137 double angleRAD = acos(v1.ScalarProduct(v2));
138 controlledObject_->GetExtrinsics(C, up);
142 R.Transpose().
Mult(axis, temp);
154 controlledObject_->SetExtrinsics(C, C + A, up);
207 if (! UseLeftDouble_)
return false;
211 controlledObject_->UnProject(x, y);
212 if (homgPoint[3] == 0.0)
214 BIASERR(
"Error: Point of interest / 3D point could not be set.");
221 controlledObject_->GetExtrinsics(C, up);
222 controlledObject_->SetExtrinsics(C, poi, up);
226 double stepsize = distance.
NormL2()*0.05;
227 SetStepsize(stepsize);
229 cout<<
"New stepsize is: "<<stepsize<<endl;
238 RMatrix R = controlledObject_->GetMyselfAsProjectionParameterBase()->GetR();
241 glGetIntegerv(GL_VIEWPORT, viewport);
242 int width = viewport[2];
243 int height = viewport[3];
246 controlledObject_->GetExtrinsics(C, up);
266 rotationAngle *= -1.0;
268 RotateAroundViewingDirection(rotationAngle);
276 RMatrix R = controlledObject_->GetMyselfAsProjectionParameterBase()->GetR();
280 controlledObject_->GetExtrinsics(C, up);
287 controlledObject_->SetExtrinsics(C, C + rotationAxis, up);
void RotateAroundViewingDirection(double rotationAngleRAD)
void ScalarProduct(const Vector3< T > &argvec, T &result) const
scalar product (=inner product) of two vectors, storing the result in result
bool LeftAndRightMouseMoved(int x1, int x2, int y1, int y2)
react to mouse movement while right and middle button held down overwrite in derived class of desired...
bool MiddleMouseMoved(int x1, int x2, int y1, int y2)
react to mouse movement while middle button held down overwrite in derived class of desired ...
bool LeftMouseMoved(int x1, int x2, int y1, int y2)
react to mouse movement while left button held down overwrite in derived class of desired ...
bool RightMouseMoved(int x1, int x2, int y1, int y2)
react to mouse movement while right button held down overwrite in derived class of desired ...
int MultVec(const Vector3< QUAT_TYPE > &vec, Vector3< QUAT_TYPE > &res) const
rotates the given Vector qith the quaternion ( q v q* ) the resulting vector is given in res ...
void SetStepsize(double stepsize)
Stepsize_ defines how fast the camera moves, will be set to 5% of distance to Point of Interest...
void CrossProduct(const Vector3< T > &argvec, Vector3< T > &destvec) const
cross product of two vectors destvec = this x argvec
void Mult(const Vector3< T > &argvec, Vector3< T > &destvec) const
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: dest...
bool LeftMouseDoubleClicked(int x, int y)
void AddIP(const T &scalar)
Addition (in place) of an scalar.
void MoveDirection(BIAS::Vector3< double > direction)
Computes from direction the new C vector of the camera.
void Mult(const T &scalar, Vector3< T > &dest) const
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
void MoveForward()
Moves the camera in the named directions, calls MoveDirection.
class for rotation with axis and angle
Vector3< T > & Normalize()
normalize this vector to length 1
double NormL2() const
the L2 norm sqrt(a^2 + b^2 + c^2)
class BIASGeometryBase_EXPORT HomgPoint3D
void SetValueAsAxisRad(const Vector3< QUAT_TYPE > &axis, QUAT_TYPE angle)
sets the quaternion with given rotation axis and angle (in rad)