Class SceneCamera

  • public class SceneCamera
    extends SceneNode
    Node representing a camera in the scene. A SceneCamera sets up everything
    from rendering buffer to perspective transform.
    • Constructor Detail

      • SceneCamera

        public SceneCamera​(long cPtr,
                           boolean cMemoryOwn)
      • SceneCamera

        public SceneCamera​(java.lang.String name,
                           SceneNodePtr subGraph)
        name - [in] name of camera
        subGraph - [in] the root of the subgraph that this camera is supposed to render.
    • Method Detail

      • getCPtr

        public static long getCPtr​(SceneCamera obj)
      • setPerspective

        public void setPerspective​(double fov,
                                   int w,
                                   int h,
                                   double zNear,
                                   double zFar)
        sets the projection matrix of this camera to be a perspective projection
        fov - [in] field of view in radians.
        w - [in] view width
        h - [in] view height
        zNear - [in] near clipping plane
        zFar - [in] far clipping plane
      • getProjectionMatrix

        public ProjectionMatrix getProjectionMatrix()
        gets the projection matrix
        the current camera projection matrix
      • setProjectionMatrix

        public void setProjectionMatrix​(ProjectionMatrix matrix)
        sets the current camera projection matrix
        matrix - [in] a projection matrix
      • setViewport

        public void setViewport​(int x,
                                int y,
                                int width,
                                int height)
        set viewport settings
      • setClearBufferEnabled

        public void setClearBufferEnabled​(boolean enabled)
        set to true if the render buffer should be cleared before drawing
      • isClearBufferEnabled

        public boolean isClearBufferEnabled()
        test if buffers is cleared before drawing
      • setClearBufferMask

        public void setClearBufferMask​(int mask)
        choose which buffers that should be cleared
      • getClearBufferMask

        public int getClearBufferMask()
        get the clear buffer mask that describe which buffers are cleared before drawing
      • setDepthTestEnabled

        public void setDepthTestEnabled​(boolean enabled)
        enable or disable the use of depth tests (depth buffer)
      • isDepthTestEnabled

        public boolean isDepthTestEnabled()
        test if depth testing is enabled
      • setLightningEnabled

        public void setLightningEnabled​(boolean enabled)
        enable or disable the use of lightning
      • isLightningEnabled

        public boolean isLightningEnabled()
        test if lightning is enabled
      • getRefNode

        public SceneNodePtr getRefNode()
        get the reference node
      • setRefNode

        public void setRefNode​(SceneNodePtr snode)
        set the reference node of the camera
      • isEnabled

        public boolean isEnabled()
        test if this camera is enabled
      • setEnabled

        public void setEnabled​(boolean enabled)
        enable or disable this camera
      • asCameraNode

        public SceneCamera asCameraNode()
        Description copied from class: SceneNode
        Get a pointer to a CameraNode, if this is a CameraNode.
        asCameraNode in class SceneNode
        a pointer, or NULL if the SceneNode is not of correct type.
      • setTransform

        public void setTransform​(Transform3D t3d)
        set the camera transform relative to reference node (getRefNode)
      • getTransform

        public Transform3D getTransform()
        get the camera transform
      • setAspectRatioControl

        public void setAspectRatioControl​(SceneCamera.AspectRatioControl control)
        Change the mode for aspect ratio control.
        control - [in] new mode.
      • getAspectRatioControl

        public SceneCamera.AspectRatioControl getAspectRatioControl()
        Get current mode of aspect ratio control.
        the current mode.
      • setDrawMask

        public void setDrawMask​(int mask)
        set the mask used when drawing in the scene
        mask - [in] The draw mask - see DrawableNode::DrawableTypeMask.
      • getDrawMask

        public int getDrawMask()
        Get the mask used when drawing in the scene
        the draw mask - see DrawableNode::DrawableTypeMask.
      • getName

        public java.lang.String getName()
        get the camera name
        getName in class SceneNode
        camera name
      • attachTo

        public void attachTo​(SceneNodePtr snode)
        Attach camera to scene node.
        snode - [in] node to attach to.
      • getAttachedNode

        public SceneNodePtr getAttachedNode()
        Get the node attached to.
        the node.
      • getAspectRatio

        public double getAspectRatio()
        Get the aspect ratio.
        the aspect ratio.