From da52161619bd29c02486a89e1c91c45c98a75b96 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 29 Sep 2015 18:08:26 -0400 Subject: [PATCH] BufferGeometry.updateFromObject() uvs handling. Thanks @WestLangley. See #7179. --- src/core/BufferGeometry.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index 46ba5237bb..6ea7c0b89a 100644 --- a/src/core/BufferGeometry.js +++ b/src/core/BufferGeometry.js @@ -329,7 +329,7 @@ THREE.BufferGeometry.prototype = { var lineDistances = new THREE.Float32Attribute( geometry.lineDistances.length, 1 ); - this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) ); + this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) ); } @@ -434,6 +434,21 @@ THREE.BufferGeometry.prototype = { } + if ( geometry.uvsNeedUpdate ) { + + var attribute = this.attributes.uv; + + if ( attribute !== undefined ) { + + attribute.copyVector2sArray( geometry.uvs ); + attribute.needsUpdate = true; + + } + + geometry.uvsNeedUpdate = false; + + } + if ( geometry.lineDistancesNeedUpdate ) { var attribute = this.attributes.lineDistance; -- GitLab