logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoCamera — abstract base class for camera nodes

Description

       This  is  the abstract base class for all camera nodes. It defines the common methods and fields that all
       cameras have. Cameras are used to view a scene. When a camera is encountered during  rendering,  it  sets
       the projection and viewing matrices and viewport appropriately; it does not draw geometry. Cameras should
       be  placed  before  any  shape  nodes  or light nodes in a scene graph; otherwise, those shapes or lights
       cannot be rendered properly. Cameras are affected by the current transformation, so you  can  position  a
       camera  by  placing  a  transformation  node  before  it  in  the  scene graph . The default position and
       orientation of a camera is at (0,0,1) looking along the negative z-axis.

       You can also use a node kit to create a camera; see the reference page for SoCameraKit.

Fields

SoSFEnumviewportMapping
          Defines how to map the rendered image into the current viewport, when the aspect ratio of  the  camera
          differs from that of the viewport.

     SoSFVec3fposition
          The location of the camera viewpoint.

     SoSFRotationorientation
          The  orientation  of  the  camera  viewpoint,  defined as a rotation of the viewing direction from its
          default (0,0,-1) vector.

     SoSFFloataspectRatio
          The ratio of camera viewing width to height. This value must be greater than 0.0.  There  are  several
          standard camera aspect ratios defined in SoCamera.h.

     SoSFFloatnearDistanceSoSFFloatfarDistance
          The distance from the camera viewpoint to the near and far clipping planes.

     SoSFFloatfocalDistance
          The distance from the viewpoint to the point of focus. This is typically ignored during rendering, but
          may be used by some viewers to define a point of interest.

File Format/Defaults

       This is an abstract class. See the reference page of a derived class for the format and default values.

Inherits From

       SoBase > SoFieldContainer > SoNode > SoCamera

Methods

voidpointAt(constSbVec3f&targetPoint)
          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 y-axis. If this is not  possible,  it  uses  the
          positive z-axis as "up."

     virtualvoidscaleHeight(floatscaleFactor)
          Scales  the height of the camera. Perspective cameras scale their heightAngle fields, and orthographic
          cameras scale their height fields.

     virtualSbViewVolumegetViewVolume(floatuseAspectRatio=0.0)const
          Returns a view volume structure, based on the  camera's  viewing  parameters.  If  the  useAspectRatio
          argument is not 0.0 (the default), the camera uses that ratio instead of the one it has.

     voidviewAll(SoNode*sceneRoot,constSbViewportRegion&vpRegion,floatslack=1.0)voidviewAll(SoPath*path,constSbViewportRegion&vpRegion,floatslack=1.0)
          Sets  the camera to view the scene rooted by the given node or defined by the given path. The near and
          far clipping planes will be positioned slack bounding  sphere  radii  away  from  the  bounding  box's
          center. A value of 1.0 will make the clipping planes the tightest around the bounding sphere.

     SbViewportRegiongetViewportBounds(constSbViewportRegion&region)const
          Returns the viewport region this camera would use to render into the given viewport region, accounting
          for cropping.

     staticSoTypegetClassTypeId()
          Returns type identifier for this class.

Name

       SoCamera — abstract base class for camera nodes

See Also

SoOrthographicCamera,SoPerspectiveCamera,SoCameraKitSoCamera(3IV)()

Synopsis

#include<Inventor/nodes/SoCamera.h>#defineSO_ASPECT_SQUARE1.00#defineSO_ASPECT_VIDEO1.333333333#defineSO_ASPECT_35mm_ACADEMY1.371#defineSO_ASPECT_16mm1.369#defineSO_ASPECT_35mm_FULL1.33333#defineSO_ASPECT_70mm2.287#defineSO_ASPECT_CINEMASCOPE2.35#defineSO_ASPECT_HDTV1.777777777#defineSO_ASPECT_PANAVISION2.361#defineSO_ASPECT_35mm1.5#defineSO_ASPECT_VISTAVISION2.301enumViewportMapping{SoCamera::CROP_VIEWPORT_FILL_FRAME
                                   Crops  the  viewport  within  the  current  window,  so that the aspect ratio
                                        matches that of the camera. As the window size changes, the aspect ratio
                                        remains unchanged. The cropped region is drawn as a filled gray area.
          SoCamera::CROP_VIEWPORT_LINE_FRAME
                                   Crops the viewport, but draws a thin frame around the viewport
          SoCamera::CROP_VIEWPORT_NO_FRAME
                                   Crops the  viewport,  but  gives  no  visual  feedback  as  to  the  viewport
                                        dimensions within the window
          SoCamera::ADJUST_CAMERA  Adjusts  the  camera  aspect ratio and height to make it fit within the given
                                        window. (The camera's fields are not affected, just the values  sent  to
                                        the graphics library.)
          SoCamera::LEAVE_ALONE    Do nothing. Camera image may become stretched out of proportion
     }

          Fields from class SoCamera:

     SoSFEnumviewportMappingSoSFVec3fpositionSoSFRotationorientationSoSFFloataspectRatioSoSFFloatnearDistanceSoSFFloatfarDistanceSoSFFloatfocalDistance

          Methods from class SoCamera:

     voidpointAt(constSbVec3f&targetPoint)virtualvoidscaleHeight(floatscaleFactor)virtualSbViewVolumegetViewVolume(floatuseAspectRatio=0.0)constvoidviewAll(SoNode*sceneRoot,constSbViewportRegion&vpRegion,floatslack=1.0)voidviewAll(SoPath*path,constSbViewportRegion&vpRegion,floatslack=1.0)SbViewportRegiongetViewportBounds(constSbViewportRegion&region)conststaticSoTypegetClassTypeId()

          Methods from class SoNode:

     voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)

          Methods from class SoFieldContainer:

     voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)

          Methods from class SoBase:

     voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const

See Also