Skip to content

Discerning between pushing, pulling and lateral Impulses applied by Constraints #295

@0TK

Description

@0TK

Greet you!

"Constraint.impulse" in Python returns just a positive magnitude. This seems to be confirmed also by joint implementation code at, for example...
https://github.com/viblo/Munk2D/blob/master/src/cpPivotJoint.c#L76
For each joint type, it returns either of...

  • cpvlength(joint->jAcc)
  • cpfabs(joint->jAcc)

How to obtain information about the direction of an impulse applied by a constraint?

If such information is not accessible, perhaps it would be possible to expose it.
For a logical interface, the result could be in the frame of reference of the constraint's axes of acting or degrees of (non-)freedom ( determined by anchor points for some constraints ). There could be separate properties for pushing-pulling and lateral impulse components or one returning a vector.
However, it seems that simply exposing joint->jAcc if it is in some other frame of reference ( like relative to the space ), so that it could be transformed manually, would still be better than this information not being obtainable at all.

Best wishes!

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