@@ -763,6 +763,8 @@ class RenderWebGL extends EventEmitter {
763
763
const color = __touchingColor ;
764
764
const hasMask = Boolean ( mask3b ) ;
765
765
766
+ drawable . updateCPURenderAttributes ( ) ;
767
+
766
768
// Masked drawable ignores ghost effect
767
769
const effectMask = ~ ShaderManager . EFFECT_INFO . ghost . mask ;
768
770
@@ -909,6 +911,8 @@ class RenderWebGL extends EventEmitter {
909
911
const drawable = this . _allDrawables [ drawableID ] ;
910
912
const point = __isTouchingDrawablesPoint ;
911
913
914
+ drawable . updateCPURenderAttributes ( ) ;
915
+
912
916
// This is an EXTREMELY brute force collision detector, but it is
913
917
// still faster than asking the GPU to give us the pixels.
914
918
for ( let x = bounds . left ; x <= bounds . right ; x ++ ) {
@@ -985,12 +989,7 @@ class RenderWebGL extends EventEmitter {
985
989
const bounds = this . clientSpaceToScratchBounds ( centerX , centerY , touchWidth , touchHeight ) ;
986
990
const worldPos = twgl . v3 . create ( ) ;
987
991
988
- drawable . updateMatrix ( ) ;
989
- if ( drawable . skin ) {
990
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
991
- } else {
992
- log . warn ( `Could not find skin for drawable with id: ${ drawableID } ` ) ;
993
- }
992
+ drawable . updateCPURenderAttributes ( ) ;
994
993
995
994
for ( worldPos [ 1 ] = bounds . bottom ; worldPos [ 1 ] <= bounds . top ; worldPos [ 1 ] ++ ) {
996
995
for ( worldPos [ 0 ] = bounds . left ; worldPos [ 0 ] <= bounds . right ; worldPos [ 0 ] ++ ) {
@@ -1021,12 +1020,7 @@ class RenderWebGL extends EventEmitter {
1021
1020
const drawable = this . _allDrawables [ id ] ;
1022
1021
// default pick list ignores visible and ghosted sprites.
1023
1022
if ( drawable . getVisible ( ) && drawable . getUniforms ( ) . u_ghost !== 0 ) {
1024
- drawable . updateMatrix ( ) ;
1025
- if ( drawable . skin ) {
1026
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1027
- } else {
1028
- log . warn ( `Could not find skin for drawable with id: ${ id } ` ) ;
1029
- }
1023
+ drawable . updateCPURenderAttributes ( ) ;
1030
1024
return true ;
1031
1025
}
1032
1026
return false ;
@@ -1258,8 +1252,6 @@ class RenderWebGL extends EventEmitter {
1258
1252
/** @todo remove this once URL-based skin setting is removed. */
1259
1253
if ( ! drawable . skin || ! drawable . skin . getTexture ( [ 100 , 100 ] ) ) return null ;
1260
1254
1261
- drawable . updateMatrix ( ) ;
1262
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1263
1255
const bounds = drawable . getFastBounds ( ) ;
1264
1256
1265
1257
// Limit queries to the stage size.
@@ -1296,8 +1288,7 @@ class RenderWebGL extends EventEmitter {
1296
1288
const drawable = this . _allDrawables [ id ] ;
1297
1289
if ( drawable . skin && drawable . _visible ) {
1298
1290
// Update the CPU position data
1299
- drawable . updateMatrix ( ) ;
1300
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1291
+ drawable . updateCPURenderAttributes ( ) ;
1301
1292
const candidateBounds = drawable . getFastBounds ( ) ;
1302
1293
if ( bounds . intersects ( candidateBounds ) ) {
1303
1294
result . push ( {
@@ -1775,15 +1766,14 @@ class RenderWebGL extends EventEmitter {
1775
1766
_getConvexHullPointsForDrawable ( drawableID ) {
1776
1767
const drawable = this . _allDrawables [ drawableID ] ;
1777
1768
1778
- drawable . updateMatrix ( ) ;
1779
- drawable . skin . updateSilhouette ( this . _getDrawableScreenSpaceScale ( drawable ) ) ;
1780
-
1781
1769
const [ width , height ] = drawable . skin . size ;
1782
1770
// No points in the hull if invisible or size is 0.
1783
1771
if ( ! drawable . getVisible ( ) || width === 0 || height === 0 ) {
1784
1772
return [ ] ;
1785
1773
}
1786
1774
1775
+ drawable . updateCPURenderAttributes ( ) ;
1776
+
1787
1777
/**
1788
1778
* Return the determinant of two vectors, the vector from A to B and the vector from A to C.
1789
1779
*
0 commit comments