Newton .NET wrapper

Share with us how are you using the powerrrr of the force

Moderator: Alain

Newton .NET wrapper

Postby _vlad » Fri Oct 22, 2004 10:55 am

I thought I'd put it here also for everybody to find and to avoid that
someone starts another one from scratch :

I've started a .NET wrapper for Newton with The unProfessional.
Actually there are enough functions implemented to make some cool demos.
http://sourceforge.net/projects/newton-dotnet/
There are enough functions to implement new ones without much pain (the hard points are already sorted out).
Look in the cvs for all the .h necessary to create the .NET c++ class project.

If you need some help to use it (it's not out of the box yet) ask here.
If you want to implement missing functions, tell here also.
If you use it to make something cool you can tell here also that would be nice.
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Can't get it working...

Postby Quimbly » Wed Nov 10, 2004 2:13 am

I get runtime errors when I use the provided NewtonWrapper.dll and I get all sorts of errors when I try to recompile the solution.

I've got Framework 1.1 and VS.NET 2003.

Can you guys help me out?
Quimbly
 
Posts: 35
Joined: Wed Nov 03, 2004 6:45 pm

Postby _vlad » Thu Nov 11, 2004 12:01 pm

I get runtime errors when I use the provided NewtonWrapper.dll

Have you used the Newton.dll included in my zip also ? (another version would crash my wrapper)
The only time I saw runtime errors with my wrapper was when doing illegal Newton operations.
and I get all sorts of errors when I try to recompile the solution.

Please be more specific, what errors ?
I've got Framework 1.1 and VS.NET 2003.

The same for me.

I'd be glad to make the wrapper useable by everyone.
Here's my msn address :
vlad_crazycoder at hotmail.com
or we can contact via irc also.

Also you can check my game using my wrapper :
http://vlad-game-coding.site.voila.fr/ (the NewtonLander project.)
It may help.
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby Quimbly » Fri Nov 12, 2004 3:50 am

Ok, here's what I've done:

1. Downloaded the source code zip file from the SF page. Unzipped it, and opened the solution file.

2. Compiled. Error: "fatal error C1083: Cannot open include file: 'NewtonWrapper.h': No such file or directory".

The NewtonWrapper.h file exists in the \NewtonWrapper folder, but I don't understand why the project file is not correct. Anyway, I copied the file from the \NewtonWrapper folder in the solution folder and compiled again.

3. Next error: "fatal error C1083: Cannot open include file: 'NW_general.h': No such file or directory" So, I copy all the files from the \NewtonWrapper folder into the solution folder.

4. I recompile. I get a bunch of warnings about c-style casts, and one error: "NewtonWrapper fatal error LNK1104: cannot open file '....\desktop\visual studio net 2003\vc7\lib\msvcrt.lib'". Project setting problems...

5. So I remove the msvcrt.lib file from the project and reinsert it from a good location. Recompile. Error: NewtonWrapper warning LNK4099: PDB 'libc.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\nochkclr.obj' or at 'C:\Documents and Settings\.....\My Documents\Visual Studio Projects\NewtonWrapper\Debug\libc.pdb'; linking object as if no debug info"

So, it looks like its still a solution/project config problem, but I can't figure out what I'm missing. Any suggestions on where to go from here?
Quimbly
 
Posts: 35
Joined: Wed Nov 03, 2004 6:45 pm

Postby bal » Fri Nov 12, 2004 4:55 am

Change the paths to all those libraries so they match with your folder structure?
User avatar
bal
 
Posts: 18
Joined: Wed Nov 10, 2004 10:03 am

Postby _vlad » Fri Nov 12, 2004 11:47 am

There were missing files in the cvs. It's corrected (you have to wait a few hours for sourceforge anonymous cvs to be up to date).

I downloaded my wrapper from cvs and built it again to check :
- Download my wrapper from cvs somewhere on your harddrive :
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/newton-dotnet co "Newton Wrapper"
- Create a C++ project : .NET class library named NewtonWrapper
- Remove all files from solution (NewtonWrapper.h/.cpp, stdafx.h/.cpp, ressources)
- Copy all the files from cvs into the project directory and add them to the solution. There are 13 ".h" + NewtonWrapper.cpp + Newton.h + AssemblyInfo.cpp
- disable precompiled headers from solution options (C++/Precompiled headers/Do not use precompiled header)
- add newton.lib (not included) to additional dependencies (linker/input/additional dependencies)
- still new and delete are missing for the linker so add msvcrt.lib to the additional dependencies also.
- compiles fine. To check the dll use ildasm tool (visual studio prompt).

I used the resulting NewtonWrapper.dll in my game to test it and it worked.
Any more problems ?

I couldn't resist posting a screenshot of me flying around my room (bsp level) using the Axiom Engine with the new Bsp SceneManager and with Newton collisions, so easy to do 8) :
Image
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby Julio Jerez » Fri Nov 12, 2004 12:55 pm

Wow that looks vey nice. Is the funiture set with phyics properties?
Are you using some trick for object placement, so they do not adjust to rest when they are touch the first time?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby _vlad » Fri Nov 12, 2004 1:23 pm

All the furnitures are part of the bsp level.
I read a few GtkRadiant tutorials and that was easy to do.
I create a collision tree for the geometry at the beginning.
All the faces have material 0. So I can land where I want if I wish.

When the collision queries will be finished in the bsp scenemanager, I could even use a usermeshcollision (I managed to use it with an heightmap) that work independently of the scenemanager (generic collision queries).
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby Quimbly » Fri Nov 12, 2004 7:30 pm

Awesome; I got it to compile. Thanks very much for the step-by-step instructions. You rock. I'm an idiot when it comes to project settings sometimes.

I'm at work now, but I'll try out the compiled DLL once I get home. Wooohooo!
Quimbly
 
Posts: 35
Joined: Wed Nov 03, 2004 6:45 pm

Postby Quimbly » Sat Nov 13, 2004 7:37 am

Ok, I got it compiled at home. I just got the one linking warning, but it's unimportant. The DLL seems to be in good. I used ilsasm to open it. I'm not very good at IL, however. :P

I do get an error when I try to compile the project in Release (rather than debug) mode. I'm assuming this isn't a problem.

Ok, now, implementation. I've written a C# app in which I wrote my own dynamics engine. I'm wanting to take out my physics, however, and use Newton's instead. I use CsGL for graphics.

I assume all I need is to add the "using NewtonWrapper;" directive, add the DLL as a reference to the project and then get going using Newton, right? Well, I tried this, but get the following error when I try to create a Newton world (i.e.
Code: Select all
NewtonWorld nWorld = new NewtonWorld();
):

File or assembly name NewtonWrapper, or one of its dependencies, was not found.


Compiles file, but dies at runtime. Hmm, I must be tired. What am I missing?

Ahh, maybe I need to also have the Newton.lib file in my project somehow? I'm getting confused.
Quimbly
 
Posts: 35
Joined: Wed Nov 03, 2004 6:45 pm

Postby _vlad » Sat Nov 13, 2004 9:45 am

I assume all I need is to add the "using NewtonWrapper;" directive, add the DLL as a reference to the project and then get going using Newton, right?

Right. But also put Newton.dll in bin/debug/.

File or assembly name NewtonWrapper, or one of its dependencies, was not found.

You could use Dependency Walker on the NewtonWrapper to check for missing dependencies. But you surely have forgotten to put the Newton.dll along NewtonWrapper.dll in the bin/debug directory

It's only a wrapper, still needs the original :)
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby _vlad » Sat Nov 13, 2004 9:55 am

I just got the one linking warning

The same for me (and some cast warnings) It's not important.

I do get an error when I try to compile the project in Release (rather than debug) mode.

Never tried. Don't know what it is. I'll try later maybe.

And the line for creating the world
Code: Select all
NewtonWorld nWorld = new NewtonWorld();

should be
Code: Select all
int world = Newton.Create(0,0);

(Memory callbacks are not handled yet by my wrapper.)

Usually, pointers are seen as "int"s in my wrapper.
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby _vlad » Sat Nov 13, 2004 3:45 pm

I use CsGL for graphics.

I can't resist pointing you to Axiom [url]http://axiomengine.sourceforge.net/
[/url] for rendering. You may want to give it a try someday even if you may need to browse through the forums to make use of it. Once you have a little test app up, you will marvel at the simplicity and power of it.
_vlad
 
Posts: 36
Joined: Mon Oct 11, 2004 5:39 pm

Postby Quimbly » Tue Nov 16, 2004 12:59 am

(Memory callbacks are not handled yet by my wrapper.)


So, what is the significance of this?

Basically, I want to use Newton to do simple collisions between basic 3-d objects. Not having the callbacks means I can't do this? Or does it mean I need to test for a collision on my own before advancing the next iteration of the Newton world?
Last edited by Quimbly on Tue Nov 16, 2004 2:22 pm, edited 1 time in total.
Quimbly
 
Posts: 35
Joined: Wed Nov 03, 2004 6:45 pm

Postby The unProfessional » Tue Nov 16, 2004 1:21 am

Actually, the most useful callbacks are working in the wrapper. He just means that the memory allocation and memory release callbacks aren't implemented. Other callbacks are.

You don't need to work any harder than you would working directly w/ newton.
The unProfessional
 
Posts: 131
Joined: Sun May 02, 2004 9:08 pm
Location: Southern California

Next

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 7 guests

cron