mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Remove commented out grab sensors and area sensors
- Clean up commented fixture definitions that were temporarily disabled during debugging
This commit is contained in:
parent
49f4591d3a
commit
799601f24d
1 changed files with 38 additions and 38 deletions
|
|
@ -110,45 +110,45 @@ function (Parent, Exception, planck, Settings, CollisionDetector, Item, nc, Asse
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// // Grab sensors (left/right)
|
// Grab sensors (left/right)
|
||||||
// ["left", "right"].forEach(side => {
|
["left", "right"].forEach(side => {
|
||||||
// const sign = side === "left" ? -1 : 1;
|
const sign = side === "left" ? -1 : 1;
|
||||||
// addFixture({
|
addFixture({
|
||||||
// shape: planck.Box(
|
shape: planck.Box(
|
||||||
// r / 2 / R,
|
r / 2 / R,
|
||||||
// (h / 2 + r / 4) / R,
|
(h / 2 + r / 4) / R,
|
||||||
// planck.Vec2(sign * r / 2 / R, h / 2 / R)
|
planck.Vec2(sign * r / 2 / R, h / 2 / R)
|
||||||
// ),
|
),
|
||||||
// density: 0,
|
density: 0,
|
||||||
// friction: 0,
|
friction: 0,
|
||||||
// restitution: 0,
|
restitution: 0,
|
||||||
// isSensor: true,
|
isSensor: true,
|
||||||
// userData: {
|
userData: {
|
||||||
// onCollisionChange: function(isColliding, fixture) {
|
onCollisionChange: function(isColliding, fixture) {
|
||||||
// self.onFixtureWithinReach(isColliding, side, fixture);
|
self.onFixtureWithinReach(isColliding, side, fixture);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // Area sensor
|
// Area sensor
|
||||||
// addFixture({
|
addFixture({
|
||||||
// shape: planck.Box((w + a) / 2 / R, (h + a) / 2 / R, planck.Vec2(0, h / 2 / R)),
|
shape: planck.Box((w + a) / 2 / R, (h + a) / 2 / R, planck.Vec2(0, h / 2 / R)),
|
||||||
// density: 0,
|
density: 0,
|
||||||
// friction: 0,
|
friction: 0,
|
||||||
// restitution: 0,
|
restitution: 0,
|
||||||
// isSensor: true,
|
isSensor: true,
|
||||||
// userData: {
|
userData: {
|
||||||
// onCollisionChange: function(isColliding, fixture) {
|
onCollisionChange: function(isColliding, fixture) {
|
||||||
// var userData = fixture.getBody().getUserData();
|
var userData = fixture.getBody().getUserData();
|
||||||
// if (userData instanceof Doll) {
|
if (userData instanceof Doll) {
|
||||||
// var i = self.nearbyDolls.indexOf(userData);
|
var i = self.nearbyDolls.indexOf(userData);
|
||||||
// if (isColliding && i === -1) self.nearbyDolls.push(userData);
|
if (isColliding && i === -1) self.nearbyDolls.push(userData);
|
||||||
// else if (!isColliding && i !== -1) self.nearbyDolls.splice(i, 1);
|
else if (!isColliding && i !== -1) self.nearbyDolls.splice(i, 1);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Doll.prototype.setActionState = function(state) {
|
Doll.prototype.setActionState = function(state) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue