phaser/v3/merge/physics/p2/ContactMaterial.js

64 lines
2.1 KiB
JavaScript
Raw Normal View History

2014-02-18 15:28:42 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2016-04-04 21:15:01 +00:00
* @copyright 2016 Photon Storm Ltd.
2014-02-18 15:28:42 +00:00
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Defines a physics material
*
* @class Phaser.Physics.P2.ContactMaterial
2014-02-18 15:28:42 +00:00
* @constructor
* @param {Phaser.Physics.P2.Material} materialA - First material participating in the contact material.
* @param {Phaser.Physics.P2.Material} materialB - Second material participating in the contact material.
* @param {object} [options] - Additional configuration options.
2014-02-18 15:28:42 +00:00
*/
Phaser.Physics.P2.ContactMaterial = function (materialA, materialB, options) {
2014-02-18 15:28:42 +00:00
/**
* @property {number} id - The contact material identifier.
*/
/**
* @property {Phaser.Physics.P2.Material} materialA - First material participating in the contact material.
2014-02-18 15:28:42 +00:00
*/
/**
* @property {Phaser.Physics.P2.Material} materialB - Second material participating in the contact material.
2014-02-18 15:28:42 +00:00
*/
/**
* @property {number} [friction=0.3] - Friction to use in the contact of these two materials.
*/
/**
* @property {number} [restitution=0.0] - Restitution to use in the contact of these two materials.
*/
/**
2015-09-08 14:56:28 +00:00
* @property {number} [stiffness=1e7] - Stiffness of the resulting ContactEquation that this ContactMaterial generates.
2014-02-18 15:28:42 +00:00
*/
/**
2015-09-08 14:56:28 +00:00
* @property {number} [relaxation=3] - Relaxation of the resulting ContactEquation that this ContactMaterial generates.
2014-02-18 15:28:42 +00:00
*/
/**
2015-09-08 14:56:28 +00:00
* @property {number} [frictionStiffness=1e7] - Stiffness of the resulting FrictionEquation that this ContactMaterial generates.
2014-02-18 15:28:42 +00:00
*/
/**
2015-09-08 14:56:28 +00:00
* @property {number} [frictionRelaxation=3] - Relaxation of the resulting FrictionEquation that this ContactMaterial generates.
2014-02-18 15:28:42 +00:00
*/
/**
* @property {number} [surfaceVelocity=0] - Will add surface velocity to this material. If bodyA rests on top if bodyB, and the surface velocity is positive, bodyA will slide to the right.
*/
p2.ContactMaterial.call(this, materialA, materialB, options);
2014-03-23 06:31:26 +00:00
};
2014-02-18 15:28:42 +00:00
Phaser.Physics.P2.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype);
Phaser.Physics.P2.ContactMaterial.prototype.constructor = Phaser.Physics.P2.ContactMaterial;