SolarLune, that’s a really good idea.
A list or dictionary on game objects obj[“constraints”] could be used to store instances of the class and the class could have properties that contain the joint name, type, reference, etc. and expose methods that allow for changing the parameters in a more intuitive way rather than using many obscure setParam(val1, val2, val3) commands.
I’m currently thinking through a more object oriented approach to my ragdolls addon and having a custom class for the joints would be a good addition to this since many rigid body joints will need to be created and stored, and possibly broken.
In my addon, I read the available parameters from the constraint data set in the gui. I then write all the joint data to a text file. At runtime I then read the text file in order to recreate the joints at runtime using this data, but my implementation is a bit messy and this information could be used just as easily to create instances of a class. I don’t use springs or motors, but spawning objects connected by rigid body joints breaks the joint so I still need to have the data available in order to recreate the joint.
It’s unfortunate that object properties set in Blender are not transferred to bge so the external data file is required.