From e7aeda3f249e0f830c94fedec41130430bee2115 Mon Sep 17 00:00:00 2001 From: spacejack Date: Sat, 9 Dec 2017 15:58:27 -0500 Subject: [PATCH] Make ContactMaterialOptions properties all optional --- types/p2/index.d.ts | 14 +++++++------- types/p2/p2-tests.ts | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/types/p2/index.d.ts b/types/p2/index.d.ts index 89dda72b9c..6026a7e93e 100644 --- a/types/p2/index.d.ts +++ b/types/p2/index.d.ts @@ -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; } diff --git a/types/p2/p2-tests.ts b/types/p2/p2-tests.ts index 0579a880b2..d11da9c9bf 100644 --- a/types/p2/p2-tests.ts +++ b/types/p2/p2-tests.ts @@ -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,