Thursday, June 28, 2007

Exams are over

Last two weeks I've spend almost all time preparing to my last exam and writing my diploma. Yesterday I've defended my diploma and got bachelor degree in physics. So now I have a lot of time and motivation to work on Step.

Monday, June 11, 2007

Annotations for objects

I've just implemented basic text annotations for Step. Now you can add text items to the scene, very soon you will be able to associate annotations with the objects. What I still can't decide is the appearance of the annotations. I see two possible options:
- text in a frame (like KNotes) resizeable by mouse.
- free-running text without a frame dynamically resizeable as you type

Wednesday, June 6, 2007

Editing and threading

Recently I've implemented threading in Step. This is (still) not parallel computation, but doing all calculations in one dedicated thread to keep GUI responsive and allow the user to abort calculations at any time.

In Step the user can edit the scene while simulation is running but this can't be done in the middle of timestep. So I need to use mutex to serialize access to the scene: the mutex is locked by calculating thread while performing timestep and by GUI thread while altering objects. The problem arises when calculation of one timestep becomes too long (for example if user sets too low tolerance): if GUI tries to lock the mutex it becomes unresponsive till the end of the timestep and the user can't abort the calculation !

The obvious solution is to abort current timestep as soon as the user starts altering the scene and restart it later. But this can slow down the simulation and make it not smooth. My solution is to first try locking with timeout and abort the timestep only if locking fails:

// Try to lock but do not wait mode than one frame
if(!mutex->tryLock(1000/_simulationFps)) {

With such approach simulation will be slowed down only if it is already slow (i.e. when simulation of one frame simulation takes longer then 1/FPS). In the other case simulation will proceed smoothly and user actions will be delayed only slightly.

Tuesday, May 29, 2007

Step in EBN

Today I've noticed that Step is in EBN and I'm very happy with it (I've always thought that playgound are not there) ! There are some issues reported by Krazy which I'll eventually fix. The only bad thing is that for some reason EBN ignores API documentation for StepCore. Or maybe I need to do something special for EBN to see it ?

Collision handling

Recently Step has finally got collision handling. There are still lots to do but basic things are working: you can create some polygons, assign them velocities and see them collide. It has got more time then I expect mainly because of Real Life (specifically my job and university).

After reading lots of papers on collision detection and checking how it is implemented in ODE and Bullet I've decided to use Gilbert-Johnson-Keerthi algorithm for collision detection and Dantzig LCP solver for constraints (but as with ODE solvers collision solvers will be easily swappable). The main choice criteria was accuracy of the algorithm and possibility to add error estimation. Implementing GJK was quite easy, extending it to provide full collision manifold instead of one arbitrary collision point was slightly harder because of various subtle numerical problems.

Next items on my TODO list is constraint solver and performance optimizations for collision solver (by broadphase filtering and using coherency between adjacent time steps). In parallel with it I'll start to work on something from my SoC program to be in time with it.

Friday, April 13, 2007

GSoC: Step is accepted !

So my application for GSoC is accepted. This means that Step will see a lot of improvements this summer and I hope KDE as a whole will benefit from it too. Thanks a lot for all who helped me !
I've just created a page to monitor progress of my project, take a look at it if you want to see more details.

Friday, March 23, 2007

I'm working on Step again

Two days ago I've finally submitted my SoC proposal about Step. It has got some time to write it, but even if I won't be accepted my proposal will still be useful as a roadmap for Step (but I will have to scale times in it taking into account my summer job).

So, now Step can simulate 2d rigid bodies, its time to start the most challenging part: collision detection and constraint solving. The former is not very hard but the latter is quite interesting. There are several known algorithms for it with their props and cons. ODE uses Dantzig LCP, Bullet - sequential impulse relaxation but I've heard they want to replace it with Featherstone's algorithm. Of course 2d case is really a lot easier than 3d and my focus is on accuracy rather then on performance... Anyway this task is really interesting and I'm looking forward to finish this post and start working on it !

Monday, March 5, 2007

My first blog

So I've finally started my own blog. Actually I'm not a big fan of writing but I need a place to post news about Step development.

I hope there soon will be nice pages about Step on (as suggested by and with help of Anne-Marie Mahfouf). Some time later I'm going to do another pre-release of Step - last release on sourceforge is quite outdated.