Skip to content

Conversation

@SollyBunny
Copy link
Contributor

@SollyBunny SollyBunny commented Nov 24, 2025

  • Friction is not yet exposed in any of the libraries, so remove it's mention
  • Add more info to what restitution is

* @param {Mesh} mesh The mesh to add.
* @param {number} [mass=0] The mass in kg of the mesh.
* @param {number} [restitution=0] The restitution/friction of the mesh.
* @param {number} [restitution=0] The restitution of the mesh.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In very simple words one can distinct both concepts like so:

  • Restitution models how "bouncy" objects are when they collide with each other.
  • Friction models how object slide against each other.

Is that about right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but friction isn't exposed at all

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Would you mind updating the description of restitution to the following:

@param {number} [restitution=0] The restitution of the mesh. Represents how "bouncy" objects are when they collide with each other.

In this way, we have a bit of description about what restitution actually is.

Copy link
Contributor Author

@SollyBunny SollyBunny Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about The restitution of the mesh usually from 0 to 1. Restitution is the proportion of energy conserved when colliding with another object

Copy link
Contributor Author

@SollyBunny SollyBunny Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in the future The frictional coefficient of the mesh, above or equal to 0 where 0 is no friction. When two objects slide against each other there is a frictional force proportional to the normal force between them and this value

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then maybe like so?

The amount of energy conserved when colliding with another object. Simply speaking, it defines how "bouncy" objects are when they collide with each other.

I would like to add one sentence that defines it as simple as possible for developers who do not know much about physics yet.

Copy link
Contributor Author

@SollyBunny SollyBunny Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I've written is accurate and concise, for wadafak is this (probably more for people who don't speak English rather than poor physics) I think it should be
The restitution of the mesh usually from 0 to 1. This is how "bouncy" an object is
The friction of the mesh, above or equal to 0, where 0 is no friction. Friction is a force applied when objects slide against each other

Copy link
Collaborator

@Mugen87 Mugen87 Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I prefer the version in #32341 (comment) which is a it longer but more clear.

Copy link
Contributor Author

@SollyBunny SollyBunny Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "on colliding with eachother" adds anything, but I am impartial to the extra words. We should keep the range 0 to 1 though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mugen87 see update

@SollyBunny SollyBunny changed the title Remove incorrect friction in param desc of physics AddMesh Update/fix restitution param desc in physics addons Nov 24, 2025
@Mugen87 Mugen87 added this to the r182 milestone Nov 24, 2025
@Mugen87 Mugen87 merged commit a893a58 into mrdoob:dev Nov 24, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants