diff --git a/src/core/Object3D.js b/src/core/Object3D.js index f16a1fb4f38464..a50a5f767e4cc5 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -242,7 +242,8 @@ class Object3D extends EventDispatcher { /** * When set to `true`, the engine automatically computes the local matrix from position, - * rotation and scale every frame. + * rotation and scale every frame. If set to `false`, the app is responsible for recomputing + * the local matrix by calling `updateMatrix()`. * * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_AUTO_UPDATE`. * @@ -253,7 +254,8 @@ class Object3D extends EventDispatcher { /** * When set to `true`, the engine automatically computes the world matrix from the current local - * matrix and the object's transformation hierarchy. + * matrix and the object's transformation hierarchy. If set to `false`, the app is responsible for + * recomputing the world matrix by directly updating the `matrixWorld` property. * * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE`. * @@ -1158,7 +1160,7 @@ class Object3D extends EventDispatcher { * `true` by default. Set these flags to `false` if you need more control over the update matrix process. * * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even - * when {@link Object3D#matrixWorldAutoUpdate} is set to `false`. + * when {@link Object3D#matrixWorldNeedsUpdate} is `false`. */ updateMatrixWorld( force ) { diff --git a/src/renderers/common/Geometries.js b/src/renderers/common/Geometries.js index eab54b9a80c21f..edac9a4fa1082b 100644 --- a/src/renderers/common/Geometries.js +++ b/src/renderers/common/Geometries.js @@ -18,6 +18,20 @@ function getWireframeVersion( geometry ) { } +/** + * Returns the wireframe ID for the given geometry. + * + * @private + * @function + * @param {BufferGeometry} geometry - The geometry. + * @return {number} The ID. + */ +function getWireframeId( geometry ) { + + return ( geometry.index !== null ) ? geometry.index.id : geometry.attributes.position.id; + +} + /** * Returns a wireframe index attribute for the given geometry. * @@ -65,6 +79,7 @@ function getWireframeIndex( geometry ) { const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); attribute.version = getWireframeVersion( geometry ); + attribute.__id = getWireframeId( geometry ); return attribute; @@ -347,7 +362,7 @@ class Geometries extends DataMap { wireframes.set( geometry, wireframeAttribute ); - } else if ( wireframeAttribute.version !== getWireframeVersion( geometry ) ) { + } else if ( wireframeAttribute.version !== getWireframeVersion( geometry ) || wireframeAttribute.__id !== getWireframeId( geometry ) ) { this.attributes.delete( wireframeAttribute );