Skip to content

Commit

Permalink
Add Matrix4x3.negateX/Y/Z()
Browse files Browse the repository at this point in the history
  • Loading branch information
httpdigest committed Oct 16, 2021
1 parent f37e8d5 commit b6edd37
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/org/joml/Matrix4x3d.java
Original file line number Diff line number Diff line change
Expand Up @@ -10026,6 +10026,57 @@ public Matrix4x3d mapZYX(Matrix4x3d dest) {
return dest._m00(m20)._m01(m21)._m02(m22)._m10(m10)._m11(m11)._m12(m12)._m20(m00)._m21(m01)._m22(m02)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* -1 0 0 0
* 0 1 0 0
* 0 0 1 0
* </pre>
*
* @return this
*/
public Matrix4x3d negateX() {
return _m00(-m00)._m01(-m01)._m02(-m02)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3d negateX(Matrix4x3d dest) {
return dest._m00(-m00)._m01(-m01)._m02(-m02)._m10(m10)._m11(m11)._m12(m12)._m20(m20)._m21(m21)._m22(m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 -1 0 0
* 0 0 1 0
* </pre>
*
* @return this
*/
public Matrix4x3d negateY() {
return _m10(-m10)._m11(-m11)._m12(-m12)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3d negateY(Matrix4x3d dest) {
return dest._m00(m00)._m01(m01)._m02(m02)._m10(-m10)._m11(-m11)._m12(-m12)._m20(m20)._m21(m21)._m22(m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 1 0 0
* 0 0 -1 0
* </pre>
*
* @return this
*/
public Matrix4x3d negateZ() {
return _m20(-m20)._m21(-m21)._m22(-m22)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3d negateZ(Matrix4x3d dest) {
return dest._m00(m00)._m01(m01)._m02(m02)._m10(m10)._m11(m11)._m12(m12)._m20(-m20)._m21(-m21)._m22(-m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

public boolean isFinite() {
return Math.isFinite(m00) && Math.isFinite(m01) && Math.isFinite(m02) &&
Math.isFinite(m10) && Math.isFinite(m11) && Math.isFinite(m12) &&
Expand Down
45 changes: 45 additions & 0 deletions src/org/joml/Matrix4x3dc.java
Original file line number Diff line number Diff line change
Expand Up @@ -3228,6 +3228,51 @@ public interface Matrix4x3dc {
*/
Matrix4x3d mapZYX(Matrix4x3d dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* -1 0 0 0
* 0 1 0 0
* 0 0 1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3d negateX(Matrix4x3d dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 -1 0 0
* 0 0 1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3d negateY(Matrix4x3d dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 1 0 0
* 0 0 -1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3d negateZ(Matrix4x3d dest);

/**
* Compare the matrix elements of <code>this</code> matrix with the given matrix using the given <code>delta</code>
* and return whether all of them are equal within a maximum difference of <code>delta</code>.
Expand Down
51 changes: 51 additions & 0 deletions src/org/joml/Matrix4x3f.java
Original file line number Diff line number Diff line change
Expand Up @@ -9202,6 +9202,57 @@ public Matrix4x3f mapZYX(Matrix4x3f dest) {
return dest._m00(m20)._m01(m21)._m02(m22)._m10(m10)._m11(m11)._m12(m12)._m20(m00)._m21(m01)._m22(m02)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* -1 0 0 0
* 0 1 0 0
* 0 0 1 0
* </pre>
*
* @return this
*/
public Matrix4x3f negateX() {
return _m00(-m00)._m01(-m01)._m02(-m02)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3f negateX(Matrix4x3f dest) {
return dest._m00(-m00)._m01(-m01)._m02(-m02)._m10(m10)._m11(m11)._m12(m12)._m20(m20)._m21(m21)._m22(m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 -1 0 0
* 0 0 1 0
* </pre>
*
* @return this
*/
public Matrix4x3f negateY() {
return _m10(-m10)._m11(-m11)._m12(-m12)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3f negateY(Matrix4x3f dest) {
return dest._m00(m00)._m01(m01)._m02(m02)._m10(-m10)._m11(-m11)._m12(-m12)._m20(m20)._m21(m21)._m22(m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 1 0 0
* 0 0 -1 0
* </pre>
*
* @return this
*/
public Matrix4x3f negateZ() {
return _m20(-m20)._m21(-m21)._m22(-m22)._properties(properties & PROPERTY_ORTHONORMAL);
}
public Matrix4x3f negateZ(Matrix4x3f dest) {
return dest._m00(m00)._m01(m01)._m02(m02)._m10(m10)._m11(m11)._m12(m12)._m20(-m20)._m21(-m21)._m22(-m22)._m30(m30)._m31(m31)._m32(m32)._properties(properties & PROPERTY_ORTHONORMAL);
}

public boolean isFinite() {
return Math.isFinite(m00) && Math.isFinite(m01) && Math.isFinite(m02) &&
Math.isFinite(m10) && Math.isFinite(m11) && Math.isFinite(m12) &&
Expand Down
45 changes: 45 additions & 0 deletions src/org/joml/Matrix4x3fc.java
Original file line number Diff line number Diff line change
Expand Up @@ -2976,6 +2976,51 @@ public interface Matrix4x3fc {
*/
Matrix4x3f mapZYX(Matrix4x3f dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* -1 0 0 0
* 0 1 0 0
* 0 0 1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3f negateX(Matrix4x3f dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 -1 0 0
* 0 0 1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3f negateY(Matrix4x3f dest);

/**
* Multiply <code>this</code> by the matrix
* <pre>
* 1 0 0 0
* 0 1 0 0
* 0 0 -1 0
* </pre>
* and store the result in <code>dest</code>.
*
* @param dest
* will hold the result
* @return dest
*/
Matrix4x3f negateZ(Matrix4x3f dest);

/**
* Compare the matrix elements of <code>this</code> matrix with the given matrix using the given <code>delta</code>
* and return whether all of them are equal within a maximum difference of <code>delta</code>.
Expand Down

0 comments on commit b6edd37

Please sign in to comment.