Created
July 3, 2016 01:05
-
-
Save AndrewRayCode/493c213b3915acb3529a7afaf38ffbd1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import THREE from 'three'; | |
export default class Wall extends Component { | |
shouldComponentUpdate( nextProps ) { | |
return ( nextProps.position !== this.props.position ) || | |
( nextProps.rotation !== this.props.rotation ) || | |
( nextProps.quaternion !== this.props.quaternion ) || | |
( nextProps.scale !== this.props.scale ) || | |
( nextProps.materialId !== this.props.materialId ); | |
} | |
render() { | |
const { | |
position, rotation, quaternion, scale, materialId, | |
} = this.props; | |
return <group | |
position={ position } | |
quaternion={ quaternion } | |
rotation={ rotation } | |
scale={ scale } | |
> | |
<mesh | |
ref="mesh" | |
> | |
<geometryResource | |
resourceId="1x1box" | |
/> | |
<materialResource | |
resourceId={ materialId } | |
/> | |
</mesh> | |
</group>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment