Irrlicht .NET CP
-
- Posts: 24
- Joined: Tue Jul 11, 2006 2:24 pm
- Contact:
-
- Posts: 24
- Joined: Tue Jul 11, 2006 2:24 pm
- Contact:
Well, I've now got 1.1.6 installed, but it still won't build:
Makes me wonder exactly what its trying to do :/
Operator '!=' cannot be applied to operands of type 'Irrlicht.NET.NativeElement._raw' and 'null' (CS0019) on line 47 of NativeElements.cs
Code: Select all
if(_raw != null && _raw != IntPtr.Zero)
Yeah actually there's an error.
Remove the "_raw != null", it won't happen. (I'll upload it corrected)
That's strange because i thought I had compiled it on Mono before but this is something that Mono won't let.
Remove the "_raw != null", it won't happen. (I'll upload it corrected)
That's strange because i thought I had compiled it on Mono before but this is something that Mono won't let.
Irrlicht .NET complete and Cross Platform Wrapper
The kid on my avatar wrote:A painless lesson is one without any meaning
p/invoke performance issue?
ive noticed that on my machine it seems that this wrapper perhaps suffers some performance penalty conpared to the "official" irrlicht .NET wrapper. I haven't precisely done this scientifically, but for example, the original newton tutorial with the official wrapper runs at better than 400 FPS on my machine, while, the converted newton tutorial you PM'd me run at 59 at best. I realize they do have some pretty significant environmental differences, but I wonder also if some of this is not also the performance hit associated with the p/invoke overhead for data marshaling, as summed up a bit here:
http://msdn2.microsoft.com/en-us/library/ky8kkddw.aspx
could this be related?
I notice earlier in the thread you were actually seeing a performance INCREASE in this test DeusXL, were you running it in Linux, perhaps this is a VS bug?
http://msdn2.microsoft.com/en-us/library/ky8kkddw.aspx
could this be related?
I notice earlier in the thread you were actually seeing a performance INCREASE in this test DeusXL, were you running it in Linux, perhaps this is a VS bug?
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Actuallly there are some code that should run slower than the official .NET wrapper.
But no, P/Invoke is supposed to be really fast and I tried to limitate conversions whereas there are many...
Could you send me your code on both wrappers so that I could test and see ? Because I know that sometimes, P/Invoke may be slow (with heavy conversions) but if you haven't many code in the main loop, there is no reason that P/Invoke is slow since, actually, you are as close from the native code than with native C++ so it really depends of your code !
PS : As I said, differences between both wrappers is perhaps 1 or 2 fps when you have 400 ! Differences I got when testing Newton were really strange and I think it was because of the code I had changed to port the Newton tutorial on my wrapper.
But no, P/Invoke is supposed to be really fast and I tried to limitate conversions whereas there are many...
Could you send me your code on both wrappers so that I could test and see ? Because I know that sometimes, P/Invoke may be slow (with heavy conversions) but if you haven't many code in the main loop, there is no reason that P/Invoke is slow since, actually, you are as close from the native code than with native C++ so it really depends of your code !
PS : As I said, differences between both wrappers is perhaps 1 or 2 fps when you have 400 ! Differences I got when testing Newton were really strange and I think it was because of the code I had changed to port the Newton tutorial on my wrapper.
Irrlicht .NET complete and Cross Platform Wrapper
The kid on my avatar wrote:A painless lesson is one without any meaning
I did some dirty hack'n'slash and added MD3 wrapper support for Irrlicht.NET CP. It will work as long as you're using this patch.
Since i cant be bothered to figure how to create patches with something i dont have a svn to compare with , here goes :
1. Apply the md3.patch to your irrlicht project. Recompile.
2. Now go to your IrrlichtW project, open animatedmesh.h and find :
Under it add :
Open animatedmesh.cpp
Find :
Under it add :
3. Save and recompile.
4. Now go to your Irrlicht.NET wrapper and find AnimatedMesh.cs in Scene/Meshes
Find :
Make it look like :
Please take it easy on me, im still learning. Im sure i might have missed some stuff here and there. One strange thing i noticed when i fired up Meshviewer.exe ( both Irrlicht and Irrlicht.NET versions ) is that md3 models load strangely positioned. Because this happens on the non-.NET version i assume it's a bug in the patch, but maybe it's my mistake somewhere
Since i cant be bothered to figure how to create patches with something i dont have a svn to compare with , here goes :
1. Apply the md3.patch to your irrlicht project. Recompile.
2. Now go to your IrrlichtW project, open animatedmesh.h and find :
Code: Select all
EXPORT IntPtr AnimatedMeshSceneNode_GetXJointNode(IntPtr node, M_STRING jointName);
Code: Select all
//=========== MD3 Support ============
EXPORT IntPtr AnimatedMeshSceneNode_GetMD3TagNode(IntPtr node, M_STRING tagName);
EXPORT void AnimatedMeshSceneNode_SetAnimation(IntPtr node, int animIdx);
EXPORT void AnimatedMeshSceneNode_AddAnimation(IntPtr node, int firstFrame, int lastFrame, int FPS);
EXPORT void AnimatedMeshSceneNode_LinkAnimation(IntPtr node, int anim, int linkedAnim);
//=========== END MD3 Support ========
Find :
Code: Select all
IntPtr AnimatedMeshSceneNode_GetXJointNode(IntPtr node, M_STRING jointName)
{
return GetNodeFromIntPtr(node)->getXJointNode(jointName);
}
Code: Select all
//========= MD3 Support =========
IntPtr AnimatedMeshSceneNode_GetMD3TagNode(IntPtr node, M_STRING tagName)
{
return GetNodeFromIntPtr(node)->getMD3TagNode(tagName);
}
void AnimatedMeshSceneNode_SetAnimation(IntPtr node, int animIdx)
{
GetNodeFromIntPtr(node)->setAnimation(animIdx);
}
void AnimatedMeshSceneNode_AddAnimation(IntPtr node, int firstFrame, int lastFrame, int FPS)
{
GetNodeFromIntPtr(node)->addAnimation(firstFrame, lastFrame, FPS);
}
void AnimatedMeshSceneNode_LinkAnimation(IntPtr node, int anim, int linkedAnim)
{
GetNodeFromIntPtr(node)->linkAnimation(anim, linkedAnim);
}
4. Now go to your Irrlicht.NET wrapper and find AnimatedMesh.cs in Scene/Meshes
Find :
Code: Select all
public enum AnimatedMeshType
{
Unknown,
MD2,
MS2D,
OBJ,
BSP,
T3DS,
X,
MY3D,
LMTS,
CSM,
OCT
}
Code: Select all
public enum AnimatedMeshType
{
Unknown,
MD2,
MD3,
MS2D,
OBJ,
BSP,
T3DS,
X,
MY3D,
LMTS,
CSM,
OCT
}
Excellent sh1ny, I'll try it
For now, I try to remain on Irrlicht's official SDK but who knows !
PS : There's just something strange, you create functions in the IrrlichtW wrapper but do not "wrap" them in the C# wrapper. You'll be able to load MD3 in Irrlicht but not manipulate them I think.
For now, I try to remain on Irrlicht's official SDK but who knows !
PS : There's just something strange, you create functions in the IrrlichtW wrapper but do not "wrap" them in the C# wrapper. You'll be able to load MD3 in Irrlicht but not manipulate them I think.
Irrlicht .NET complete and Cross Platform Wrapper
The kid on my avatar wrote:A painless lesson is one without any meaning
Yes, i was sure im forgetting something Forgive the noob
Here goes :
Open AnimatedMeshSceneNode.cs in your Irrlicht.NET CP project ( located in Scene/SceneNodes ) and find :
Under that add :
Further down find :
Under it add :
Im also thinking of modifying the patch to use SetMD3Animation, AddMD3Animation for the sanity's sake Also since Irrlicht's svn version doesnt compile for me ( im sick of removing links to libs that keep appearing again in ms vc++ 2005 ) ill be porting and adding the ogre and obj loaders/managers to current 1.0 code and wrapping them into the CP lib And yea it's MSVC's fault that irr svn doesnt compile, but i prefer using it over code::blocks for some reason
Here goes :
Open AnimatedMeshSceneNode.cs in your Irrlicht.NET CP project ( located in Scene/SceneNodes ) and find :
Code: Select all
public SceneNode GetXJointNode(string jointName)
{
return (SceneNode)
NativeElement.GetObject(AnimatedMeshSceneNode_GetXJointNode(_raw, jointName),
typeof(SceneNode));
}
Code: Select all
//MD3 File Support
public SceneNode GetMD3TagNode(string tagName)
{
return (SceneNode)NativeElement.GetObject(AnimatedMeshSceneNode_GetMD3TagNode(_raw, tagName), typeof(SceneNode));
}
public void SetAnimation(int animIdx)
{
AnimatedMeshSceneNode_SetAnimation(_raw, animIdx);
}
public void AddAnimation(int firstFrame, int lastFrame, int FPS)
{
AnimatedMeshSceneNode_AddAnimation(_raw, firstFrame, lastFrame, FPS);
}
public void LinkAnimation(int anim, int linkedAnim)
{
AnimatedMeshSceneNode_LinkAnimation(_raw, anim, linkedAnim);
}
//End MD3 File Support
Code: Select all
[DllImport(Native.Dll)]
static extern IntPtr AnimatedMeshSceneNode_GetXJointNode(IntPtr node, string jointName);
Code: Select all
//MD3 File Support
[DllImport(Native.Dll)]
static extern IntPtr AnimatedMeshSceneNode_GetMD3TagNode(IntPtr node, string tagName);
[DllImport(Native.Dll)]
static extern void AnimatedMeshSceneNode_SetAnimation(IntPtr node, int animIdx);
[DllImport(Native.Dll)]
static extern void AnimatedMeshSceneNode_AddAnimation(IntPtr node, int firstFrame, int lastFrame, int FPS);
[DllImport(Native.Dll)]
static extern void AnimatedMeshSceneNode_LinkAnimation(IntPtr node, int anim, int linkedAnim);
//END MD3 Support
Yes i did some cleaning on those, but msvc 2005 insisit i should include libci.dll ( or .lib cant remember right now ). First was odbc32.lib wich is somewhat of "confirmed bug" in the express edition im using, then i fixed the project files and finally i started to get these. I think ill leave it at that for today
-
- Posts: 24
- Joined: Tue Jul 11, 2006 2:24 pm
- Contact:
Well I never tested the latest SVN but what if you compile the project IrrlichtW using SVN includes ?
Irrlicht .NET complete and Cross Platform Wrapper
The kid on my avatar wrote:A painless lesson is one without any meaning
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You're already posting in itRowan Lewis wrote:Also, perhaps we need a forum here for 'DeusXLs Irrlich.NET'?
It's simply the common way to have a large thread per project. If there are special things to handle there's no problem to open up a new thread on that topic. Maybe the .net forum would be a good place for it.
-
- Posts: 24
- Joined: Tue Jul 11, 2006 2:24 pm
- Contact:
Oh, before I forget, you might want to fix the 'F' key:
Code: Select all
Key_E = 0x45, // E key
F = 0x46, // F key
Key_G = 0x47, // G key
Thanks, fixedRowan Lewis wrote:Oh, before I forget, you might want to fix the 'F' key:
Code: Select all
Key_E = 0x45, // E key F = 0x46, // F key Key_G = 0x47, // G key
Irrlicht .NET complete and Cross Platform Wrapper
The kid on my avatar wrote:A painless lesson is one without any meaning