Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presets #79

Open
drcmda opened this issue May 25, 2020 · 5 comments
Open

presets #79

drcmda opened this issue May 25, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@drcmda
Copy link
Member

drcmda commented May 25, 2020

      <Physics
        defaultContactMaterial={{
          friction: 0.9,
          restitution: 0.7,
          contactEquationStiffness: 1e7,
          contactEquationRelaxation: 1,
          frictionEquationStiffness: 1e7,
          frictionEquationRelaxation: 2,
        }}

would it be a good idea to introduce presets for stuff like this? bouncy, crude, slippery, whatever name would make sense. for react-spring we had 4 or 5, so that users dont need to remember what damping and tension are, but here it seems even more critical, because it's probably harder to understand what these values actually mean.

@codynova
Copy link
Member

This is a great idea. Could we also make a demo that loops/resets a collision between two objects, and use react-three-gui to update ContactMaterial props? That way users could play with settings and see the results in real time

@drcmda
Copy link
Member Author

drcmda commented May 26, 2020

sounds great!

@drcmda
Copy link
Member Author

drcmda commented May 26, 2020

@codynova do you know what names would be good and what values we could use?

@Franckapik
Copy link

Screenshot_20200526-122820

When you talk about react Spring presets, you mean those ?

@drcmda
Copy link
Member Author

drcmda commented May 26, 2020

yes. would be good if use-cannon had something similar. or maybe even material qualities that people can mix.

import { contact } from 'use-cannon'

<Physics
  defaultContactMaterial={{
    ...contact.friction.medium,
    ...contact.restitution.high
  }} />

@codynova codynova added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants