Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Jul 2012
Offline Last Active Sep 30 2013 07:09 PM

Topics I've Started

SDL_net get MAC address from socket

14 May 2013 - 01:51 AM


Say I'm the server, a client is connected to me using TCP. How can I get the client's MAC address from it's socket using the SDL_net library?

Thank you for your help.

Two way TCP with SDL_net

23 April 2013 - 02:45 AM


I use the code from the following great tutorial:


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.

Thank you,


ODE problem with Hinge2 joint

09 February 2013 - 08:18 AM

I've been trying to create a car model with the ODE physics engine.

I set the rear wheels to always face forward parallel with the chassis:

dJointSetHinge2Param ( joint, dParamLoStop, 0.0);
dJointSetHinge2Param ( joint, dParamHiStop, 0.0);

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:



Thank you for your help.

Which physics library can also step backwards in time?

18 December 2012 - 05:48 AM

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:
[source lang="cpp"]world.update(0.05);world.update(0.05);...world.update(-0.025);world.update(-0.05);world.update(-0.025);[/source]
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.

[SDL] Pixel access segfault

03 September 2012 - 05:10 AM

I try to access a pixel on a surface with the getpixel function from SDL's help:

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?