Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 24, 2020

After 21e3eab, serialization/deserialization is now easy to add.

Light.prototype.copy.call( this, source );

this.sh.copy( source.sh );
this.intensity = source.intensity;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

intensity is already copied in Light.copy().

Copy link
Owner

Choose a reason for hiding this comment

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

As a FYI, seems like @WestLangley is thinking of removing that inheritance. #18371 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for sharing, good to know! Should I keep the code as it is now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so -- for now.

@mrdoob
Copy link
Owner

mrdoob commented Mar 25, 2020

After 21e3eab, serialization/deserialization is now easy to add.

I forgot I did that. 👴

var data = Light.prototype.toJSON.call( this, meta );

// data.sh = this.sh.toArray(); // todo
data.object.sh = this.sh.toArray();
Copy link
Owner

Choose a reason for hiding this comment

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

data.object.sh?

Copy link
Collaborator Author

@Mugen87 Mugen87 Mar 25, 2020

Choose a reason for hiding this comment

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

Yes, check out Light.toJSON():

data.object.intensity = this.intensity;

@mrdoob mrdoob added this to the r116 milestone Apr 3, 2020
@mrdoob mrdoob merged commit d26c835 into mrdoob:dev Apr 3, 2020
@mrdoob
Copy link
Owner

mrdoob commented Apr 3, 2020

Thanks!

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