Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace double[] with Matrix4 #204

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

nka1994
Copy link
Contributor

@nka1994 nka1994 commented Nov 17, 2023

Description

Short description about this PR

Tasks done in this PR

  • Something awesome.
  • An evil bug have been defeted.
  • Code cleanup and maintenance has been done.

Related Issues / Pull Requests

  • Add the links of issues or PR related to this one.

Notes for reviewer

  • Things to consider during the review of this PR.

Copy link
Contributor

@DJGosnell DJGosnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking to reduce memory impacts where possible. Just one comment.

elements[14] = _objectReader.ReadBitDouble();
elements[15] = _objectReader.ReadBitDouble();

annotContext.TransformationMatrix = new Matrix4(elements);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would significantly reduce memory impact here (128 bytes for a double[16] per each object read) if you used the Matrix4 constructor below.
This is an an issue especially in this hot path because the double[] is just discarded anyway.

public Matrix4( double m00, double m10, double m20, double m30, double m01, double m11, double m21, double m31, double m02, double m12, double m22, double m32, double m03, double m13, double m23, double m33)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@DomCR DomCR linked an issue Nov 20, 2023 that may be closed by this pull request
@DomCR DomCR added the enhancement New feature or request label Nov 20, 2023
@DomCR
Copy link
Owner

DomCR commented Nov 20, 2023

Looks good! great work!

@DomCR DomCR merged commit 69f4555 into DomCR:master Nov 20, 2023
2 checks passed
@nka1994 nka1994 deleted the 20231117_mme_matrix4 branch November 21, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiLeader: Change Type of TransformationMatrix property to Matrix4
4 participants