Skip to content

Commit

Permalink
Optimize Vector3f matrix multiply methods taking into account matrix …
Browse files Browse the repository at this point in the history
…properties (#337)

- mulProject() now takes into account identity, translation and affine
- new method mulProjectTranslation() when assuming translation
- new method mulProjectAffine() when assuming affine
- new method mulProjectGeneric() when not assuming (and also not testing for) properties
- mulPosition() now takes into account identity and translation
- new method mulPositionTranslation() when assuming translation
- new method mulPositionGeneric() when not assuming (and also not testing for) properties
  • Loading branch information
httpdigest committed Jul 15, 2023
1 parent afb0e79 commit 534d472
Show file tree
Hide file tree
Showing 3 changed files with 847 additions and 28 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/joml/Vector3d.java
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,17 @@ public Vector3d mulPosition(Matrix4x3fc mat) {
return mulPositionTranslation(mat, this);
return mulPositionGeneric(mat, this);
}
/**
* Multiply the given 4x3 matrix <code>mat</code>, representing only a translation, with <code>this</code>.
* <p>
* This method only works when <code>mat</code> only represents a translation.
* <p>
* This method assumes the <code>w</code> component of <code>this</code> to be <code>1.0</code>.
*
* @param mat
* the matrix to multiply this vector by
* @return this
*/
public Vector3d mulPositionTranslation(Matrix4x3fc mat) {
return mulPositionTranslation(mat, this);
}
Expand Down
Loading

0 comments on commit 534d472

Please sign in to comment.