@@ -95,13 +95,9 @@ Object.assign(pc, function () {
95
95
this . aabb . copy ( this . _baseAabb ) ;
96
96
97
97
var numIndices ;
98
- var i , j , target , index , id ;
98
+ var i , j , target ;
99
99
var x , y , z ;
100
100
101
- var vertSizeF = this . _vertSizeF ;
102
- var offsetPF = this . _offsetPF ;
103
- var baseData = this . _baseData ;
104
-
105
101
for ( i = 0 ; i < this . _targets . length ; i ++ ) {
106
102
target = this . _targets [ i ] ;
107
103
@@ -112,12 +108,9 @@ Object.assign(pc, function () {
112
108
113
109
numIndices = target . indices . length ;
114
110
for ( j = 0 ; j < numIndices ; j ++ ) {
115
- index = target . indices [ j ] ;
116
- id = index * vertSizeF + offsetPF ;
117
-
118
- x = baseData [ id ] + target . deltaPositions [ j * 3 ] ;
119
- y = baseData [ id + 1 ] + target . deltaPositions [ j * 3 + 1 ] ;
120
- z = baseData [ id + 2 ] + target . deltaPositions [ j * 3 + 2 ] ;
111
+ x = target . deltaPositions [ j * 3 ] ;
112
+ y = target . deltaPositions [ j * 3 + 1 ] ;
113
+ z = target . deltaPositions [ j * 3 + 2 ] ;
121
114
122
115
if ( _morphMin . x > x ) _morphMin . x = x ;
123
116
if ( _morphMin . y > y ) _morphMin . y = y ;
@@ -129,7 +122,13 @@ Object.assign(pc, function () {
129
122
}
130
123
target . aabb . setMinMax ( _morphMin , _morphMax ) ;
131
124
}
132
- if ( target . aabb ) this . aabb . add ( target . aabb ) ;
125
+ if ( target . aabb ) {
126
+ var newMin = new pc . Vec3 ( ) ;
127
+ var newMax = new pc . Vec3 ( ) ;
128
+ newMin . add2 ( this . aabb . getMin ( ) , target . aabb . getMin ( ) ) ;
129
+ newMax . add2 ( this . aabb . getMax ( ) , target . aabb . getMax ( ) ) ;
130
+ this . aabb . setMinMax ( newMin , newMax ) ;
131
+ }
133
132
}
134
133
this . _aabbDirty = false ;
135
134
} ,
0 commit comments