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

Fix geometry.mergeMesh & merge check bug #11451

Merged
merged 2 commits into from
Jun 6, 2017
Merged

Conversation

06wj
Copy link
Contributor

@06wj 06wj commented Jun 6, 2017

(mesh && mesh.isMesh) will return mesh.isMesh, it maybe undefined.
(geometry && geometry.isGeometry) is the same situation.

@06wj 06wj changed the title Fix geometry.mergeMesh determine mesh bug Fix geometry.mergeMesh & merge check bug Jun 6, 2017
@@ -700,7 +700,7 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {

merge: function ( geometry, matrix, materialIndexOffset ) {

if ( ( geometry && geometry.isGeometry ) === false ) {
if ( !geometry || !geometry.isGeometry ) {
Copy link
Collaborator

@WestLangley WestLangley Jun 6, 2017

Choose a reason for hiding this comment

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

Personally, I prefer this pattern:

if ( ! ( geometry && geometry.isGeometry ) ) {

Copy link
Owner

Choose a reason for hiding this comment

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

Will change.

@mrdoob mrdoob merged commit ae5d419 into mrdoob:dev Jun 6, 2017
@mrdoob
Copy link
Owner

mrdoob commented Jun 6, 2017

Thanks!

mrdoob added a commit that referenced this pull request Jun 6, 2017
@06wj 06wj deleted the patch-geometry branch June 7, 2017 02:35
@06wj 06wj mentioned this pull request Jun 7, 2017
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