A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by _Tux_ » Thu Jun 30, 2005 1:41 pm
update:
if i check the user data streight away it works fine and the memory address is $3BFAF0.
but the memory address for the joint in SubmitJointConstraint is $E7489B0.
-
_Tux_
-
- Posts: 81
- Joined: Wed Sep 08, 2004 10:38 am
- Location: UK
by Sascha Willems » Thu Jun 30, 2005 2:49 pm
That's odd. I just did a quick test and assigned user data to a joint (some useless TDummy class) and also retrieved it with NewtonJointGetUserData and had no problems. The function returned the correct pointer to the class.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by _Tux_ » Thu Jun 30, 2005 3:40 pm
yes. if i assign the userdata and then retrive it in the same procedure it works. but in the destructor or submitconstreint callbacks its the wrong joint pointer (so getting user data fails)
-
_Tux_
-
- Posts: 81
- Joined: Wed Sep 08, 2004 10:38 am
- Location: UK
by Sascha Willems » Fri Jul 01, 2005 4:20 am
Ah sorry, I overlooked that it only happened in the SubmitConstraints-function. However I changed my joints demo to use a custom joint and retrieve the data I assigned with NewtonJointSetUserData in that SubmitConstraints-function and it works like a charm.
But I noticed that (at least in the code you posted) you missed the "cdecl" behind SubmitConstraints. If I leave that out I also don't get the right pointer, if I add it everything works as it should.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by _Tux_ » Fri Jul 01, 2005 7:40 am
Sascha Willems wrote:But I noticed that (at least in the code you posted) you missed the "cdecl" behind SubmitConstraints. If I leave that out I also don't get the right pointer, if I add it everything works as it should.
*hits head on desk*
i cant beleive i missed something that simple! ive been working with DLLs all day and i do something silly like that.
thanks for pointing it out
-
_Tux_
-
- Posts: 81
- Joined: Wed Sep 08, 2004 10:38 am
- Location: UK
by Sascha Willems » Fri Jul 01, 2005 9:09 am
Tux, are you converting those examples just for your personal use or do you want to have them available in one package with the header? Since those are also in the newton SDK it would be nice to also have them for the pascal users, but I haven't had the time to translate them (though I started but never got onto it again). If you want them to be public and need help translating them, just drop me a line.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by _Tux_ » Fri Jul 01, 2005 10:13 am
its for a game engine, but the joint classes arent linked into it. ill see what i can do. but ive still got 4 of the joints to do
-
_Tux_
-
- Posts: 81
- Joined: Wed Sep 08, 2004 10:38 am
- Location: UK
by JernejL » Mon Jan 02, 2006 11:49 am
I couldn't wait to use newton 1.5 in delphi, so i translated the newton 1.5 import header:
download it from:
http://www.gtatools.com/temp/PascalNewton.zip
this should also work in FPC with minimal or no changes.
it should be also compatible with sury's and other older newton pascal headers.
please write me back any bugs you may find.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Sascha Willems » Mon Jan 02, 2006 11:56 am
Well, I'm right now preparing the release of the official headers. This time it takes a bit longer as I'll also include a translation of the custom joints for Delphi and this one needs some changes to work with FPC, and that's what I'm right now doing.
So stay tuned. The official headers will come either this evening or early tomorrow.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by Sascha Willems » Mon Jan 02, 2006 12:25 pm
So here you go. I have uploaded the updated header and it now
also includes a translation of the custom joints for Delphi and Pascal (later one not tested with FPC).
Huge thanks go out to Jon Walton (aka _Tux_), who did the initial translation of the custom joints to Delphi.
Both files (actually three, there is also a math helper unit for the custom joints) can be downloaded from
here (~20 KBytes).
If you find any bugs, please report them here. I only did some quick tests with the current build of the NewtonPlayGround, so there still may be errors in that headers.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by JernejL » Mon Jan 02, 2006 12:25 pm
Sascha Willems wrote:Well, I'm right now preparing the release of the official headers. This time it takes a bit longer as I'll also include a translation of the custom joints for Delphi and this one needs some changes to work with FPC, and that's what I'm right now doing.
So stay tuned. The official headers will come either this evening or early tomorrow.
custom joints demo translation sounds great, but why bother with re-translating the header if you can use this one with micronian changes for fpc?
EDIT after sacha's second reply:
you forgot the delphinewton.inc?
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Sascha Willems » Mon Jan 02, 2006 12:32 pm
Ah, sorry for that. I tend to forget about the .inc files all the time
I just reuploaded with that file included.
Oh, and with the "changes for FPC" I didn't mean the normal header (which works with FPC with no changes), but meant the custom joints translation which needed some small changes to also work with FPC (at least to compile, haven't tested the joints with FPC actually).
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
by _Tux_ » Mon Jan 02, 2006 12:37 pm
ill get round to updating my copy of the staticdll import sometime soon
-
_Tux_
-
- Posts: 81
- Joined: Wed Sep 08, 2004 10:38 am
- Location: UK
by JernejL » Mon Jan 02, 2006 12:43 pm
Sascha Willems wrote:Ah, sorry for that. I tend to forget about the .inc files all the time
I just reuploaded with that file included.
Oh, and with the "changes for FPC" I didn't mean the normal header (which works with FPC with no changes), but meant the custom joints translation which needed some small changes to also work with FPC (at least to compile, haven't tested the joints with FPC actually).
why do you need the inc file at all? i don't see any use of it in the newtonimport ( or i am blind? )
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Sascha Willems » Mon Jan 02, 2006 12:54 pm
See line 35 :
- Code: Select all
{$I delphinewton.inc}
It's used for compatibility with other Pascal compilers like FPC.
-
Sascha Willems
- Moderator
-
- Posts: 346
- Joined: Fri Aug 27, 2004 10:18 am
- Location: Germany
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 12 guests