Skip to content

Commit 9b8ce1b

Browse files
committed
Adjust Resolver properties from matter config
1 parent 75e2f76 commit 9b8ce1b

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
* `MatterPhysics.getBodiesBelowPoint` is a new method that will return an array of all bodies in the World that have vertices that contain the given point.
7171
* `MatterPhysics.setBodyRenderStyle` is a new method that lets you quickly set the render style values on the given Body.
7272
* `MatterPhysics.setConstraintRenderStyle` is a new method that lets you quickly set the render style values on the given Constraint.
73+
* You can now set `restingThresh` in the Matter Configuration file to adjust the Resolver property.
74+
* You can now set `restingThreshTangent` in the Matter Configuration file to adjust the Resolver property.
75+
* You can now set `positionDampen` in the Matter Configuration file to adjust the Resolver property.
76+
* You can now set `positionWarming` in the Matter Configuration file to adjust the Resolver property.
77+
* You can now set `frictionNormalMultiplier` in the Matter Configuration file to adjust the Resolver property.
7378

7479
### Updates
7580

src/physics/matter-js/MatterPhysics.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@ var MatterPhysics = new Class({
391391
this.enableWrapPlugin();
392392
}
393393

394+
Resolver._restingThresh = GetValue(this.config, 'restingThresh', 4);
395+
Resolver._restingThreshTangent = GetValue(this.config, 'restingThreshTangent', 6);
396+
Resolver._positionDampen = GetValue(this.config, 'positionDampen', 0.9);
397+
Resolver._positionWarming = GetValue(this.config, 'positionWarming', 0.8);
398+
Resolver._frictionNormalMultiplier = GetValue(this.config, 'frictionNormalMultiplier', 5);
399+
394400
scene.sys.events.once(SceneEvents.BOOT, this.boot, this);
395401
scene.sys.events.on(SceneEvents.START, this.start, this);
396402
},

src/physics/matter-js/typedefs/MatterWorldConfig.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)