Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
*
Expand All @@ -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`.
*
Expand Down Expand Up @@ -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 ) {

Expand Down
17 changes: 16 additions & 1 deletion src/renderers/common/Geometries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 );

Expand Down