mirror of
https://github.com/photonstorm/phaser
synced 2024-09-20 14:31:55 +00:00
Merge branch 'master' of https://github.com/phaserjs/phaser
This commit is contained in:
commit
61994fa22d
5 changed files with 15 additions and 11 deletions
|
@ -27,6 +27,7 @@
|
|||
* The console warnings when Audio files are missing/incorrect have been improved (thanks @samme)
|
||||
* The `requestVideoFrame` polyfill has been updated to the latest release, which should resolve some SSR framework issues. Fix #6776 (thanks @lantictac)
|
||||
* `ScaleManager` listeners includes checks for the `screen.orientation` object and adds/removes a `change` eventListener method to handle screen orientation changes on mobile devices. The `orientationchange` event is still maintained for backwards compatibility. Fix #6837 (thanks @rexrainbow)
|
||||
* Updated MatterJS to 0.20.0
|
||||
|
||||
# Bug Fixes
|
||||
|
||||
|
|
|
@ -1479,12 +1479,15 @@ var World = new Class({
|
|||
continue;
|
||||
}
|
||||
|
||||
for (var j = 0; j < pair.activeContacts.length; j++)
|
||||
for (var j = 0; j < pair.contactCount; j++)
|
||||
{
|
||||
var contact = pair.activeContacts[j];
|
||||
var contact = pair.contacts[j];
|
||||
var vertex = contact.vertex;
|
||||
|
||||
graphics.fillRect(vertex.x - 2, vertex.y - 2, 5, 5);
|
||||
|
||||
if (vertex)
|
||||
{
|
||||
graphics.fillRect(vertex.x - 2, vertex.y - 2, 5, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1500,14 +1503,14 @@ var World = new Class({
|
|||
}
|
||||
|
||||
var collision = pair.collision;
|
||||
var contacts = pair.activeContacts;
|
||||
var contacts = pair.contacts;
|
||||
|
||||
if (contacts.length > 0)
|
||||
if (pair.contactCount > 0)
|
||||
{
|
||||
var normalPosX = contacts[0].vertex.x;
|
||||
var normalPosY = contacts[0].vertex.y;
|
||||
|
||||
if (contacts.length === 2)
|
||||
if (pair.contactCount === 2)
|
||||
{
|
||||
normalPosX = (contacts[0].vertex.x + contacts[1].vertex.x) / 2;
|
||||
normalPosY = (contacts[0].vertex.y + contacts[1].vertex.y) / 2;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @property {string} id - The unique auto-generated collision pair id. A combination of the body A and B IDs.
|
||||
* @property {MatterJS.BodyType} bodyA - A reference to the first body involved in the collision.
|
||||
* @property {MatterJS.BodyType} bodyB - A reference to the second body involved in the collision.
|
||||
* @property {MatterJS.Vector[]} activeContacts - An array containing all of the active contacts between bodies A and B.
|
||||
* @property {MatterJS.Vector[]} contacts - An array containing all of the active contacts between bodies A and B.
|
||||
* @property {number} separation - The amount of separation that occurred between bodies A and B.
|
||||
* @property {boolean} isActive - Is the collision still active or not?
|
||||
* @property {boolean} confirmedActive - Has Matter determined the collision are being active yet?
|
||||
|
|
4
types/matter.d.ts
vendored
4
types/matter.d.ts
vendored
|
@ -990,7 +990,7 @@ declare namespace MatterJS {
|
|||
bodyA: Body;
|
||||
bodyB: Body;
|
||||
contacts: any;
|
||||
activeContacts: any;
|
||||
contactCount: number;
|
||||
separation: number;
|
||||
isActive: boolean;
|
||||
timeCreated: number;
|
||||
|
@ -1030,7 +1030,7 @@ declare namespace MatterJS {
|
|||
id: string;
|
||||
bodyA: Body;
|
||||
bodyB: Body;
|
||||
activeContacts: Vector[];
|
||||
contacts: Vector[];
|
||||
separation: number;
|
||||
isActive: boolean;
|
||||
confirmedActive: boolean;
|
||||
|
|
2
types/phaser.d.ts
vendored
2
types/phaser.d.ts
vendored
|
@ -75729,7 +75729,7 @@ declare namespace Phaser {
|
|||
/**
|
||||
* An array containing all of the active contacts between bodies A and B.
|
||||
*/
|
||||
activeContacts: MatterJS.Vector[];
|
||||
contacts: MatterJS.Vector[];
|
||||
/**
|
||||
* The amount of separation that occurred between bodies A and B.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue