|
@@ -15,8 +15,8 @@ import { Vector2 } from '../../math/Vector2.js';
|
|
import { Vector4 } from '../../math/Vector4.js';
|
|
import { Vector4 } from '../../math/Vector4.js';
|
|
import { FloatType } from '../../constants.js';
|
|
import { FloatType } from '../../constants.js';
|
|
|
|
|
|
-const morphTextures = new WeakMap();
|
|
|
|
-const morphVec4 = new Vector4();
|
|
|
|
|
|
+const _morphTextures = new WeakMap();
|
|
|
|
+const _morphVec4 = /*@__PURE__*/ new Vector4();
|
|
|
|
|
|
const getMorph = tslFn( ( { bufferMap, influence, stride, width, depth, offset } ) => {
|
|
const getMorph = tslFn( ( { bufferMap, influence, stride, width, depth, offset } ) => {
|
|
|
|
|
|
@@ -43,7 +43,7 @@ function getEntry( geometry ) {
|
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
|
|
|
|
- let entry = morphTextures.get( geometry );
|
|
|
|
|
|
+ let entry = _morphTextures.get( geometry );
|
|
|
|
|
|
if ( entry === undefined || entry.count !== morphTargetsCount ) {
|
|
if ( entry === undefined || entry.count !== morphTargetsCount ) {
|
|
|
|
|
|
@@ -95,34 +95,34 @@ function getEntry( geometry ) {
|
|
|
|
|
|
if ( hasMorphPosition === true ) {
|
|
if ( hasMorphPosition === true ) {
|
|
|
|
|
|
- morphVec4.fromBufferAttribute( morphTarget, j );
|
|
|
|
|
|
+ _morphVec4.fromBufferAttribute( morphTarget, j );
|
|
|
|
|
|
- buffer[ offset + stride + 0 ] = morphVec4.x;
|
|
|
|
- buffer[ offset + stride + 1 ] = morphVec4.y;
|
|
|
|
- buffer[ offset + stride + 2 ] = morphVec4.z;
|
|
|
|
|
|
+ buffer[ offset + stride + 0 ] = _morphVec4.x;
|
|
|
|
+ buffer[ offset + stride + 1 ] = _morphVec4.y;
|
|
|
|
+ buffer[ offset + stride + 2 ] = _morphVec4.z;
|
|
buffer[ offset + stride + 3 ] = 0;
|
|
buffer[ offset + stride + 3 ] = 0;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if ( hasMorphNormals === true ) {
|
|
if ( hasMorphNormals === true ) {
|
|
|
|
|
|
- morphVec4.fromBufferAttribute( morphNormal, j );
|
|
|
|
|
|
+ _morphVec4.fromBufferAttribute( morphNormal, j );
|
|
|
|
|
|
- buffer[ offset + stride + 4 ] = morphVec4.x;
|
|
|
|
- buffer[ offset + stride + 5 ] = morphVec4.y;
|
|
|
|
- buffer[ offset + stride + 6 ] = morphVec4.z;
|
|
|
|
|
|
+ buffer[ offset + stride + 4 ] = _morphVec4.x;
|
|
|
|
+ buffer[ offset + stride + 5 ] = _morphVec4.y;
|
|
|
|
+ buffer[ offset + stride + 6 ] = _morphVec4.z;
|
|
buffer[ offset + stride + 7 ] = 0;
|
|
buffer[ offset + stride + 7 ] = 0;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if ( hasMorphColors === true ) {
|
|
if ( hasMorphColors === true ) {
|
|
|
|
|
|
- morphVec4.fromBufferAttribute( morphColor, j );
|
|
|
|
|
|
+ _morphVec4.fromBufferAttribute( morphColor, j );
|
|
|
|
|
|
- buffer[ offset + stride + 8 ] = morphVec4.x;
|
|
|
|
- buffer[ offset + stride + 9 ] = morphVec4.y;
|
|
|
|
- buffer[ offset + stride + 10 ] = morphVec4.z;
|
|
|
|
- buffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morphVec4.w : 1;
|
|
|
|
|
|
+ buffer[ offset + stride + 8 ] = _morphVec4.x;
|
|
|
|
+ buffer[ offset + stride + 9 ] = _morphVec4.y;
|
|
|
|
+ buffer[ offset + stride + 10 ] = _morphVec4.z;
|
|
|
|
+ buffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? _morphVec4.w : 1;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -137,13 +137,13 @@ function getEntry( geometry ) {
|
|
size: new Vector2( width, height )
|
|
size: new Vector2( width, height )
|
|
};
|
|
};
|
|
|
|
|
|
- morphTextures.set( geometry, entry );
|
|
|
|
|
|
+ _morphTextures.set( geometry, entry );
|
|
|
|
|
|
function disposeTexture() {
|
|
function disposeTexture() {
|
|
|
|
|
|
bufferTexture.dispose();
|
|
bufferTexture.dispose();
|
|
|
|
|
|
- morphTextures.delete( geometry );
|
|
|
|
|
|
+ _morphTextures.delete( geometry );
|
|
|
|
|
|
geometry.removeEventListener( 'dispose', disposeTexture );
|
|
geometry.removeEventListener( 'dispose', disposeTexture );
|
|
|
|
|