Click or drag to resize
SoCameraInteractor Class

Utility class to manipulate a camera.

Inheritance Hierarchy

Namespace: OIV.Inventor.ViewerComponents
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.9.3.0 (10.9.3.0)
Syntax
public class SoCameraInteractor : SoDisposable

The SoCameraInteractor type exposes the following members.

Constructors
  NameDescription
Public methodSoCameraInteractor

Create a OIV.Inventor.ViewerComponents.SoCameraInteractor for the specified camera.

Top
Methods
  NameDescription
Public methodActivateOrbiting

Set the starting point for interactive orbiting.

Public methodActivatePanning

Set the starting point for interactive panning.

Public methodAdjustClippingPlanes

Adjust near and far clipping planes to minimize clipping of objects in the scene.

Public methodChangeViewVolume

Change camera's view volume.

Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDolly

Dolly - Makes the scene appear larger or smaller.

Public methodDollyInWindow

Moves the camera forward or backward along the view vector to view the region defined by the given corners in normalized screen coordinates.

Public methodDollyWithZoomCenter

Modifies the camera to ajust the view around the specified point.

Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetCamera

Returns the associated camera.

Public methodGetDirectionVector

Returns the direction vector of the camera.

Public methodGetFocalPoint
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodStatic memberGetNewInstance

Create an instance for the specified camera.

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetViewportCenter Obsolete.

Returns the viewport center.

Public methodLookAt

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.

Public methodOrbit(SbRotation)

Orbit the camera by the specified rotation.

Public methodOrbit(SbVec2f)

Orbit the camera based on offset from the previous screen position.

Public methodPan

Pan the camera based on offset from starting point.

Public methodPivot

Pivot the camera.

Public methodPointAt

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.

Public methodPopCamera

Restore saved camera.

Public methodProjectToPlane

Project specified 2D point on the plane parallel to the near plane that is at distFromEye units from the eye, see also SbViewVolume.getPlanePoint.

Public methodProjectToScreen

Map a 3D point in world coordinates to a 2D point in normalized screen coordinates (0 <= x,y <= 1), see also SbViewVolume.projectToScreen.

Public methodPushCamera

Save current camera.

Public methodRoll

Roll the camera.

Public methodRotate(Single)
Public methodRotate(SbRotation)

Rotate the camera.

Public methodSetOrientation

Set the orientation of the camera.

Public methodSetPosition(SbVec3f)

Move camera to the specified position.

Public methodSetPosition(SbVec2f, Single, SbViewportRegion)

Move camera to the specified position.

Public methodSetRotationAxis

Set the axis of rotation.

Public methodSetRotationCenter

Set the center of rotation.

Public methodSynchronize

Copy field values from the specified camera to the camera of this interactor.

Public methodTilt

Tilt the camera.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTranslate(SbVec3f)

Move camera by the specified 3D displacement.

Public methodTranslate(SbVec2f, SbViewportRegion)

Move camera by the specified 2D displacement.

Public methodViewAll(SoNode, SbViewportRegion)

Move the camera to view the scene defined by the given node.

Public methodViewAll(SoPath, SbViewportRegion)

Move the camera to view the scene defined by the given path.

Public methodViewAxis

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.

Public methodViewIn(SbBox3f)

Move camera to the center of the specified box.

Public methodViewIn(SoNode, SbViewportRegion)

Move camera to the center of the scene defined by the specified node.

Public methodViewIn(SoPath, SbViewportRegion)

Move camera to the center of the scene defined by the specified path.

Public methodViewX
Calls ViewX(false).
Public methodViewX(Boolean)

NOTE: The camera position is not changed, so the camera may not be looking toward the scene.

Public methodViewY
Calls ViewY(false).
Public methodViewY(Boolean)

Rotate camera to look parallel to the Y axis with +Z up.

Public methodViewZ
Calls ViewZ(false).
Public methodViewZ(Boolean)

Rotate camera to look parallel to the Z axis with +Y up.

Public methodZoom

Zoom - Makes the scene appear larger or smaller.

Public methodZoomInWindow

Zooms to the region defined by the given corners in normalized screen coordinates.

Top
Properties
  NameDescription
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Top
Remarks

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:

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

EXAMPLE

See Also