mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +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 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)
|
* 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)
|
* `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
|
# Bug Fixes
|
||||||
|
|
||||||
|
|
|
@ -1479,12 +1479,15 @@ var World = new Class({
|
||||||
continue;
|
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;
|
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 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 normalPosX = contacts[0].vertex.x;
|
||||||
var normalPosY = contacts[0].vertex.y;
|
var normalPosY = contacts[0].vertex.y;
|
||||||
|
|
||||||
if (contacts.length === 2)
|
if (pair.contactCount === 2)
|
||||||
{
|
{
|
||||||
normalPosX = (contacts[0].vertex.x + contacts[1].vertex.x) / 2;
|
normalPosX = (contacts[0].vertex.x + contacts[1].vertex.x) / 2;
|
||||||
normalPosY = (contacts[0].vertex.y + contacts[1].vertex.y) / 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 {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} 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.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 {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} isActive - Is the collision still active or not?
|
||||||
* @property {boolean} confirmedActive - Has Matter determined the collision are being active yet?
|
* @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;
|
bodyA: Body;
|
||||||
bodyB: Body;
|
bodyB: Body;
|
||||||
contacts: any;
|
contacts: any;
|
||||||
activeContacts: any;
|
contactCount: number;
|
||||||
separation: number;
|
separation: number;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
timeCreated: number;
|
timeCreated: number;
|
||||||
|
@ -1030,7 +1030,7 @@ declare namespace MatterJS {
|
||||||
id: string;
|
id: string;
|
||||||
bodyA: Body;
|
bodyA: Body;
|
||||||
bodyB: Body;
|
bodyB: Body;
|
||||||
activeContacts: Vector[];
|
contacts: Vector[];
|
||||||
separation: number;
|
separation: number;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
confirmedActive: 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.
|
* 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.
|
* The amount of separation that occurred between bodies A and B.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue