You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see this, too, on Windows with processing 3.5.4. Visual bodies spin while the debug physical bodies don't.
It looks like it could be an angle conversion issue: small angular changes in the physical bodies are converted to large angular changes in the visual body. Is there radians <-> degrees conversion bug somewhere?
the workaround suggested there works.
in DwWorld class change updateBodies() :
instead of applying the rotation to the shapeMatrix, apply it to a new PMatrix2D, which can be resetted.
then apply that matrix to the shape.
public void updateBodies(){
PMatrix2D matrix = new PMatrix2D();
for (Body body = super.getBodyList(); body != null; body = body.getNext()) {
Transform xf = body.getTransform();
DwBody dwbody = getShape(body);
if(dwbody != null){
float angle=(float)xf.q.getAngle();
matrix.reset();
matrix.rotate(angle);
dwbody.shape.resetMatrix();
dwbody.shape.applyMatrix(matrix);
//dwbody.shape.rotate(angle);
dwbody.shape.translate(xf.p.x, xf.p.y);
}
processing 3.5.3
open any example with
see endless rotation of body visual (after move it a bit).
If use USE_DEBUG_DRAW - all work as it should
The text was updated successfully, but these errors were encountered: