@@ -752,6 +752,8 @@ class RenderWebGL extends EventEmitter {
752
752
const color = __touchingColor ;
753
753
const hasMask = Boolean ( mask3b ) ;
754
754
755
+ drawable . updateCPURenderAttributes ( ) ;
756
+
755
757
// Scratch Space - +y is top
756
758
for ( let y = bounds . bottom ; y <= bounds . top ; y ++ ) {
757
759
if ( bounds . width * ( y - bounds . bottom ) * ( candidates . length + 1 ) >= maxPixelsForCPU ) {
@@ -895,6 +897,8 @@ class RenderWebGL extends EventEmitter {
895
897
const drawable = this . _allDrawables [ drawableID ] ;
896
898
const point = __isTouchingDrawablesPoint ;
897
899
900
+ drawable . updateCPURenderAttributes ( ) ;
901
+
898
902
// This is an EXTREMELY brute force collision detector, but it is
899
903
// still faster than asking the GPU to give us the pixels.
900
904
for ( let x = bounds . left ; x <= bounds . right ; x ++ ) {
@@ -971,12 +975,7 @@ class RenderWebGL extends EventEmitter {
971
975
const bounds = this . clientSpaceToScratchBounds ( centerX , centerY , touchWidth , touchHeight ) ;
972
976
const worldPos = twgl . v3 . create ( ) ;
973
977
974
- drawable . updateMatrix ( ) ;
975
- if ( drawable . skin ) {
976
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
977
- } else {
978
- log . warn ( `Could not find skin for drawable with id: ${ drawableID } ` ) ;
979
- }
978
+ drawable . updateCPURenderAttributes ( ) ;
980
979
981
980
for ( worldPos [ 1 ] = bounds . bottom ; worldPos [ 1 ] <= bounds . top ; worldPos [ 1 ] ++ ) {
982
981
for ( worldPos [ 0 ] = bounds . left ; worldPos [ 0 ] <= bounds . right ; worldPos [ 0 ] ++ ) {
@@ -1007,12 +1006,7 @@ class RenderWebGL extends EventEmitter {
1007
1006
const drawable = this . _allDrawables [ id ] ;
1008
1007
// default pick list ignores visible and ghosted sprites.
1009
1008
if ( drawable . getVisible ( ) && drawable . getUniforms ( ) . u_ghost !== 0 ) {
1010
- drawable . updateMatrix ( ) ;
1011
- if ( drawable . skin ) {
1012
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1013
- } else {
1014
- log . warn ( `Could not find skin for drawable with id: ${ id } ` ) ;
1015
- }
1009
+ drawable . updateCPURenderAttributes ( ) ;
1016
1010
return true ;
1017
1011
}
1018
1012
return false ;
@@ -1243,8 +1237,6 @@ class RenderWebGL extends EventEmitter {
1243
1237
/** @todo remove this once URL-based skin setting is removed. */
1244
1238
if ( ! drawable . skin || ! drawable . skin . getTexture ( [ 100 , 100 ] ) ) return null ;
1245
1239
1246
- drawable . updateMatrix ( ) ;
1247
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1248
1240
const bounds = drawable . getFastBounds ( ) ;
1249
1241
1250
1242
// Limit queries to the stage size.
@@ -1281,8 +1273,7 @@ class RenderWebGL extends EventEmitter {
1281
1273
const drawable = this . _allDrawables [ id ] ;
1282
1274
if ( drawable . skin && drawable . _visible ) {
1283
1275
// Update the CPU position data
1284
- drawable . updateMatrix ( ) ;
1285
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1276
+ drawable . updateCPURenderAttributes ( ) ;
1286
1277
const candidateBounds = drawable . getFastBounds ( ) ;
1287
1278
if ( bounds . intersects ( candidateBounds ) ) {
1288
1279
result . push ( {
@@ -1767,6 +1758,8 @@ class RenderWebGL extends EventEmitter {
1767
1758
return [ ] ;
1768
1759
}
1769
1760
1761
+ drawable . updateCPURenderAttributes ( ) ;
1762
+
1770
1763
/**
1771
1764
* Return the determinant of two vectors, the vector from A to B and
1772
1765
* the vector from A to C.
0 commit comments