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

Remove optionalTarget: More clean up #13530

Merged
merged 3 commits into from
Mar 9, 2018
Merged

Remove optionalTarget: More clean up #13530

merged 3 commits into from
Mar 9, 2018

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 8, 2018

Follow up #13522

intersection.face = new Face3( a, b, c, Triangle.normal( vA, vB, vC ) );
var face = new Face3( a, b, c );

triangle.set( vA, vB, vC ).normal( faceNormal );
Copy link
Collaborator Author

@Mugen87 Mugen87 Mar 8, 2018

Choose a reason for hiding this comment

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

@WestLangley In context of BufferGeometry.center(), the semantics of Triangle.normal() is also problematic. It should be Triangle.getNormal(), right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I guess it should be Triangle.getNormal( a, b, c, target ) and Triangle.prototype.getNormal( a, b, c, target ).

Also barycoordFromPoint() -> getBarycoord().

Separate PR, though.

var face = new Face3( a, b, c );

triangle.set( vA, vB, vC ).normal( faceNormal );
face.normal.copy( faceNormal );
Copy link
Collaborator

Choose a reason for hiding this comment

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

In any event, you can write your existing code like so:

triangle.set( vA, vB, vC ).normal( face.normal );

Or, better yet:

Triangle.normal( vA, vB, vC, face.normal );

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Much better!

@mrdoob mrdoob added this to the r91 milestone Mar 9, 2018
@mrdoob mrdoob merged commit 1a0dc82 into mrdoob:dev Mar 9, 2018
@mrdoob
Copy link
Owner

mrdoob commented Mar 9, 2018

Thanks!

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Mar 9, 2018

I've checked all examples, the editor and the docs and found no more warnings so far 👍

@WestLangley
Copy link
Collaborator

Thanks, @Mugen87 !

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