Class ProjectionMatrix


  • public class ProjectionMatrix
    extends java.lang.Object
    projection matrix
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete()  
      EigenMatrix4d e()
      get the boost matrix corresponding to this projection
      pairDoubleDouble getClipPlanes()
      get near and far clipping plane
      static long getCPtr​(ProjectionMatrix obj)  
      boolean getFrustum​(double left, double right, double bottom, double top, double zNear, double zFar)
      get the projection matrix to the viewing frustum

      boolean getOrtho​(double left, double right, double bottom, double top, double zNear, double zFar)
      get ortographic projection.
      boolean getPerspective​(double fovy, double aspectRatio, double zNear, double zFar)
      set the projection matrix to perspective projection

      boolean isOrtographicProjection()
      test if this is a ortographic projection

      boolean isPerspectiveProjection()
      test if this is a perspective projection

      static ProjectionMatrix makeOrtho​(double left, double right, double bottom, double top, double zNear, double zFar)
      creates a projection matrix with a orthographic projection

      static ProjectionMatrix makePerspective​(double fovy, double aspectRatio, double zNear, double zFar)
      creates a projection matrix with a perspective projection

      static ProjectionMatrix makePerspective​(double fovy, double width, double height, double zNear, double zFar)
      creates a projection matrix with a perspective projection

      void setFrustum​(double left, double right, double bottom, double top, double zNear, double zFar)
      set the projection matrix to the viewing frustum

      void setOrtho​(double left, double right, double bottom, double top, double zNear, double zFar)
      set the projection matrix to an ortographic projection by defining
      the box with length to all sides (left, right, bottom, top, near and far)

      void setPerspective​(double fovy, double aspectRatio, double zNear, double zFar)
      set the projection matrix to perspective projection

      void setPerspective​(double fovy, double width, double height, double zNear, double zFar)
      set the projection matrix to perspective projection

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProjectionMatrix

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

        public ProjectionMatrix()
        constructor
    • Method Detail

      • delete

        public void delete()
      • e

        public EigenMatrix4d e()
        get the boost matrix corresponding to this projection
      • isPerspectiveProjection

        public boolean isPerspectiveProjection()
        test if this is a perspective projection

        Returns:
        true if perspective projection, false otherwise.
      • isOrtographicProjection

        public boolean isOrtographicProjection()
        test if this is a ortographic projection

        Returns:
        true if ortographic projection, false otherwise.
      • setOrtho

        public void setOrtho​(double left,
                             double right,
                             double bottom,
                             double top,
                             double zNear,
                             double zFar)
        set the projection matrix to an ortographic projection by defining
        the box with length to all sides (left, right, bottom, top, near and far)

        Parameters:
        left - [in] length in m to left edge of image
        right - [in] length in m to right edge of image
        bottom - [in] length in m to bottom edge of image
        top - [in] length in m to top edge of image
        zNear - [in] length in m to near clipping plane
        zFar - [in] length in m to far clipping plane
      • getOrtho

        public boolean getOrtho​(double left,
                                double right,
                                double bottom,
                                double top,
                                double zNear,
                                double zFar)
        get ortographic projection. Onli valid if isOrtographicProjection is true
      • setFrustum

        public void setFrustum​(double left,
                               double right,
                               double bottom,
                               double top,
                               double zNear,
                               double zFar)
        set the projection matrix to the viewing frustum

        Parameters:
        left - [in] distance in m near cutting plane from center to left edge
        right - [in] distance in m near cutting plane from center to right edge
        bottom - [in] distance in m near cutting plane from center to bottom edge
        top - [in] distance in m near cutting plane from center to top edge
        zNear - [in] distance in m along z-axis to near cutting plane
        zFar - [in] distance in m along z-axis to far cutting plane
      • getFrustum

        public boolean getFrustum​(double left,
                                  double right,
                                  double bottom,
                                  double top,
                                  double zNear,
                                  double zFar)
        get the projection matrix to the viewing frustum

        Parameters:
        left - [out] distance in m near cutting plane from center to left edge
        right - [out] distance in m near cutting plane from center to right edge
        bottom - [out] distance in m near cutting plane from center to bottom edge
        top - [out] distance in m near cutting plane from center to top edge
        zNear - [out] distance in m along z-axis to near cutting plane
        zFar - [out] distance in m along z-axis to far cutting plane
      • setPerspective

        public void setPerspective​(double fovy,
                                   double aspectRatio,
                                   double zNear,
                                   double zFar)
        set the projection matrix to perspective projection

        Parameters:
        fovy - [in] vertical field of view [degrees]
        aspectRatio - [in] aspect ratio between width and height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
      • setPerspective

        public void setPerspective​(double fovy,
                                   double width,
                                   double height,
                                   double zNear,
                                   double zFar)
        set the projection matrix to perspective projection

        Parameters:
        fovy - [in] vertical field of view [degrees]
        width - [in] width of image
        height - [in] height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
      • getPerspective

        public boolean getPerspective​(double fovy,
                                      double aspectRatio,
                                      double zNear,
                                      double zFar)
        set the projection matrix to perspective projection

        Parameters:
        fovy - [in] vertical field of view [degrees]
        aspectRatio - [in] aspect ratio between width and height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
      • makePerspective

        public static ProjectionMatrix makePerspective​(double fovy,
                                                       double aspectRatio,
                                                       double zNear,
                                                       double zFar)
        creates a projection matrix with a perspective projection

        Parameters:
        fovy - [in]
        aspectRatio - [in]
        zNear - [in]
        zFar - [in]
        Returns:
        new ProjectionMatrix.
      • makePerspective

        public static ProjectionMatrix makePerspective​(double fovy,
                                                       double width,
                                                       double height,
                                                       double zNear,
                                                       double zFar)
        creates a projection matrix with a perspective projection

        Parameters:
        fovy - [in]
        width - [in] of image
        height - [in] of image
        zNear - [in]
        zFar - [in]
        Returns:
        new ProjectionMatrix.
      • makeOrtho

        public static ProjectionMatrix makeOrtho​(double left,
                                                 double right,
                                                 double bottom,
                                                 double top,
                                                 double zNear,
                                                 double zFar)
        creates a projection matrix with a orthographic projection

        Parameters:
        left - [in]
        right - [in]
        bottom - [in]
        top - [in]
        zNear - [in]
        zFar - [in]
        Returns:
        new ProjectionMatrix.
      • getClipPlanes

        public pairDoubleDouble getClipPlanes()
        get near and far clipping plane
        Returns: