Package org.robwork.sdurw_math
Class ProjectionMatrix
- java.lang.Object
-
- org.robwork.sdurw_math.ProjectionMatrix
-
public class ProjectionMatrix extends java.lang.Object
projection matrix
-
-
Constructor Summary
Constructors Constructor Description ProjectionMatrix()
constructorProjectionMatrix(long cPtr, boolean cMemoryOwn)
-
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 projectionpair_d_d
getClipPlanes()
get near and far clipping planestatic long
getCPtr(ProjectionMatrix obj)
boolean
getFrustum(SWIGTYPE_p_double left, SWIGTYPE_p_double right, SWIGTYPE_p_double bottom, SWIGTYPE_p_double top, SWIGTYPE_p_double zNear, SWIGTYPE_p_double zFar)
get the projection matrix to the viewing frustumboolean
getOrtho(SWIGTYPE_p_double left, SWIGTYPE_p_double right, SWIGTYPE_p_double bottom, SWIGTYPE_p_double top, SWIGTYPE_p_double zNear, SWIGTYPE_p_double zFar)
get ortographic projection.boolean
getPerspective(SWIGTYPE_p_double fovy, SWIGTYPE_p_double aspectRatio, SWIGTYPE_p_double zNear, SWIGTYPE_p_double zFar)
get the projection matrix to perspective projectionboolean
isOrtographicProjection()
test if this is a ortographic projectionboolean
isPerspectiveProjection()
test if this is a perspective projectionstatic ProjectionMatrix
makeOrtho(double left, double right, double bottom, double top, double zNear, double zFar)
creates a projection matrix with a orthographic projectionstatic ProjectionMatrix
makePerspective(double fovy, double aspectRatio, double zNear, double zFar)
creates a projection matrix with a perspective projectionstatic ProjectionMatrix
makePerspective(double fovy, double width, double height, double zNear, double zFar)
creates a projection matrix with a perspective projectionvoid
setFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
set the projection matrix to the viewing frustumvoid
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 projectionvoid
setPerspective(double fovy, double width, double height, double zNear, double zFar)
set the projection matrix to perspective projection
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(ProjectionMatrix obj)
-
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
-
isOrtographicProjection
public boolean isOrtographicProjection()
test if this is a ortographic projection
-
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 imageright
- [in] length in m to right edge of imagebottom
- [in] length in m to bottom edge of imagetop
- [in] length in m to top edge of imagezNear
- [in] length in m to near clipping planezFar
- [in] length in m to far clipping plane
-
getOrtho
public boolean getOrtho(SWIGTYPE_p_double left, SWIGTYPE_p_double right, SWIGTYPE_p_double bottom, SWIGTYPE_p_double top, SWIGTYPE_p_double zNear, SWIGTYPE_p_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 edgeright
- [in] distance in m near cutting plane from center to right edgebottom
- [in] distance in m near cutting plane from center to bottom edgetop
- [in] distance in m near cutting plane from center to top edgezNear
- [in] distance in m along z-axis to near cutting planezFar
- [in] distance in m along z-axis to far cutting plane
-
getFrustum
public boolean getFrustum(SWIGTYPE_p_double left, SWIGTYPE_p_double right, SWIGTYPE_p_double bottom, SWIGTYPE_p_double top, SWIGTYPE_p_double zNear, SWIGTYPE_p_double zFar)
get the projection matrix to the viewing frustum- Parameters:
left
- [out] distance in m near cutting plane from center to left edgeright
- [out] distance in m near cutting plane from center to right edgebottom
- [out] distance in m near cutting plane from center to bottom edgetop
- [out] distance in m near cutting plane from center to top edgezNear
- [out] distance in m along z-axis to near cutting planezFar
- [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 imagezNear
- [in] distance to near cutting planezFar
- [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 imageheight
- [in] height of imagezNear
- [in] distance to near cutting planezFar
- [in] distance to far cutting plane
-
getPerspective
public boolean getPerspective(SWIGTYPE_p_double fovy, SWIGTYPE_p_double aspectRatio, SWIGTYPE_p_double zNear, SWIGTYPE_p_double zFar)
get the projection matrix to perspective projection- Parameters:
fovy
- [in] vertical field of view [degrees]aspectRatio
- [in] aspect ratio between width and height of imagezNear
- [in] distance to near cutting planezFar
- [in] distance to far cutting plane- Returns:
- is it succesfull
-
makePerspective
public static ProjectionMatrix makePerspective(double fovy, double aspectRatio, double zNear, double zFar)
creates a projection matrix with a perspective projection- Parameters:
fovy
-aspectRatio
-zNear
-zFar
-- 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 imageheight
- [in] of imagezNear
- [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
-right
-bottom
-top
-zNear
-zFar
-- Returns:
- new ProjectionMatrix.
-
getClipPlanes
public pair_d_d getClipPlanes()
get near and far clipping plane- Returns:
-
-