-
Notifications
You must be signed in to change notification settings - Fork 120
-
Notifications
You must be signed in to change notification settings - Fork 120
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
assert for Mesh material check doesn't let THREE.MeshFaceMaterial work #296
Comments
i would say the bug is in three.js :) because i think all material should inherit from THREE.Material but it would not help you much. i will simply change the assert |
there tell me if it fit your need |
Thank you very much, but actually the main benefit would come from editing here so that it will work simply using By the way, you're right: the problem seems to be about THREE.MeshFaceMaterial prototype definition, since there is no prototype inheritance: THREE.MeshFaceMaterial = function ( materials ) {
this.materials = materials instanceof Array ? materials : [];
};
THREE.MeshFaceMaterial.prototype.clone = function () {
return new THREE.MeshFaceMaterial( this.materials.slice( 0 ) );
}; There should be something similar to I know that adding multiple inheritance checks all around the library is not very elegant, I will report this issue asap. Thank you again |
i did it this way to reduce the 'spreading bug workaround' effect you talked about |
If you check the issue I've opened, it looks like it is an intended behaviour, since I don't think they're going to make it inherit from |
This check doesn't allow me to use THREE.MeshFaceMaterial with a cube instance:
And actually the same happens here: without it I could directly call
createCube(multipleMaterial)
.It looks like
instanceof
does not work well as a check here.Is it a bug or an intended limitation?
Thank you
The text was updated successfully, but these errors were encountered: