But I can send only from the client to the server. Can you help me what do I have to add the code to send from the server to the client? Do I have to create another socket, or I can use that one already open? Note that I need only one client per server, so I want just something simple.
When the car is moving forward it's fine but when the car turns the rear wheels get turned somehow. I control only the front wheels, it's not four wheel steering.
I've tried to set other parameters of the Hinge2 joint as well like dParamERP and CFM, dParamStopERP and CFM or dParamBounce but they had no effect on this, I've also tried number 1 and 2 from these. (See in the ODE manual: Joint types -> Parameter Functions.)
Here are two screenshots to see the problem better:
I'm looking for a free, cross-platform (windows and linux is enough for me), C/C++ physics library which can also step physics back in time, not only forward in time.
For example, what I want to do looks like this:
And I want to get the same state in the end as it was at the beginning.
I have already tried Box2D and chipmunk physics. Box2D only stops time for negative values (does nothing), chipmunk does the thing (ok not very accurately) as long as there are no collisions. If there was a collision meanwhile, I get completely different result when rolling things back in time. Without any collisions it works.
Have you guys ever did this, or know which library can do it well?
I could even try ODE, if it can do this. It's 3D, but I can use it for 2D too I guess.
It works for 32bit surfaces, but gives segfault for 8bit surfaces at line return *p; after case 1:. If I change that line to return *(Uint32*)p; I don't get segfault, but when I try to use the returned value by either SDL_GetRGB or SDL_GetRGBA, I get segfault, so the returned value is obviously incorrect. (However with the 32bit surface these functions work, so it's not me using them wrong way.) I haven't tested for 16 or 24 bit surfaces. Aslo the 32bit surface was loaded from a png with per pixel alpha, but the 8bit surface was loaded from a bmp with colorkey alpha, but I don't think this matters. Any idea how to get it working?