Skip to content

Commit 7e18404

Browse files
Fix test script & linting errors
1 parent 999db4d commit 7e18404

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

reaction_components/prototypes/physics-grab-proto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = {
33
schema: {
44
usePhysics: { default: 'ifavailable' },
5-
constraintComponentName: {default: 'constraint'}
5+
constraintComponentName: { default: 'constraint' }
66
},
77
physicsInit: function () {
88
this.constraints = new Map()

reaction_components/stretchable.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)