The current top-down friction joint (FrictionJoint) couples the force and torques between two bodies, but clips the maximum force and torque that one body can apply to the other. Once the force/torque is exceeded, the two bodies slip relative to one another.
This is the behavior I want, but I need it to be aware of the fixture attached on a body. For example, if two objects are not overlapping at all, there can be no friction coupling between them. Also, suppose two squares, A and B, are slightly overlapping, but their centers are not. If square A rotates about its center, the square B should also rotate about A's center. The current behavior of the FrictionJoint is that the squares both rotate about their respective centers.
I have a few questions about this.
It seems like no Box2D joint relies on fixture information. The geometry of a object is used only for computing contacts and collision forces, but not the forces used to maintain joint constraints. Is that right? If so, would it be very unnatural to extend the FrictionJoint so that it does rely on fixture information to produce the behavior I want?
Is the right approach to try to implement this desired behavior outside the library? For example, to compute the friction force between two bodies, first compute the overlap of their fixtures. Then sample a few key points in the overlap and couple the forces between the two objects. The correct torque should fall out of this.
This is the behavior I want, but I need it to be aware of the fixture attached on a body. For example, if two objects are not overlapping at all, there can be no friction coupling between them. Also, suppose two squares, A and B, are slightly overlapping, but their centers are not. If square A rotates about its center, the square B should also rotate about A's center. The current behavior of the FrictionJoint is that the squares both rotate about their respective centers.
I have a few questions about this.
It seems like no Box2D joint relies on fixture information. The geometry of a object is used only for computing contacts and collision forces, but not the forces used to maintain joint constraints. Is that right? If so, would it be very unnatural to extend the FrictionJoint so that it does rely on fixture information to produce the behavior I want?
Is the right approach to try to implement this desired behavior outside the library? For example, to compute the friction force between two bodies, first compute the overlap of their fixtures. Then sample a few key points in the overlap and couple the forces between the two objects. The correct torque should fall out of this.