From 6da944881406363efd86360e5988cdcca458c113 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 28 Dec 2020 21:59:59 +0900 Subject: [PATCH] Update physics.ts --- src/client/scripts/physics.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/scripts/physics.ts b/src/client/scripts/physics.ts index 0366de96e..8e971d584 100644 --- a/src/client/scripts/physics.ts +++ b/src/client/scripts/physics.ts @@ -67,6 +67,9 @@ export function physics(container: HTMLElement) { left + (objEl.offsetWidth / 2), top + (objEl.offsetHeight / 2), Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2, + { + restitution: 0.5 + } ); } else { const style = window.getComputedStyle(objEl); @@ -77,6 +80,7 @@ export function physics(container: HTMLElement) { objEl.offsetHeight, { chamfer: { radius: parseInt(style.borderRadius, 10) }, + restitution: 0.5 } ); } @@ -92,7 +96,7 @@ export function physics(container: HTMLElement) { const mouseConstraint = Matter.MouseConstraint.create(engine, { mouse: mouse, constraint: { - stiffness: 0.05, + stiffness: 0.1, render: { visible: false }