Official Pascal-Header (SDK 1.53), last update 26.05.2006

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Official Pascal-Header (SDK 1.53), last update 26.05.2006

Postby Sascha Willems » Wed Nov 24, 2004 3:21 pm

All Delphi-Users out there can now use the newest NGD-version, as there is now an official, always up-to-date header :

Download :

History :
  • Update on 13.03.2005 :
    Since there were some question on why the header wasn't updated when NGD 1.32 was released I should clear it up. 1.32 doesn't bring in new functions nor does it change any, which means that the header needed no update and also works with 1.32.
  • Update on 03.04.2005 :
    The header now also supports the double precision DLL of newton. To use it, you need to declare (either globally or in the header, see header line 53) NEWTON_DOUBLE_PRECISION and need the according DLL. I also uploaded an Delphi example-project that uses double precision.
  • Update on 02.01.2006 :
    Header updated to accomplish the release of NGD 1.5. Header for custom joints translated to pascal and added to the download.
  • Update on 13.03.2006 :
    Minor header updated for NGD 1.52.
  • Update on 26.05.2006 :
    Minor header updated for NGD 1.53.
    Note :The parameters for the function NewtonWorldRayCast have changed. There is now a prefilter callback, so if you use this function you need to change it according to 1.53 or else it won't compile.
  • Update on 28.05.2006 :
    Added NewtonBodyGetForceAndTorqueCallback to the header.
    Fixed bug with limits on corkscrew joint in custom joints unit.


Supported compilers :
The headers should work with Delphi 5 and up, Free Pascal, Virtual Pascal, GNU Pascal and even under MacOS (Darwin).

Credits go to :
Sury, who was the author of the original header
_Tux_, for putting the new (1.30) functions into the header and for the initial translation of the custom joints
Martin Waldegger, for the static version

If you have any problems, feedback or find bugs, please post them here.
Last edited by Sascha Willems on Sun May 28, 2006 9:47 am, edited 12 times in total.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby _Tux_ » Wed Nov 24, 2004 3:43 pm

Credits go to :
Sury, who was the author of the original header
_Tux_, for putting the new (1.30) functions into the header

and Sascha for fixing _tux_'s spelling mistakes :lol:
_Tux_
 
Posts: 81
Joined: Wed Sep 08, 2004 10:38 am
Location: UK

Postby tomek » Wed Nov 24, 2004 6:53 pm

About 4-5 years ago I was programming in Delphi. We even made with my friend 3D FPP Shooter and tried to put it on the shelves, but only one small company wanted to take that risk and it ended up with nothing.

So when I saw your headers I shed a tear - good old Pascal, my first language of choice...
tomek
 
Posts: 102
Joined: Wed Jun 23, 2004 12:34 pm

Postby Sascha Willems » Thu Nov 25, 2004 4:38 pm

I've released two demos today, that are more meant for developers than for people cheking out newton. Both demos show off some of the (new) features, but come with source and are very well documented to avoid developers in unterstanding and integrating those features. The sources should be compileable with Delphi 4 and up.

Demo 1 : Joints
Image
(Click)
Download
This shows the different joint types newton has to offer and how to implement them. It also shows how to use newton's raycast features.

Demo 2 : Vehicle container
Image
(Click)
Download
This shows you how to use newton's vehicle container.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sury » Sat Nov 27, 2004 10:29 am

Hi Sascha, i'm really glad that someone is taking care of the Delphi header.
My project started to get bigger so i switched to C++ because of many reasons but mainly because of templates,macros, operator overloading and inline functions.
I'm going to sent you a modification of the header made by Martin Waldegger which allows static linking to Newton.dll , and add links on my Delphi-Newton page to your page where people could always download the most recent version.

Good luck !
S.Spasov

Edit : Changed dynamic to static to avoid further confusion of the header appliance.
Last edited by Sury on Wed Dec 01, 2004 2:46 pm, edited 1 time in total.
User avatar
Sury
 
Posts: 193
Joined: Sat Aug 14, 2004 5:32 am
Location: Bulgaria

Postby Sascha Willems » Sat Nov 27, 2004 10:33 am

You don't need to send it to me. I already know Martin (he is in our team over at delphigl.com) and he already sent me the modifications. I'll test them the coming days and the upload them.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sat Nov 27, 2004 11:47 am

Header updated (27.11.2004)

Fixes :
NewtonGetBuoyancyPlane
globalSpaceMatrix was wrongly declared as a Float. Corrected to PFloat.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sat Nov 27, 2004 3:45 pm

I've just uploaded the static header contributed by Martin Waldegger, see the first post for download link. Use this unit if you don't want to include the separate DLL.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sun Nov 28, 2004 1:58 pm

Another demo with fully documented sources (Delphi) :

Demo 3 : Buoyancy
Image
Download
Newton's buoyancy feature let's you simulate (amongst other things) bodies that are immersed in a fluid. This demo shows how it's basicly done.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Julio Jerez » Mon Nov 29, 2004 6:14 pm

I noticed the bodies falling very slowly, then I opened source file and saw the Newton update is been called with a fix time of 0.005, that’s about 200 fps, but of the demo run at 60 that will explain why the objects fall so slowly. I also notice you set the min FPS to 150, if this is what you want don’t you think it is better to just call the update with the elapsed time since the past frame.

Also one thing about cones: cones are centered to the geometric origin. That is 0.5 of the height but that’s not the center of gravity of a cone. The center of gravity of a cone is at 1/3 of the high from the base. It is the only primitive with the center of gravity different from the graphic origin; I will consider that as a bug and fix it for the patch.
Julio Jerez
Moderator
Moderator
 
Posts: 10954
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby Sascha Willems » Mon Nov 29, 2004 6:20 pm

Yes, I'm using a fixed time step in that demo which is not a very good choice, but I wanted to have the code as simple as possible (so that people don't get confused by for example QueryPerformanceCounter) and the 150 FpS must be a leftover I forgot to remove, so I'll change that.

And as for the cone : I took the moment of inertia formula of it from here , which is (see second one, through center of mass) 3/80*Mass*Height² + 3/20*Mass*Radius², so that should be right.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Julio Jerez » Mon Nov 29, 2004 6:29 pm

About the cone, it is not in your side it is in the Newton side. I made the mistake to take the center at 1/2 of the height when and when it should be 1/3 from the base. I think when I made the change it will be much more natural.

about the timing since most computers lock the FPS a 60 maybe it is better to call the update with something like with something like 1/120 or 1/100 instead of 0.005 which is 1/200 maybe too high.

I know it is for educational purpose, but since people will run the exe first before they compiler the code the first think they will notice is how slow the body are falling.
Julio Jerez
Moderator
Moderator
 
Posts: 10954
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby Sascha Willems » Mon Nov 29, 2004 6:48 pm

Now that I think of it, you're totally right Julio. I'm right now changing the demo to use proper timing and upload a new version later.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sat Jan 08, 2005 8:52 am

The headers were updated. Thanks go out to caperaven who pointed out that the declaration for NewtonAddBodyImpulse was wrong. It was updated and tested and should work with both headers (static and dynamic) now.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sun Jan 09, 2005 1:47 pm

The header has been updated to SDK 1.31. If there are any problems concerning the new functions, please let me know!

Edit : I've removed the personal comments made by Delfi. If you have any personal problems to "discuss" with me, do it by PM or better don't tell me about it at all, I'm resistant to other peoples view and like to walk my own way. If you don't want to use the header cause you have problems with me, it's not my problem.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Next

Return to General Discussion

Who is online

Users browsing this forum: Dave Gravel and 2 guests