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

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Postby Sascha Willems » Wed Jun 08, 2005 12:21 pm

I know of hat "problem", as I myself tried Newton with FreePascal (but under Win32). It's just 3 or 4 functions that are in the headers (and in the original C-Headers, therefore I took them too) which aren't exposed through the DLL. When NGD1.35 will be released and I update the headers for Delphi, I'll do a quick test with FP (Win32) to avoid such things happening.

P.S. : If I'll ever get the time, I'll try to get at least some basic template working with FPC under Linux. I don't want to use Lazarus, so I decided to go for KDevelop (which looks very nice), but it's so hard to set-up everything correct that I never got it to actually work (I got KDevelop installed, and FPC too, and I even managed to install ATI-drivers with HW-acceleration for OpenGL). But as I said : If I get the time I'll try to test everything under Linux and also test on every update before releasing new Pascal-Headers.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Sun Jun 26, 2005 10:49 am

I just updated the Newton page :
  • Minor fix to the header
    Free Pascal (in contrast to Delphi) threw out some errors, as there were some functions declared in the headers (in the official ones too) that are either not in newton.dll or just are not exported from it. So I commented them out and the header can now be used with Free Pascal without any changes to it.
  • All demos ported to SDL
    I was recently contacted by Dominique Loius, who maintains the SDL-translations to Pascal if I could do some Newton demos to include with the official JEDI-SDL release. Without wasting a second I agreed and ported all the developer demos that were on my page to use SDL, so they can be compiled under all OS'es that are supported by Pascal+Newton+SDL (which in the end are Win32, Linux and MacOS). So you'll now find all the developer demos on that page are using SDL and moreover I also updated all the demos to use accumulative time-slicing, so they are now all framerate-independent. Right now you can't use them with Linux, as there is only a static library for Linux included in the current SDK. But Julio already told me that there will be a dynamic Library for Linux in the next release (1.35).
  • Two new demos
    While I was on the subject of porting the demos I added two new ones. One is very very basic, and only shows how to do the most basic stuff with newton. It's meant for people that have problems extracting infos out of complexer codes/apps.
    The second one is more interesting, as it implements a character controller inside a rather complex environment (with stairs and some dynamic stuff). The character controller itself was inspired by the one that Walaber made, so Kudos go to him!


A note for people that just wan to try out the demos :
If you download the demos, only the Win32-binary and the source is included. So you can't just run them which is in my view annoying if you just want to try it out. Therefore I packed all the win32-binaries, needed DLLs and data into one zip for those kind of people to try out : Get it here (~700 KBytes)


Feedback, wishes or constructive Feedback appreciated.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby martinw » Sun Jun 26, 2005 11:45 am

Those demos are pretty cool 8) , I did have a problem with the character controller one though, just got a blue screen after seeing lots of cubes arranged in a larger rectangle for about a second :?: maybe an arch too :?:

Keep up the good work :D
User avatar
martinw
 
Posts: 30
Joined: Wed Jun 01, 2005 1:19 pm
Location: Aberdeenshire

Postby Sascha Willems » Sun Jun 26, 2005 11:52 am

Thanks, I hope with "blue screen" you meant that you just saw a blue window? Or did the demo BSOD your system? If that's the case I'm sorry and I'll see what I can do about that.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby martinw » Sun Jun 26, 2005 11:54 am

Nope, not the blue screen of death :shock:, just a blue colour in the application window. Not a problem, it's still all very impressive.

P.S. what's SDL ?? Sorry I'm not really a programmer :oops: and I see you use Pascal, I haven't used that since university, is it still popular :?:
User avatar
martinw
 
Posts: 30
Joined: Wed Jun 01, 2005 1:19 pm
Location: Aberdeenshire

Postby Sascha Willems » Sun Jun 26, 2005 5:15 pm

SDL = Simple Directmedia Layer ([url=http://www.libsdl.org]link[/url). It's a layer between the OS and stuff like window-management, sound, input etc. So in the end it makes your applications support cross-plattform as you don't use e.g. Win32 calls to create and manage windows and input anymore but rather SDL calls which work on all supported OS'es (which are many).

And yes, Pascal is still very popular, especially in the hobby coding scene. Thanks to Borland's Delphi with it's great IDE and Free Pascal (which supports almost all platforms around) it's still very present and there are many people using it. Sadly there is near zero usage of it in the professional scene (i.e. commercial games).
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby martinw » Sun Jun 26, 2005 6:17 pm

Thanks Sascha, i'll definitely have a look at SDL and free pascal :)
User avatar
martinw
 
Posts: 30
Joined: Wed Jun 01, 2005 1:19 pm
Location: Aberdeenshire

Postby Stucuk » Mon Jun 27, 2005 8:02 am

Problem with languages other than C/C++ is that ppl who don't use them think they are no where near as powerful as C/C++. PPL need to be educated.

The charactor controler demo is definatly not working right. Im also guessing there is no check to see where the mouse is when the program starts so the screen is moved rather than the mouse being "reset".
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby Sascha Willems » Mon Jun 27, 2005 9:11 am

I'm using SDL for mouse input, and it works fine for most people. You don't need to reset the mouse cursors, I just wrap it around before it leaves a window border. Maybe SDL wasn't able to get control over the input (which sometimes happen, saw some older apps having the same problem). But I'll take a look into that matter and see what I can do.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Julio Jerez » Mon Jun 27, 2005 4:12 pm

Sascha Willems wrote:I was recently contacted by Dominique Loius, who maintains the SDL-translations to Pascal if I could do some Newton demos to include with the official JEDI-SDL release. Without wasting a second I agreed and ported all the developer demos that were on my page to use SDL, so they can be compiled under all OS'es that are supported by Pascal+Newton+SDL (which in the end are Win32, Linux and MacOS). So you'll now find all the developer demos on that page are using SDL and moreover I also updated all the demos to use accumulative time-slicing, so they are now all framerate-independent. Right now you can't use them with Linux, as there is only a static library for Linux included in the current SDK. But Julio already told me that there will be a dynamic Library for Linux in the next release (1.35).


As a faithful Master of the dark forces, you are fulfilling your destiny young Sascha. Am I reading this right or I am hallucinating, does it say “JEDI-SDL”, JEDI? hum that theme seem to pop quite frequently on the Newton forums. Very cool and very educative demos for younger the younger apprentices.
Can we get a link to that to check it out?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby Sascha Willems » Mon Jun 27, 2005 4:22 pm

*chhh* *chhhh* Ahhhh, I feel a tremor in the Force!

Yes, JEDI is right ;) JEDI in this case stands for Joint Endeavor of Delphi Innovators and is a group that tries to get as many APIs ported to Delphi as possible, of wich JEDI-SDL is one part. This is the URL.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Tue Jun 28, 2005 7:49 am

For all that have problems with the mouse viewing not working in the character controller demo :
Please redownload it (either only the character controller or the packages with all exe-files). The demo now tries to grab and focus the input on the window (using the appropriate SDL functions) and should therefore now work for everyone. If not, please drop me a line here and I'll try to fix.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Stucuk » Tue Jun 28, 2005 3:33 pm

The blue isn't the mouse. The player seem to drop for 1 second then the land disapears.


And the mouse thing. Basicaly u should reset the mouse to the center of the window at the very start. The camera is moving its self depending on where the mouse starts on the screen when the app is ran.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby savage » Wed Jun 29, 2005 1:42 pm

SDL_WarpMouse( x, y ) should allow you to reposition the mouse before the screen rendering starts. hmm, not sure if there are any anomoloies between fullscreen and windowed though.
savage
 
Posts: 3
Joined: Mon Jun 06, 2005 6:30 pm

Postby _Tux_ » Thu Jun 30, 2005 12:42 pm

there might be a possible problem with NewtonJointSetUserData or NewtonJointGetUserData

im converting the custom joint examples from the SDK and have come across a problem.

in the creation i use NewtonJointSetUserData(FJoint, Self);

i also do exactly the same with NewtonBodySetUserData and it works fine.



when i use
Code: Select all
var
 LBaseJoint: TRPBaseJoint;

Begin     
  LBaseJoint := NewtonJointGetUserData(aJoint);
the LBaseJoint is nil...

here is code to show you.

Code: Select all
  TRPBaseJoint = Class(TObject)
  protected
    FMaxDOF: Integer;

    FBody0: PNewtonBody;
    FBody1: PNewtonBody;

    FJoint: PNewtonJoint;
    FWorld: PNewtonWorld;

  public
    constructor Create(aMaxDOF: Integer; aBody0, aBody1: PNewtonBody);
    destructor Destroy;

    procedure CalculateGlobalMatrix(const aLocalMatrix0, aLocalMatrix1: TMatrix; out aMatrix0, aMatrix1: TMatrix);
    procedure CalculateLocalMatrix(const aPivot, aDir: TAffineVector; out aLocalMatrix0, aLocalMatrix1: TMatrix);

    procedure SubmitConstraint; virtual; abstract;
  end;

  TRPJointUpVector = Class(TRPBaseJoint)
  private
    FLocalMatrix0: TMatrix;
    FLocalMatrix1: TMatrix;

  public
    constructor Create(aPin: TAffineVector; aBody: PNewtonBody);

    procedure SetPinDir(const aDir: TAffineVector);

    procedure SubmitConstraint; override;
  end;


function SubmitJointConstraint(const aJoint: PNewtonJoint): Cardinal;
var
 LBaseJoint: TRPBaseJoint;

Begin     
  LBaseJoint := NewtonJointGetUserData(aJoint);
  if LBaseJoint <> nil then
    LBaseJoint.SubmitConstraint;
end;


constructor TRPBaseJoint.Create(aMaxDOF: Integer; aBody0, aBody1: PNewtonBody);
Begin
  FBody0 := aBody0;
  FBody1 := aBody1;
  FMaxDOF := aMaxDOF;

  FWorld := NewtonBodyGetWorld(aBody0);
  FJoint := NEwtonConstraintCreateUserJoint(FWorld, FMaxDOF, @SubmitJointConstraint, FBody0, FBody1);

  NewtonJointSetUserData(FJoint, Self);
   NewtonJointSetDestructor(FJoint, @JointDestructor);
end;





var
 LJoint: TRPBaseJoint;

LJoint := TRPJointUpVector.Create(aPin, aParent);





has anyone else had problems with joint userdata?
_Tux_
 
Posts: 81
Joined: Wed Sep 08, 2004 10:38 am
Location: UK

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron