|
| 1 | +/** |
| 2 | +* @author Richard Davey <rich@photonstorm.com> |
| 3 | +* @copyright 2014 Photon Storm Ltd. |
| 4 | +* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} |
| 5 | +*/ |
| 6 | + |
| 7 | +/** |
| 8 | +* Defines a physics material |
| 9 | +* |
| 10 | +* @class Phaser.Physics.ContactMaterial |
| 11 | +* @classdesc Physics ContactMaterial Constructor |
| 12 | +* @constructor |
| 13 | +* @param {Phaser.Physics.Material} materialA |
| 14 | +* @param {Phaser.Physics.Material} materialB |
| 15 | +* @param {object} [options] |
| 16 | +*/ |
| 17 | +Phaser.Physics.ContactMaterial = function (materialA, materialB, options) { |
| 18 | + |
| 19 | + /** |
| 20 | + * @property {number} id - The contact material identifier. |
| 21 | + */ |
| 22 | + |
| 23 | + /** |
| 24 | + * @property {Phaser.Physics.Material} materialA - First material participating in the contact material. |
| 25 | + */ |
| 26 | + |
| 27 | + /** |
| 28 | + * @property {Phaser.Physics.Material} materialB - First second participating in the contact material. |
| 29 | + */ |
| 30 | + |
| 31 | + /** |
| 32 | + * @property {number} [friction=0.3] - Friction to use in the contact of these two materials. |
| 33 | + */ |
| 34 | + |
| 35 | + /** |
| 36 | + * @property {number} [restitution=0.0] - Restitution to use in the contact of these two materials. |
| 37 | + */ |
| 38 | + |
| 39 | + /** |
| 40 | + * @property {number} [stiffness=1e7] - Stiffness of the resulting ContactEquation that this ContactMaterial generate. |
| 41 | + */ |
| 42 | + |
| 43 | + /** |
| 44 | + * @property {number} [relaxation=3] - Relaxation of the resulting ContactEquation that this ContactMaterial generate. |
| 45 | + */ |
| 46 | + |
| 47 | + /** |
| 48 | + * @property {number} [frictionStiffness=1e7] - Stiffness of the resulting FrictionEquation that this ContactMaterial generate. |
| 49 | + */ |
| 50 | + |
| 51 | + /** |
| 52 | + * @property {number} [frictionRelaxation=3] - Relaxation of the resulting FrictionEquation that this ContactMaterial generate. |
| 53 | + */ |
| 54 | + |
| 55 | + /** |
| 56 | + * @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. |
| 57 | + */ |
| 58 | + |
| 59 | + p2.ContactMaterial.call(this, materialA, materialB, options); |
| 60 | + |
| 61 | +} |
| 62 | + |
| 63 | +Phaser.Physics.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype); |
| 64 | +Phaser.Physics.ContactMaterial.prototype.constructor = Phaser.Physics.ContactMaterial; |
0 commit comments