File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
src/framework/components/collision Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ class CollisionSystemImpl {
8383 component . _compoundParent . entity . rigidbody . activate ( ) ;
8484 }
8585
86- this . destroyShape ( data ) ;
86+ Ammo . destroy ( data . shape ) ;
87+ data . shape = null ;
8788 }
8889
8990 data . shape = this . createPhysicalShape ( component . entity , data ) ;
@@ -155,13 +156,6 @@ class CollisionSystemImpl {
155156 }
156157 }
157158
158- destroyShape ( data ) {
159- if ( data . shape ) {
160- Ammo . destroy ( data . shape ) ;
161- data . shape = null ;
162- }
163- }
164-
165159 beforeRemove ( entity , component ) {
166160 if ( component . data . shape ) {
167161 if ( component . _compoundParent && ! component . _compoundParent . entity . _destroying ) {
@@ -173,7 +167,8 @@ class CollisionSystemImpl {
173167
174168 component . _compoundParent = null ;
175169
176- this . destroyShape ( component . data ) ;
170+ Ammo . destroy ( component . data . shape ) ;
171+ component . data . shape = null ;
177172 }
178173 }
179174
@@ -519,6 +514,11 @@ class CollisionMeshSystemImpl extends CollisionSystemImpl {
519514 Ammo . destroy ( data . shape ) ;
520515 data . shape = null ;
521516 }
517+
518+ remove ( entity , data ) {
519+ this . destroyShape ( data ) ;
520+ super . remove ( entity , data ) ;
521+ }
522522}
523523
524524// Compound Collision System
You can’t perform that action at this time.
0 commit comments