SoCameraInteractor Class |
Utility class to manipulate a camera.
Namespace: OIV.Inventor.ViewerComponents
The SoCameraInteractor type exposes the following members.
Name | Description | |
---|---|---|
SoCameraInteractor | Create a OIV.Inventor.ViewerComponents.SoCameraInteractor for the specified camera. |
Name | Description | |
---|---|---|
ActivateOrbiting | Set the starting point for interactive orbiting. | |
ActivatePanning | Set the starting point for interactive panning. | |
AdjustClippingPlanes | Adjust near and far clipping planes to minimize clipping of objects in the scene. | |
ChangeViewVolume | Change camera's view volume. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Dolly | Dolly - Makes the scene appear larger or smaller. | |
DollyInWindow | Moves the camera forward or backward along the view vector to view the region defined by the given corners in normalized screen coordinates. | |
DollyWithZoomCenter | Modifies the camera to ajust the view around the specified point. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
GetCamera | Returns the associated camera. | |
GetDirectionVector | Returns the direction vector of the camera. | |
GetFocalPoint | ||
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetNewInstance | Create an instance for the specified camera. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetViewportCenter | Obsolete. Returns the viewport center. | |
LookAt | Returns the rotation needed to point a camera at position toward the given target point while keeping the "up" direction of the camera parallel to the specified up vector. | |
Orbit(SbRotation) | Orbit the camera by the specified rotation. | |
Orbit(SbVec2f) | Orbit the camera based on offset from the previous screen position. | |
Pan | Pan the camera based on offset from starting point. | |
Pivot | Pivot the camera. | |
PointAt | Sets the orientation of the camera so that it points toward the given target point while keeping the "up" direction of the camera parallel to the positive world coordinate y-axis. | |
PopCamera | Restore saved camera. | |
ProjectToPlane | Project specified 2D point on the plane parallel to the near plane that is at distFromEye units from the eye, see also SbViewVolume.getPlanePoint. | |
ProjectToScreen | Map a 3D point in world coordinates to a 2D point in normalized screen coordinates (0 <= x,y <= 1), see also SbViewVolume.projectToScreen. | |
PushCamera | Save current camera. | |
Roll | Roll the camera. | |
Rotate(Single) | Rotate the camera around the center specified by OIV.Inventor.ViewerComponents.SoCameraInteractor.SetRotationCenter(OIV.Inventor.SbVec3f) and the axis specified by OIV.Inventor.ViewerComponents.SoCameraInteractor.SetRotationAxis(OIV.Inventor.SbVec3f). | |
Rotate(SbRotation) | Rotate the camera. | |
SetOrientation | Set the orientation of the camera. | |
SetPosition(SbVec3f) | Move camera to the specified position. | |
SetPosition(SbVec2f, Single, SbViewportRegion) | Move camera to the specified position. | |
SetRotationAxis | Set the axis of rotation. | |
SetRotationCenter | Set the center of rotation. | |
Synchronize | Copy field values from the specified camera to the camera of this interactor. | |
Tilt | Tilt the camera. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Translate(SbVec3f) | Move camera by the specified 3D displacement. | |
Translate(SbVec2f, SbViewportRegion) | Move camera by the specified 2D displacement. | |
ViewAll(SoNode, SbViewportRegion) | Move the camera to view the scene defined by the given node. | |
ViewAll(SoPath, SbViewportRegion) | Move the camera to view the scene defined by the given path. | |
ViewAxis | Moves and rotates the camera to be aligned with the given direction vector while keeping the up direction of the camera parallel to the specified up vector. | |
ViewIn(SbBox3f) | Move camera to the center of the specified box. | |
ViewIn(SoNode, SbViewportRegion) | Move camera to the center of the scene defined by the specified node. | |
ViewIn(SoPath, SbViewportRegion) | Move camera to the center of the scene defined by the specified path. | |
ViewX | Calls ViewX(false). | |
ViewX(Boolean) | NOTE: The camera position is not changed, so the camera may not be looking toward the scene. | |
ViewY | Calls ViewY(false). | |
ViewY(Boolean) | Rotate camera to look parallel to the Y axis with +Z up. | |
ViewZ | Calls ViewZ(false). | |
ViewZ(Boolean) | Rotate camera to look parallel to the Z axis with +Y up. | |
Zoom | Zoom - Makes the scene appear larger or smaller. | |
ZoomInWindow | Zooms to the region defined by the given corners in normalized screen coordinates. |
Name | Description | |
---|---|---|
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) |
This class provides some useful algorithms to manipulate a camera (translation, rotation, zoom, etc).
This class is not, strictly speaking, a true interactor. It does not respond to input events. However it provides the camera manipulation algorithms you need to build an interactor that provides behavior similar to the Open Inventor viewer classes, for example OIV.Inventor.Win.Viewers.SoWinExaminerViewer. An interactor could handle system-dependent events or Open Inventor events (using OIV.Inventor.Nodes.SoEventCallback). It could also be triggered from the user interface (buttons, sliders, etc).
Start by creating an instance of OIV.Inventor.ViewerComponents.SoCameraInteractor by giving the camera to be manipulated either to the constructor of OIV.Inventor.ViewerComponents.SoCameraInteractor or to the OIV.Inventor.ViewerComponents.SoCameraInteractor.GetNewInstance(OIV.Inventor.Nodes.SoCamera) method. Then, for example, to provide examinerViewer-like rotation behavior:
On a mouse button down event, call OIV.Inventor.ViewerComponents.SoCameraInteractor.ActivateOrbiting(OIV.Inventor.SbVec2f).
On mouse move event, if button is down, call OIV.Inventor.ViewerComponents.SoCameraInteractor.Orbit(OIV.Inventor.SbRotation).
To provide the viewer's automatic adjustment of near and far clip planes behavior, call the OIV.Inventor.ViewerComponents.SoCameraInteractor.AdjustClippingPlanes(OIV.Inventor.Nodes.SoNode, OIV.Inventor.SbViewportRegion) method before each render traversal.
To see an example "viewer" implemented using this class, please see the SceneExaminer class provided as source code in the Open Inventor SDK:
.../source/OIV.Inventor.ViewerComponents/Nodes