32 if (fabs(in.
Dot(normal)) > 0.999)
34 if (fabs(normal[0]) < 0.1)
36 result.
Set(1.0,0.0,0.0);
40 result.
Set(0.0,1.0,0.0);
45 result = in - (in.
Dot(normal))*normal;
103 double theta = acos(svdir.
Dot(cvdir));
104 if (nvup.
Dot(cvdir.
Cross(svdir)) < 0.0)
109 nivdir = civdir*cos(theta) - civright*sin(theta);
117 cppwc = cpos + ctrans;
118 double x = cppwc.
Dot(civdir)/cdistance;
119 double y = cppwc.
Dot(civright)/cdistance;
123 nivdir*(x*sdistance - spos.
Dot(nivdir)) +
124 nivright*(y*sdistance - spos.
Dot(nivright));
132 nfp = cpos + nivdir*sdistance;
138 cam->SetTranslation(this->Translation);
141 this->FocalPoint[0] - this->PhysicalViewDirection[0]*this->Distance,
142 this->FocalPoint[1] - this->PhysicalViewDirection[1]*this->Distance,
143 this->FocalPoint[2] - this->PhysicalViewDirection[2]*this->Distance);
163 this->Active =
false;
168 this->Callback->Delete();
169 this->Callback =
nullptr;
182 this->xmin = in.
xmin;
183 this->xmax = in.
xmax;
184 this->ymin = in.
ymin;
185 this->ymax = in.
ymax;
189 this->Group = in.
Group;
virtual void SetPhysicalTranslation(double, double, double)
Set/get physical coordinate system in world coordinate system.
double Normalize()
Normalize the vector in place.
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
virtual void SetPhysicalViewUp(double, double, double)
Set/get physical coordinate system in world coordinate system.
vtkVector3d SanitizeVector(vtkVector3d &in, vtkVector3d &normal)
virtual void SetDollyPhysicalSpeed(double)
Set/Get the maximum dolly speed used when flying in 3D, in meters per second.
virtual double * GetPhysicalTranslation()
Set/get physical coordinate system in world coordinate system.
virtual double * GetDirectionOfProjection()
Get the vector in the direction from the camera position to the focal point.
extends interaction to support 3D input
virtual double * GetPhysicalViewUp()
Set/get physical coordinate system in world coordinate system.
void SetPosition(double x, double y, double z)
Set/Get the position of the camera in world coordinates.
vtkOpenVROverlaySpot(int x1, int x2, int y1, int y2, vtkCommand *cb)
virtual double GetDollyPhysicalSpeed()
Set/Get the maximum dolly speed used when flying in 3D, in meters per second.
T Dot(const vtkVector< T, Size > &other) const
The dot product of this and the supplied vector.
virtual double * GetPosition()
Set/Get the position of the camera in world coordinates.
superclass for callback/observer methods
virtual double * GetPhysicalViewDirection()
Set/get physical coordinate system in world coordinate system.
virtual void SetPhysicalViewDirection(double, double, double)
Set/get physical coordinate system in world coordinate system.
virtual double GetPhysicalScale()
Set/get physical coordinate system in world coordinate system.
void Set(const T &x, const T &y, const T &z)
Set the x, y and z components of the vector.
vtkOpenVROverlaySpot(const vtkOpenVROverlaySpot &in)
void Apply(vtkOpenVRCamera *cam, vtkOpenVRRenderWindow *win)
void SetFocalPoint(double x, double y, double z)
Set/Get the focal of the camera in world coordinates.
virtual vtkRenderWindowInteractor * GetInteractor()
Get the interactor associated with this render window.
vtkVector3< T > Cross(const vtkVector3< T > &other) const
Return the cross product of this X other.
void Set(vtkOpenVRCamera *cam, vtkOpenVRRenderWindow *win)
T * GetData()
Get a pointer to the underlying data of the tuple.
virtual void SetPhysicalScale(double)
Set/get physical coordinate system in world coordinate system.
double PhysicalViewDirection[3]
virtual vtkInteractorObserver * GetInteractorStyle()
External switching between joystick/trackball/new? modes.