[quote]Joint is a pretty undefined thing in my mind. Is it just :
- A way to “attach” two bodies to obtain a specific behavior
or
- Something that apply a force each step ?
[/quote]
Joints enforce a constraint between two bodies (or sometimes just one body). The constraint is defined using a jacobian matrix. Using that archetecture you can make the two bodies hold an invarient to one another such as they must rotate around a certain relative point etc. It would be fairly easy if you understood these jacobian matrices to create an invarient that kept the body positionally in one plane or stopped it rotating. As for doing this economically without wasting computers resources on unecissary 3D calculations that is really out of the scope for one system.
[quote]Hmm… could we do slightly more complex behaviors/reactions ?
[/quote]
Actually I was doing this using javaODE. The first step to making the system easy to expand is having a well defined event system. The way I had it working was that when bodies, joints and geoms were created or destryoed they emmited an event. The were also of the type “Bindable”. Bindable objects could be bound to other bindables. When was destroyed all other bound objects would be destroyed. With this event system it was fairly easy then to add custom behviours to things. Behaviours were bindable and becuase of the event system they were tidied up when stuff was going on. The other main event model I added was an event system that delivered world.step() events.
So yeah, if you wanted a spring system added you could create a Spring and add it to a body. This would behind the scenes bind to the body(or bodies) and also register itself with the step event model. Every time the world would be stepped the spring could apply its forces. If the body (or bodies) was removed from simulation you would not need to worry about tidying up the spring becuase it would take care of itself.
It was kind of my intention from the start to add a good event model to JOODE becuase it makes it so much more extensable. If you want global behviours for bodies (like gravity) you can add code that listens for creation events and add bindable gravity behaviours to all bidies that are created.
Like I said I have had this kind of thing with my old system. What I also had with my old system was a generic way for behaviors to be defined. I did not actually like it though because to make it generic it basically ended up as complicated as just writing java code. What I did find really useful though was allowing behaviours to be defined in scripts (beanshell scripts actually). So I am thinking maybe it would be really good if we added that kind of support to JOODE. I am not sure if people will think its poluting the system though. I would suggest we add scripting support using whatever that standard is for scripting, thus not tying the user to any particular scripting technolgy. I would also suggest that scripting and dynamically loading behaviors should be transparent operations. So you add behaviours defined in scripts exactly the same way as behaviors defined in dynamically loaded classes (so you can gradually replace scripted code with compiled code).
Anyway, most of these concerns are secondary utill JOODE is working preoperly ???