PDA

View Full Version : Newton SDL-Demos



Sascha Willems
26-06-2005, 05:10 PM
http://newton.delphigl.de/screenshots/t_sdl_charactercontroller.jpg http://newton.delphigl.de/screenshots/t_sdl_ragdolls.jpg

I just updated my Newton page ('http://newton.delphigl.de') with some SDL-demos. In total there are six demos, of which four are SDL-adoptions of older demos (ragdolls, vehicles, joints, buoyancy) and two are new.

The first new demo is meant for people that want to see how the basics of newton works and only shows how to spawn some boxes. This is as easy as it can get.

The second demo is more complex and implements a character controller for first-person like movement (think of ego-shooters). It shows how easy it is to implement such a thing with a physics engine as you get all the benefits such an engine has to offer, like correct collisions and collisionreactions and also interaction with other bodies.

All demos can be compiled with Delphi and Free Pascal (tested with FPC 2.0.0) and should work with all OS'es that are supported by Newton+SDL+OpenGL+Pascal. Unfortunately there is no dynamic library for Linux (only a static one) in the current Newton-SDK so you'll have to wait for Newton 1.35 to run those under Linux.

Sascha Willems
26-06-2005, 05:15 PM
Don't want to make this public in the news :
If you just want to try out the demos, you should get this package (http://newton.delphigl.de/files/sdlnewtondemos_binary_win32.zip) (~700 KBytes), which contains Win32 binaries for all the demos and all the needed DLLs and data. This way you can directly try out all the demos.

savage
26-06-2005, 10:45 PM
Thanks Sascha, this is all great stuff!!!

Traveler
27-06-2005, 02:25 PM
Wow that is really cool!

About the ragdoll demo. It's by far my favourite demo. But I noticed that when you flip and collide the puppets a bit too hard they'll start to spin so fast that they don't stop anymore.
I suppose it probably wont appear in a game. But I thought I should mention it nonetheless.

Also the charactercontroller demo doesn't work for me. When I start the demo I see something that looks like the first picture in the post above. But after about one second the screen goes all blue.

Sascha Willems
27-06-2005, 02:29 PM
@Ragdoll demo :
That's because the forces you apply are getting to big for the ragdoll joint to keep the joints together. Usually it should help to set the framerate for physics calculations to a higher value or apply some damping-force.

@Character controller :
Seems that SDL has problems taking control over the mouse on some system. Another guy already reported this. Usually you should be able to move your view with the mouse, but it seems to not work for some of you ppl. Maybe someone with more SDL experience knows what the problem here is? But I'll try to get it fixed.

P.S. : Thanks for feedback!

savage
27-06-2005, 04:03 PM
I'll have a look at the SDL code later today.

Sascha, are you using gameSpace or Max more often now?

savage
27-06-2005, 11:43 PM
This is probably a cheeky request. Any possibility of adding a gun so we can shoot stuff at the boxs to see them move around and fall. Maybe they should just fire paint pellets.

Btw, to keep the Mouse focused within an SDL Window you should use
SDL_WM_GrabInput( SDL_GRAB_ON );

or

SDL_WM_GrabInput( SDL_GRAB_OFF );
To turn it off.

you can also use
mode := SDL_WM_GrabInput( SDL_GRAB_QUERY );
to find out what is the current GrabMode.

I would also suggest using SDL_ShowCursor( 0 ) to hide the cursor, to avoid the distraction caused of it appearing and disappearing.

Sascha Willems
28-06-2005, 11:47 AM
Thanks Dominique! I've just uploaded the fixed versions, so anyone having troubles with the character controller please redownload either the whole package or only the character controller package.

As for shooting stuff :
It's not hard to implement, so I'll try to get it into the character controller demo as soon as I get some time to work on it.

Traveler
28-06-2005, 08:46 PM
I've tried the newest version but I'm afraid I still have the blue screen. The complete disappearing of the mouse makes it even more frightning :?