Monday, July 11, 2011

Dynamical system simulation with ODE

After coding up a new joint-type in ODE, I started thinking that it would be interesting to have more force-limited constraints. With the current set of ODE constraints, you're either applying unlimited force to meet a constraint or zero force (as with a contact joint). The motors also provide an option for applying up-to a maximum force in order to achieve a certain desired velocity, but this is somewhat limited.

It would be interesting to implement a system that allows you to create potential-fields dynamic system within the ODE framework. Right now, you can set a global gravitational constant and then you can exclude selected bodies from feeling that.

My new joint makes it so that you can constrain a point relative to a body to be within a rectangular prism and you can also constrain that point to achieve a certain velocity using the limit-motors. Watching the simulation run made me think of simulating spaces inside of spaces. Normally, when a sphere collides with a box, you create a contact joint that forces it out. However, you could also create a contact joint that forces the sphere into the box whenever it tries to escape.



While we're doing that, why don't we set up a system that allows you to make gravity more flexible. Instead of applying a constant acceleration to everything affected by gravity, we could make the acceleration a function so that the acceleration accumulated depends on spatial relationships. We could also apply forces as a function of spatial relationships. It probably isn't a good idea, computationally, to try to implement a complex function that needs to be applied pairwise between all objects in the world. However, we can create spatial domains where the force/acceleration function is applied. So, when object A collides with object B, they instead of forming a contact joint, they might start applying a force to each other that pushes B into the center of A.

No comments:

Post a Comment