Skip to content

Body velocity documentation confusing #1346

@Rosuav

Description

@Rosuav

https://brm.io/matter-js/docs/classes/Body.html#property_velocity says that this is equivalent to the magnitude of angular velocity, which seems likely wrong?

Inspecting the source code leaves me somewhat confused as to the interaction of body.velocity, Body.getVelocity, and timescale. If you call setVelocity, body.velocity is set to the difference between prev and current positions, divided by timescale; but the getVelocity method returns the difference, multiplied by timescale. This would benefit from being elaborated on in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions