Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created Nov 12, 2017
Embed
What would you like to do?
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