mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
additionally save fixtures by key
This commit is contained in:
parent
289b5b2532
commit
1213cae0a4
1 changed files with 9 additions and 2 deletions
|
@ -1113,8 +1113,15 @@ Phaser.Physics.P2.Body.prototype = {
|
|||
{
|
||||
var fixtureData = data[i];
|
||||
var shapesOfFixture = this.addFixture(fixtureData);
|
||||
createdFixtures[fixtureData.filter.group] = createdFixtures[fixtureData.filter.group] || [];
|
||||
createdFixtures[fixtureData.filter.group].push(shapesOfFixture);
|
||||
|
||||
//always add to a group
|
||||
createdFixtures[fixtureData.filter.group] = createdFixtures[fixtureData.filter.group] || []
|
||||
createdFixtures[fixtureData.filter.group] = createdFixtures[fixtureData.filter.group].concat(shapesOfFixture)
|
||||
|
||||
//if (unique) fixture key is provided
|
||||
if(fixtureData.fixtureKey){
|
||||
createdFixtures[fixtureData.fixtureKey] = shapesOfFixture
|
||||
}
|
||||
}
|
||||
|
||||
this.data.aabbNeedsUpdate = true;
|
||||
|
|
Loading…
Reference in a new issue