iforce2d wrote:That code was a very early version, before I made the official release available. I guess I just left it there because it was working for the demos.
The most recent code is here:
https://github.com/iforce2d/b2dJson/blo ... oadrube.js
Could you try with that one? Although just from a quick look, it seems like it still has the same problem...
Yes I just tried, it has the same problem with the .json files I'm testing which use the 'refAngle' json property for all joints to label the reference angle. Maybe that has changed to 'referenceAngle' in another version of RUBE. I don't have the program so I don't know.
Seems you test for refAngle || referenceAngle here:
Code: Select all
if ( jointJso.type == "revolute" ) {
var jd = new b2RevoluteJointDef();
loadJointCommonProperties(jd, jointJso, loadedBodies);
applyProperties(jointJso, jd, ['refAngle', 'referenceAngle'], ['lowerLimit', 'lowerAngle'], ['upperLimit', 'upperAngle'], 'maxMotorTorque', 'motorSpeed', 'enableLimit', 'enableMotor');
joint = world.CreateJoint(jd);
}
But only referenceAngle here:
Code: Select all
else if ( jointJso.type == "weld" ) {
var jd = new b2WeldJointDef();
loadJointCommonProperties(jd, jointJso, loadedBodies);
applyProperties(jointJso, jd, ['referenceAngle']);
joint = world.CreateJoint(jd);
}