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

Core: More usage of addScaledVector(). #25543

Merged
merged 1 commit into from
Feb 23, 2023
Merged

Conversation

ycw
Copy link
Contributor

@ycw ycw commented Feb 21, 2023

Two impls of V=P+tD:

V.copy(D).multiplyScalar(t).add(P) // A
V.copy(P).addScaledVector(D,t)  // B

B is faster by this benchmark, this PR transforms A to B

@Mugen87 Mugen87 added this to the r150 milestone Feb 22, 2023
Copy link
Collaborator

@Mugen87 Mugen87 left a comment

Choose a reason for hiding this comment

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

Makes the code also more readable 👍 .

@Mugen87 Mugen87 changed the title Add scaled vector in one go Core: More usage of addScaledVector(). Feb 22, 2023
@mrdoob mrdoob merged commit ab2e7d5 into mrdoob:dev Feb 23, 2023
@ycw ycw deleted the addscaledvector-in1go branch February 24, 2023 07:57
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