0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-24 13:29:01 -05:00

changed Pair.id format to use shorter ids

This commit is contained in:
liabru 2023-07-23 14:08:35 +01:00
parent 182ba905d4
commit 5b6f30b08c

View file

@ -125,11 +125,8 @@ var Contact = require('./Contact');
* @return {string} Unique pairId
*/
Pair.id = function(bodyA, bodyB) {
if (bodyA.id < bodyB.id) {
return 'A' + bodyA.id + 'B' + bodyB.id;
} else {
return 'A' + bodyB.id + 'B' + bodyA.id;
}
return bodyA.id < bodyB.id ? bodyA.id.toString(36) + ':' + bodyB.id.toString(36)
: bodyB.id.toString(36) + ':' + bodyA.id.toString(36);
};
})();