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

Vectorize the covariance calculation #6098

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Conversation

kemchenj
Copy link
Contributor

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

nice, but even cleaner would be

    vec3 M0 = scale.x * rot[0];
    vec3 M1 = scale.y * rot[1];
    vec3 M2 = scale.z * rot[2];

    covA = vec3(
        dot(M0, M0),
        dot(M0, M1),
        dot(M0, M2)
    );

    covB = vec3(
        dot(M1, M1),
        dot(M1, M2),
        dot(M2, M2)
    );

@kemchenj
Copy link
Contributor Author

Thanks for the suggestion! I've implemented the change and it looks much cleaner now. Appreciate your feedback!

@kemchenj kemchenj closed this Feb 29, 2024
@slimbuck
Copy link
Member

Hi @kemchenj , did you mean to close this PR? Looks like a useful simplification.

@mvaligursky mvaligursky reopened this Feb 29, 2024
@mvaligursky mvaligursky merged commit 8ac33ba into playcanvas:main Feb 29, 2024
@mvaligursky
Copy link
Contributor

I merged this and it looks like this now (not correct)

Screenshot 2024-02-29 at 10 37 01

@kemchenj
Copy link
Contributor Author

Hi @kemchenj , did you mean to close this PR? Looks like a useful simplification.

Hi, yes, I did intend to close the PR because I realized the modification here was not correct. I was planning to fix it before reopening the PR, but it seems it has already been merged...

@mvaligursky
Copy link
Contributor

Hi.. I'm happy to accept a new PR that fixes it :)
Thanks!

@kemchenj
Copy link
Contributor Author

Hi.. I'm happy to accept a new PR that fixes it :) Thanks!

I opened a new PR to fix this #6100 🫣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants