Update physics.ts
This commit is contained in:
parent
388232c4d9
commit
6da9448814
1 changed files with 5 additions and 1 deletions
|
@ -67,6 +67,9 @@ export function physics(container: HTMLElement) {
|
||||||
left + (objEl.offsetWidth / 2),
|
left + (objEl.offsetWidth / 2),
|
||||||
top + (objEl.offsetHeight / 2),
|
top + (objEl.offsetHeight / 2),
|
||||||
Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2,
|
Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2,
|
||||||
|
{
|
||||||
|
restitution: 0.5
|
||||||
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const style = window.getComputedStyle(objEl);
|
const style = window.getComputedStyle(objEl);
|
||||||
|
@ -77,6 +80,7 @@ export function physics(container: HTMLElement) {
|
||||||
objEl.offsetHeight,
|
objEl.offsetHeight,
|
||||||
{
|
{
|
||||||
chamfer: { radius: parseInt(style.borderRadius, 10) },
|
chamfer: { radius: parseInt(style.borderRadius, 10) },
|
||||||
|
restitution: 0.5
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +96,7 @@ export function physics(container: HTMLElement) {
|
||||||
const mouseConstraint = Matter.MouseConstraint.create(engine, {
|
const mouseConstraint = Matter.MouseConstraint.create(engine, {
|
||||||
mouse: mouse,
|
mouse: mouse,
|
||||||
constraint: {
|
constraint: {
|
||||||
stiffness: 0.05,
|
stiffness: 0.1,
|
||||||
render: {
|
render: {
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue