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:
parent
182ba905d4
commit
5b6f30b08c
1 changed files with 2 additions and 5 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue