Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created November 12, 2017 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRayCode/06a05b8a533d4b41d425ec86fbffa66f to your computer and use it in GitHub Desktop.
Save AndrewRayCode/06a05b8a533d4b41d425ec86fbffa66f to your computer and use it in GitHub Desktop.
shouldComponentUpdate( nextProps ) {
const { group, } = this.refs;
if( group ) {
if( nextProps.position ) {
group.position.copy( nextProps.position );
}
if( nextProps.rotation ) {
group.rotation.copy( nextProps.rotation );
}
if( nextProps.quaternion ) {
group.quaternion.copy( nextProps.quaternion );
}
if( nextProps.scale ) {
group.scale.copy( nextProps.scale );
}
if( nextProps.materialIds !== this.props.materialIds ) {
this._updateMaterials( nextProps.materialIds );
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment