Closed IRobot1 closed 2 years ago
I think there should be a way to get the data. The problem is that we're using Cannon Worker API which is a Web Worker implementation. The data, if available at all, would be in asynchronous state.
Can you look at https://cannon.pmnd.rs/ and see if there's any example that might be similar to tear?
There might be an existing way to achieve this. Looks like there's a multiplier that can be declared with the constraint. I'll investigate using that and follow up.
Adjust the maxMultiplier value on distance contraint. Higher values make the bonds/links between bodies stronger
const constraint = this.physicConstraint.useDistanceConstraint(body.ref, lastBody.ref, {
distance: this.distance,
maxMultiplier: 1000, // higher multiplier makes links stronger
})
While converting cannon-es tear example, the code accesses the equations property and multiplier.
According to the cannon documentation, this properly is common to all constraints.
This is a request to add support for accessing either the equations and/or multiplier value.
If there another way to get multiplier value using existing features, let me know.