Make ContactMaterialOptions properties all optional

This commit is contained in:
spacejack 2017-12-09 15:58:27 -05:00
parent 14d6d73e6d
commit e7aeda3f24
2 changed files with 13 additions and 7 deletions

14
types/p2/index.d.ts vendored
View File

@ -361,13 +361,13 @@ declare namespace p2 {
export class ContactMaterialOptions {
friction: number;
restitution: number;
stiffness: number;
relaxation: number;
frictionStiffness: number;
frictionRelaxation: number;
surfaceVelocity: number;
friction?: number;
restitution?: number;
stiffness?: number;
relaxation?: number;
frictionStiffness?: number;
frictionRelaxation?: number;
surfaceVelocity?: number;
}

View File

@ -4,6 +4,12 @@ var world = new p2.World({
gravity:[0, -9.82]
});
// Set default contact material
world.defaultContactMaterial = new p2.ContactMaterial(
new p2.Material(1), new p2.Material(2),
{ friction: 1, restitution: 0 }
)
// Create an empty dynamic body
var circleBody = new p2.Body({
mass: 5,