Physics.P2#createContactMaterial()

createContactMaterial(materialA, materialB, options) → {Phaser.Physics.P2.ContactMaterial}

Creates a Contact Material from the two given Materials. You can then edit the properties of the Contact Material directly.

Parameters
Name Type Argument Description
materialA Phaser.Physics.P2.Material <optional>

The first Material to create the ContactMaterial from. If undefined it will create a new Material object first.

materialB Phaser.Physics.P2.Material <optional>

The second Material to create the ContactMaterial from. If undefined it will create a new Material object first.

options object <optional>

Material options object.

Returns

The Contact Material that was created.

Source code: physics/p2/World.js (Line 1246)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.