Skip to content

Commit

Permalink
Fix parameters of Matrix4.setPerspectiveOffCenterFov()
Browse files Browse the repository at this point in the history
  • Loading branch information
httpdigest committed Jan 12, 2022
1 parent aad9dfc commit 82539ae
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
35 changes: 18 additions & 17 deletions src/org/joml/Matrix4d.java
Original file line number Diff line number Diff line change
Expand Up @@ -13057,8 +13057,8 @@ public Matrix4d setPerspectiveOffCenter(double fovy, double offAngleX, double of
}

/**
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed
* coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>.
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed coordinate
* system using OpenGL's NDC z range of <code>[-1..+1]</code>.
* <p>
* The given angles <code>angleLeft</code> and <code>angleRight</code> are the horizontal angles between
* the left and right frustum planes, respectively, and a line perpendicular to the near and far frustum planes.
Expand All @@ -13070,27 +13070,28 @@ public Matrix4d setPerspectiveOffCenter(double fovy, double offAngleX, double of
*
* @see #perspectiveOffCenterFov(double, double, double, double, double, double)
*
* @param fovy
* the vertical field of view in radians (must be greater than zero and less than {@link Math#PI PI})
* @param offAngleX
* the horizontal angle between the line of sight and the line crossing the center of the near and far frustum planes
* @param offAngleY
* the vertical angle between the line of sight and the line crossing the center of the near and far frustum planes
* @param aspect
* the aspect ratio (i.e. width / height; must be greater than zero)
* @param angleLeft
* the horizontal angle between left frustum plane and a line perpendicular to the near/far frustum planes.
* For a symmetric frustum, this value is negative.
* @param angleRight
* the horizontal angle between right frustum plane and a line perpendicular to the near/far frustum planes
* @param angleDown
* the vertical angle between bottom frustum plane and a line perpendicular to the near/far frustum planes.
* For a symmetric frustum, this value is negative.
* @param angleUp
* the vertical angle between top frustum plane and a line perpendicular to the near/far frustum planes
* @param zNear
* near clipping plane distance. This value must be greater than zero.
* If the special value {@link Double#POSITIVE_INFINITY} is used, the near clipping plane will be at positive infinity.
* In that case, <code>zFar</code> may not also be {@link Double#POSITIVE_INFINITY}.
* If the special value {@link Float#POSITIVE_INFINITY} is used, the near clipping plane will be at positive infinity.
* In that case, <code>zFar</code> may not also be {@link Float#POSITIVE_INFINITY}.
* @param zFar
* far clipping plane distance. This value must be greater than zero.
* If the special value {@link Double#POSITIVE_INFINITY} is used, the far clipping plane will be at positive infinity.
* In that case, <code>zNear</code> may not also be {@link Double#POSITIVE_INFINITY}.
* If the special value {@link Float#POSITIVE_INFINITY} is used, the far clipping plane will be at positive infinity.
* In that case, <code>zNear</code> may not also be {@link Float#POSITIVE_INFINITY}.
* @return this
*/
public Matrix4d setPerspectiveOffCenterFov(double fovy, double offAngleX, double offAngleY,
double aspect, double zNear, double zFar) {
return setPerspectiveOffCenterFov(fovy, offAngleX, offAngleY, aspect, zNear, zFar, false);
public Matrix4d setPerspectiveOffCenterFov(double angleLeft, double angleRight, double angleDown, double angleUp, double zNear, double zFar) {
return setPerspectiveOffCenterFov(angleLeft, angleRight, angleDown, angleUp, zNear, zFar, false);
}
/**
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed coordinate system
Expand Down
27 changes: 14 additions & 13 deletions src/org/joml/Matrix4f.java
Original file line number Diff line number Diff line change
Expand Up @@ -10141,8 +10141,8 @@ public Matrix4f setPerspectiveOffCenter(float fovy, float offAngleX, float offAn
}

/**
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed
* coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>.
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed coordinate
* system using OpenGL's NDC z range of <code>[-1..+1]</code>.
* <p>
* The given angles <code>angleLeft</code> and <code>angleRight</code> are the horizontal angles between
* the left and right frustum planes, respectively, and a line perpendicular to the near and far frustum planes.
Expand All @@ -10154,14 +10154,16 @@ public Matrix4f setPerspectiveOffCenter(float fovy, float offAngleX, float offAn
*
* @see #perspectiveOffCenterFov(float, float, float, float, float, float)
*
* @param fovy
* the vertical field of view in radians (must be greater than zero and less than {@link Math#PI PI})
* @param offAngleX
* the horizontal angle between the line of sight and the line crossing the center of the near and far frustum planes
* @param offAngleY
* the vertical angle between the line of sight and the line crossing the center of the near and far frustum planes
* @param aspect
* the aspect ratio (i.e. width / height; must be greater than zero)
* @param angleLeft
* the horizontal angle between left frustum plane and a line perpendicular to the near/far frustum planes.
* For a symmetric frustum, this value is negative.
* @param angleRight
* the horizontal angle between right frustum plane and a line perpendicular to the near/far frustum planes
* @param angleDown
* the vertical angle between bottom frustum plane and a line perpendicular to the near/far frustum planes.
* For a symmetric frustum, this value is negative.
* @param angleUp
* the vertical angle between top frustum plane and a line perpendicular to the near/far frustum planes
* @param zNear
* near clipping plane distance. This value must be greater than zero.
* If the special value {@link Float#POSITIVE_INFINITY} is used, the near clipping plane will be at positive infinity.
Expand All @@ -10172,9 +10174,8 @@ public Matrix4f setPerspectiveOffCenter(float fovy, float offAngleX, float offAn
* In that case, <code>zNear</code> may not also be {@link Float#POSITIVE_INFINITY}.
* @return this
*/
public Matrix4f setPerspectiveOffCenterFov(float fovy, float offAngleX, float offAngleY,
float aspect, float zNear, float zFar) {
return setPerspectiveOffCenterFov(fovy, offAngleX, offAngleY, aspect, zNear, zFar, false);
public Matrix4f setPerspectiveOffCenterFov(float angleLeft, float angleRight, float angleDown, float angleUp, float zNear, float zFar) {
return setPerspectiveOffCenterFov(angleLeft, angleRight, angleDown, angleUp, zNear, zFar, false);
}
/**
* Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed coordinate system
Expand Down

0 comments on commit 82539ae

Please sign in to comment.