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

src/textures: move to es6 classes #20009

Merged
merged 16 commits into from
Feb 20, 2021

Conversation

DefinitelyMaybe
Copy link
Contributor

No description provided.

@DefinitelyMaybe DefinitelyMaybe changed the title move to es6 classes src/textures: move to es6 classes Aug 4, 2020
@DefinitelyMaybe DefinitelyMaybe mentioned this pull request Aug 4, 2020
43 tasks
src/textures/Texture.js Outdated Show resolved Hide resolved
src/textures/Texture.js Outdated Show resolved Hide resolved
@mrdoob mrdoob added this to the r120 milestone Aug 17, 2020
@mrdoob mrdoob modified the milestones: r120, r121 Aug 23, 2020
@mrdoob mrdoob modified the milestones: r121, r122 Sep 29, 2020
@mrdoob mrdoob modified the milestones: r122, r123 Oct 28, 2020
@DefinitelyMaybe
Copy link
Contributor Author

conflicts resolved

@mrdoob mrdoob modified the milestones: r123, r124 Nov 25, 2020
@mrdoob mrdoob modified the milestones: r124, r125 Dec 24, 2020
@mrdoob mrdoob modified the milestones: r125, r126 Jan 27, 2021
@mrdoob
Copy link
Owner

mrdoob commented Feb 3, 2021

There seem to be linter issues on this one.

@mrdoob
Copy link
Owner

mrdoob commented Feb 4, 2021

Thanks for fixing the linter errors.
There seem to be a few more though: 'serializeImage' is not defined.

@DefinitelyMaybe
Copy link
Contributor Author

oops. serializeImage -> this.serializeImage. one sec.

src/textures/Texture.js Outdated Show resolved Hide resolved
@DefinitelyMaybe DefinitelyMaybe marked this pull request as draft February 6, 2021 09:14
src/textures/Texture.js Outdated Show resolved Hide resolved
Comment on lines -62 to +75
this.encoding = encoding;
this.offset = new Vector2( 0, 0 );
this.repeat = new Vector2( 1, 1 );
this.center = new Vector2( 0, 0 );
this.rotation = 0;

this.version = 0;
this.onUpdate = null;
this.matrixAutoUpdate = true;
this.matrix = new Matrix3();

}
// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
//
// Also changing the encoding after already used by a Material will not automatically make the Material
// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
this.encoding = encoding;

Texture.DEFAULT_IMAGE = undefined;
Texture.DEFAULT_MAPPING = UVMapping;
this.generateMipmaps = true;
this.premultiplyAlpha = false;
this.flipY = true;
this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)

Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
//
// Also changing the encoding after already used by a Material will not automatically make the Material
// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
this.encoding = encoding !== undefined ? encoding : LinearEncoding;
Copy link
Owner

Choose a reason for hiding this comment

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

Something change here...

Comment on lines +60 to 65
// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
//
// Also changing the encoding after already used by a Material will not automatically make the Material
// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
this.encoding = encoding;

Copy link
Owner

Choose a reason for hiding this comment

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

This part seems to be duplicated.

@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2021

Some minor things. I'll merge and clean that up.

@mrdoob mrdoob merged commit cb8a6c5 into mrdoob:dev Feb 20, 2021
@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2021

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2021

b11c858

@DefinitelyMaybe
Copy link
Contributor Author

Some minor things. I'll merge and clean that up.

thank you 👍

@mrdoob
Copy link
Owner

mrdoob commented Feb 22, 2021

Looks like the class properties introduced in this PR broke all examples in Safari.

@mrdoob
Copy link
Owner

mrdoob commented Feb 22, 2021

e7ba155

@DefinitelyMaybe DefinitelyMaybe deleted the src/textures--move-to-es6-classes branch February 23, 2021 20:32
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.

4 participants