@@ -111,30 +111,30 @@ AFRAME.registerComponent('stretchable', inherit(base, {
111111 let offset
112112
113113 // CANNON.js has el.body.shapes. Ammo has collisionShapes in the shape component.
114- const shapesList = el . body . shapes ? el . body . shapes : el . components [ " ammo-shape" ] . collisionShapes ;
114+ const shapesList = el . body . shapes ? el . body . shapes : el . components [ ' ammo-shape' ] . collisionShapes
115115
116- for ( let i = 0 ; i < shapesList ; i ++ ) {
116+ for ( let i = 0 ; i < shapesList . length ; i ++ ) {
117117 physicsShape = shapesList [ i ]
118118 if ( physicsShape . halfExtents ) {
119119 physicsShape . halfExtents
120120 . scale ( deltaStretch , physicsShape . halfExtents )
121121 physicsShape . updateConvexPolyhedronRepresentation ( )
122122 } else if ( physicsShape . radius ) {
123- physicsShape . radius *= deltaStretch ;
124- physicsShape . updateBoundingSphereRadius ( ) ;
123+ physicsShape . radius *= deltaStretch
124+ physicsShape . updateBoundingSphereRadius ( )
125125 } else if ( ! this . shapeWarned ) {
126- console . warn ( 'Unable to stretch physics body: unsupported shape' ) ;
127- this . shapeWarned = true ;
126+ console . warn ( 'Unable to stretch physics body: unsupported shape' )
127+ this . shapeWarned = true
128128 }
129129 // also move offset to match scale change
130- offset = el . body . shapeOffsets [ i ] ;
131- offset . scale ( deltaStretch , offset ) ;
130+ offset = el . body . shapeOffsets [ i ]
131+ offset . scale ( deltaStretch , offset )
132132 }
133133 if ( el . body . updateBoundingRadius ) {
134134 // This only exists in CANNON, not Ammo.js
135135 // I'm not aware of any requirement to call an equivalent function
136136 // in Ammo.js
137- el . body . updateBoundingRadius ( ) ;
137+ el . body . updateBoundingRadius ( )
138138 }
139139 }
140140} ) )
0 commit comments