Mogre with MyGUI, PhysX and SlimDX

mstoyke

22-07-2010 20:32:34

Hello everybody,

I don't have much time at the moment because I'm very busy. But I decided to release some things that I created in the past. It's a repository containing some libraries that I use for rapid prototyping my ideas.

The repository contains Mogre, SlimDX, eyecm-physx and MyGUI. All built with VS2010 and the .NET4 framework. All these components are slightly modified to work together in the way I need them. Be aware that they are all a little bit older, I don't see any need to update them as long as there are no changes in the official projects that I'm interested in.

You can find the repository at "http://bitbucket.org/mstoyke/enginedeps". It contains all sources that were used to compile the binaries that you can find in the "bin" folder. To compile anything yourself there is some work needed first to prepare the repository.

Take a look at the folders "DirectX\Include", "DirectX\Lib\x86" and "PhysX" to find some hints what is missing. If I remember correctly you need to copy some files from the DirectX SDK and the PhysX SDK before you'll be able to compile anything.

I might even have some solution files or project files in there that are still named "*VS2008*", but they are converted to VS2010 format. Sorry, there was no time to clean up the repository. I did not plan to release it for some time but now I can see that it may contain some valuable information for some Mogre users.

I also provided some code files in the "XampleCode" folder. Read the "Readme.txt" inside, it basically says you can use the example code only as reference to understand some of the libraries.

If somebody likes to take the task I give permission to post parts of these sources in the wiki for reference. They may contain some useful things. Especially some code to initialize Ogre from code only without the need of configuration files for the plugins.

If you have any questions about the files in the repository, feel free to ask them here. It may sometimes take some days for me to answer them but I'll try to keep an eye on this thread.

A little background:
I use Mogre/Ogre as graphics engine. There is more code, that I can't release, that handles my gameobjects so you may see some types named like "GO*" or "RO*", these are basically gameobjects(GO) or renderobjects(RO). The core library implements a MVC model for all game objects (also no code for this in the repo, sorry).

Every renderobject manages an Ogre entity and uses PhysX to handle all interaction in the game world. You may see some code in "ObjectManager.cs" that handles this connection.

MyGUI is used as GUI system. The MyGUI project provides a basic .NET wrapper for their widgets and has a pretty nice layout editor (also in the repository). I also added some functions to the wrapper of the core gui manager class to make life a little bit easier.

Then there is SlimDX. I use this library for input handling (mouse, keyboard, gamepad, ...) and I also have a small library that allows me to use the SlimDX D3D device wrapper to "hook" into the D3D device that is used by Ogre for rendering. This allows me to do some custom rendering magic by directly accessing the device during the Ogre renderloop. This code is also not provided at the moment, but the classes that hook into the device and handle DInput are provided.


Maybe this repository is useful for some of you and if you don't need any changes in the code you can just use the compiled binaries. And I like to thank all the creators of these fine libraries for making my coder-life so easy :)

Beauty

23-07-2010 13:07:42

But I decided to release some things that I created in the past.
Thanks :D

MyGUI is used as GUI system. [...] I also added some functions to the wrapper of the core gui manager class to make life a little bit easier.
I never heard that the MyGUI developers also added a .NET wrapper to their project. It's useful to know.
It would be nice, when you offer your improvements to the MyGUI maintainers.
When you just tell them about and give a link to your repository, then it wouldn't take much time for you and maybe they will add your improvements.

Then there is SlimDX.
For a non grapic project I also used SlimDX for input (just to check if some bottons are checked).
Maybe I'll look to your repository for a better and more powerful way to use it.
Maybe I also create a new wiki page for SlimDX. MOIS has some disadvantages (I can't remember details of my tests).

Somebody telled me that there would be a disadvantage:
It would be not enough to copy (and link) the dll file to your project, because of additional depencies, which needs the full installation of the SlimDX package.
Is this right? Or ist there a way to handle it without the setup file (e.g. just copy some dll files to the project binary directories).

mstoyke

23-07-2010 13:18:44

Somebody telled me that there would be a disadvantage:
It would be not enough to copy (and link) the dll file to your project, because of additional depencies, which needs the full installation of the SlimDX package.
Is this right? Or ist there a way to handle it without the setup file (e.g. just copy some dll files to the project binary directories).


It works quite well for me this way, I just copy the SlimDX.dll into my bin folder. The only dependency is the correct DirectX runtime. My binaries are compiled with Feb2010 DirectX SDK, so only this or newer versions of the DX runtime will work.

Beauty

23-07-2010 13:38:04

Do you develop a game in a game company?
If so - what's the name of the company and some published games?
How many people work on your game? What type of game is it?
Which programs you use for level and model creation?
I'm interested in details :D

mstoyke

23-07-2010 15:03:57

There is some info available about me here:
http://www.mobygames.com/developer/shee ... Id,125826/
I'm currently working here:
http://e-eis.com/
as lead developer of the tinCat network middleware for multiplayer games and MMO's

If you can make it to the GDC Europe 2010 in Cologne, send me a PM maybe we can meet there ;)

kdr35

27-07-2010 16:11:39

I am new in Mogre , i want to use MyGui and i saw your "CompiledBinaries" and downloaded.
but I havent found any sample MyGui code in c# :?
and I converted something in c++ to c# but I think, I didnt convert correctly so I need MyGui code sample in c#.

And I have one dll problem , I didnt use your mogre.dll if I use your mogre.dll , my porject gives error so I didnt changed my mogre.dll (1.7.1 version .Net 4.0)

When I use your Mogre.dll , I took a error "A procedure imported by 'Mogre.dll' could not be loaded."

When I use my Mogre.dll , I took a error "A procedure imported by 'MyGUI.dll' could not be loaded."

How to use MyGui in .Net Framework 4.0 and 1.7.1 Mogre? I am new in mogre so can you explain shortly , please?

thanks...

mstoyke

27-07-2010 19:20:25

The libraries and the sourcecode in this repository is slightly changed for all of these libraries to work together. So I'm afraid you can't just replace some of the binaries. However you might be able to use these libraries if you compile them yourself and make then reference to the headers and import libraries for the version of Mogre/Ogre that you use.

Could you tell me which import won't work when you replace the Mogre.dll? I would like to see where this version differs from the official binary. And don't forget, if you replace the Mogre.dll you will also have to replace all Ogre DLLs.

AliAkdurak

30-07-2010 16:45:43

Hello Mystoke

I am a teammate from kdr35's team, I was working on this thing and managed to pass the point where the dll loading fails. But unfortunatly I have some other problem:

On MyGUI.GUI.Initialise() specifically it's parameters as it needs a System.Intptr to scenemgr which I have only the managed wrapper ones reference which I cannot pass to it.

I tried something like this but it has thrown many accsess violations.

DEBUG : target yaratıldı Name = Hedef5 Position = Vector3(458, 0, -950)
First-chance exception at 0x75089617 in AES3DCore.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0023e718..
A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Mogre.dll
First-chance exception at 0x75089617 in AES3DCore.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0023e718..
External component has thrown an exception.A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Mogre.dll
External component has thrown an exception.Step into: Stepping over property 'Mogre::Implementation::Wrapper::get_NativePtr'. To step into properties, go to Tools->Options->Debugging and uncheck 'Step over properties and operators (Managed only)'.
The thread 'Win32 Thread' (0x12d8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1bdc) has exited with code 0 (0x0).
Step into: Stepping over non-user code 'System.Collections.Generic.List<GraphicControlComponent.ClassGraphicPanel>.this[int].get'
The thread 'Win32 Thread' (0x1218) has exited with code 0 (0x0).
First-chance exception at 0x6e002000 in AES3DCore.exe: 0xC0000005: Access violation.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
A first chance exception of type 'System.AccessViolationException' occurred in MyGUI.dll
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
First-chance exception at 0x5c6c59f0 in AES3DCore.exe: 0xC0000005: Access violation reading location 0x6e002000.
An unhandled exception of type 'System.AccessViolationException' occurred in MyGUI.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

The program '[0x1324] AES3DCore.exe: Native' has exited with code 0 (0x0).
The program '[0x1324] AES3DCore.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).


the code I tried was this

System.IntPtr x;

unsafe
{
x = (System.IntPtr)SceneMgr.NativePtr;
}

MyGUI.Managed.Gui Temp;
MyGUI.Managed.Gui.Initialise(((ClassMogrePanel)_GraphicPanelList[0]).Handle,x, "", "", "");


I also checked around to find CLRObject* to IntPtr converting without success.

Any suggestion how I might overcome this. in your xample code this stuff is loaded from one of your inner class so I couldn't get some tip from there too.

mstoyke

30-07-2010 17:32:16

Please try this:
x = new IntPtr( SceneMgr.NativePtr );
and tell me if it works. This line of code can also be found in the class OgreManager in my XSample code folder in the repository.
And make sure the first IntPtr is actually a pointer to the Mogre RenderWindow NativePtr, just using the window handle of a .NET window or frame will not work.

Let me show you some lines of my init function (_windowHnd should be ((ClassMogrePanel)_GraphicPanelList[0]).Handle in your case, I think):


// parameters
NameValuePairList parm = new NameValuePairList();

mExternalWindowHandle = _windowHnd;
if( mExternalWindowHandle != IntPtr.Zero )
{
parm[ "externalWindowHandle" ] = mExternalWindowHandle.ToString();
}

// ...

// create window
if( mExternalWindowHandle == IntPtr.Zero )
mWindow = mRoot.CreateRenderWindow( "Midn8 Game Engine", 1600, 900, false, parm );
else
mWindow = mRoot.CreateRenderWindow( "Midn8 Game Engine (Ext)", 0, 0, false, parm );

// ...

// get reference to unmanager renderwindow
unsafe
{
mWindowPtr = new IntPtr( mWindow.NativePtr );
}

// create scene manager
mSceneMgr = mRoot.CreateSceneManager( SceneType.ST_GENERIC, "DefaultSceneManager" );

// get reference to unmanaged scene manager
unsafe
{
mSceneMgrPtr = new IntPtr( mSceneMgr.NativePtr );
}


now use mWindowPtr as first parameter and mSceneMgrPtr as second parameter in Gui.Initialise(...).

Please let me know if this works for you.

AliAkdurak

02-08-2010 10:48:29

First-chance exception at 0x75699617 in AES3DCore.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0021e21c..
A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Mogre.dll
First-chance exception at 0x75699617 in AES3DCore.exe: Microsoft C++ exception: Ogre::ItemIdentityException at memory location 0x0021e21c..
External component has thrown an exception.A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in Mogre.dll
First-chance exception at 0x0e1c1c68 (MyGUI.dll) in AES3DCore.exe: 0xC0000005: Access violation reading location 0xfeeeff16.
A first chance exception of type 'System.AccessViolationException' occurred in MyGUI.dll
External component has thrown an exception.* Initialise: OgreRenderManager
An unhandled exception of type 'System.AccessViolationException' occurred in MyGUI.dll


x = new IntPtr( SceneMgr.NativePtr ); didn't create any sufficient difference, it still throws two Ogre:ItemIdentifyException which I could not get their detail even If I put a SEH exception try catch around Initialize. I tought it could be because I didn't show a log a resource group or config(By the way I assumed it was Resources.Cfg but can you tell me if it is something different.). I looked at ItemIdentifyException in ogre manual it seems that exception is pretty common like input output exception.

I am not sure but maybe Ocham's razor is at work and I just fail to give simple file paths I will work on this. Today

mstoyke

02-08-2010 11:48:53

MyGUI needs a pointer to the Ogre RenderWindow, this is not the same as the handle of a window on your desktop.

I think that you pass the wrong parameter in initialization, replace ((ClassMogrePanel)_GraphicPanelList[0]).Handle with the IntPtr to the Ogre Renderwindow Class. How you can get this IntPtr is detailed in my last post.

All the code in the Xample folder in the repository is copied from a working project, so you might not be able to use the code directly, but you can find all the information you need in there.

If the problem persists, you could send me the files from your sourcecode that deal with Mogre and MyGUI, so I could take a closer look.

AliAkdurak

02-08-2010 12:20:52

I am sorry you are right that is a handle for a win32 window not a render window I will correct it right now try and report.

Ok I can now go beyond this point.

Thank you everything is working fine and sorry for the attention mistake.

By the way MyGUI can work on multiple render windows right ?

Edit: It seems that previous ogre log and those lines with error logs were not related.

mstoyke

02-08-2010 12:34:17

Thank you everything is working fine and sorry for the attention mistake.

You're welcome and don't worry about these kind of mistakes, these bugs just want to make sure that coding never gets too boring :)

Beauty

05-08-2010 15:31:44

Maybe we could add a check to the init method. (Or ask the MyGUI maintainers to do this.)
Then at the call of the init method it will be checked if the reference is a win32 window or a render window.
If it's the "wrong" reference, then throw an exception with useful message text.

mstoyke

05-08-2010 16:06:34

(Or ask the MyGUI maintainers to do this.)

He won't help you, because this init function is one of the things I added to the MyGUI gui manager class.

Beauty

05-08-2010 16:23:14

The you could offer your improvements to the MyGUI team. Maybe they like it.

Also the "understanding problem" could be solved when you add an XML comment with a descriptin hint "... Use handle to Mogre RenderWindow, NOT to a .NET window/frame"

Maybe additionally the method or parameter name could get a prefix or postfix as a hint.

Pyritie

17-08-2010 12:20:32

Which MyGUI binaries do I use? There seems to be a whole bunch scattered all over, and none of them work when I try to compile some of the test projects.

Pyritie

17-08-2010 21:00:18

Also does the PhysX thingy you've done support all PhysX stuff such as flexible bodies? I kinda want flexible bodies :U

mstoyke

17-08-2010 21:14:37

Which MyGUI binaries do I use? There seems to be a whole bunch scattered all over, and none of them work when I try to compile some of the test projects.

In the repository are precompiled binaries for everything, just look in the bin folder. Or you can download the binary package that I put in the projects download section at bitbucket.

Also does the PhysX thingy you've done support all PhysX stuff such as flexible bodies? I kinda want flexible bodies :U

I've not created the wrapper. You should take a look at the sourceforge page of the project. As far as I remember the wrapper was quite complete, that's one of the reasons I started using it.

Pyritie

17-08-2010 21:31:29

Which MyGUI binaries do I use? There seems to be a whole bunch scattered all over, and none of them work when I try to compile some of the test projects.

In the repository are precompiled binaries for everything, just look in the bin folder. Or you can download the binary package that I put in the projects download section at bitbucket.
Ooh, didn't see that page. :0 I was using the ones in the svn repo.

Also does the PhysX thingy you've done support all PhysX stuff such as flexible bodies? I kinda want flexible bodies :U

I've not created the wrapper. You should take a look at the sourceforge page of the project. As far as I remember the wrapper was quite complete, that's one of the reasons I started using it.
Looks like they support it, hooray!

Is it particularly hard to implement? Compared to, say, MogreNewt?

EDIT: Also your LayoutEditor isn't working :U I had to copy over a plugins.cfg and then I got this error:
---------------------------
An exception has occured
---------------------------
MyGUI EXCEPTION : root widget name '_Main' in layout 'EditorToolTip.layout' not found.
in MyGUI at E:\Midn8\midn8dependencies\mygui\Common\BaseLayout/BaseLayout.h (line 98)
---------------------------
OK
---------------------------

mstoyke

17-08-2010 21:57:15

EDIT: Also your LayoutEditor isn't working :U I had to copy over a plugins.cfg and then I got this error:

Thanks for the feedback. I forgot to add two files. They are now in the EngineDeps repository and I also attached them here for people who only downloaded the binary package.

Pyritie

17-08-2010 22:26:06

What about the other question? Is the physx wrapper hard to implement?

Also one more question - I see Program.cs and Export.cs in your TestApp.Managed project - how does that work? If I try to copy (most of) those to my own project, it doesn't know what "MyGUI.RenderWindow.Export_d.dll" is. So I'm kinda confused here. S:

mstoyke

17-08-2010 22:55:11

You should find information about all these questions in the XSample folder in the repository.

I'm sorry, but I can't help you too much with the details about the MyGUI wrapper. I'm mostly using it and all I changed was to add some functions that I needed. But you should not need to copy any code from mygui into your application, just reference the compiled DLL.

Pyritie

18-08-2010 07:00:37

Ooh riiiight, that folder. Man, I'm so out of it lately >__>

Pyritie

18-08-2010 11:54:19

In Gui.Initialise(), what is _group?

Also when I try to run it I get "A procedure imported by 'MyGUI.dll' could not be loaded."

erm... I don't think I'm doing anything wrong :0

private Gui gui;

public GUIMain(Main main, SceneManager sceneMgr) {
IntPtr sceneManagerPointer;
unsafe {
sceneManagerPointer = new IntPtr(sceneMgr.NativePtr);
}

Gui.Initialise(main.Handle, sceneManagerPointer, Settings.Default.MyGUI_config_file_location, "", Settings.Default.MyGUI_log_file_location);

gui = Gui.Instance;
}

Pyritie

23-08-2010 19:15:03

bump

mstoyke

27-08-2010 15:09:01

Did you make sure that you use all the DLLs from the repository? This exception usually occurs when you have outdated DLLs in your bin folder (where the exe is started). As mentioned earlier in one of the post regarding this repository, the sourcecode and binaries within the enginedeps repository work well together, but they are not necessarily compatible with DLLs from other repositories or releases.

We also need more details about the exception if it still is not working with all the DLLs from the enginedeps repository.

Pyritie

27-08-2010 15:12:49

I'm using the MyGUI.dll and MyGUIEngine.dll that were in that CompiledBinaries folder.

EDIT: Does the physx wrapper use events for a lot of things? I like events. :D

Pyritie

16-09-2010 12:36:38

Alright, I've been making more progress on physx. The whole contact reporting thing confuses me though - how the hell do I use it?

Pyritie

23-09-2010 11:09:17

The whole contact reporting thing confuses me though - how the hell do I use it?


bump

Pyritie

12-10-2010 14:50:49

The whole contact reporting thing confuses me though - how the hell do I use it?


bump


I know you're there

Also how do I use a TriangleMesh(Shape)(Desc)?

issingle

23-10-2010 02:36:21

The whole contact reporting thing confuses me though - how the hell do I use it?


bump


. in my case(a simulator),the eyecm-physX wrapper works great fine

Pyritie

23-10-2010 13:49:25

The whole contact reporting thing confuses me though - how the hell do I use it?


bump


. in my case(a simulator),the eyecm-physX wrapper works great fine

That doesn't really have anything to do with my question

issingle

25-10-2010 02:27:46



. in my case(a simulator),the eyecm-physX wrapper works great fine

That doesn't really have anything to do with my question


faint,u should impl the IUserContactReport interface. and Scene.UserContactReport=your instance of IUserContactReport. then work.
i think u should read the PhysX SDK Doc more.

Pyritie

18-11-2010 00:32:43

okay I've sorted out most of my problems with physx now

now I just have to figure out how to use the mygui thing here

anyone had any success with that?

still having the same problem as here: viewtopic.php?f=8&t=13111&start=15#p74261

Pyritie

29-11-2010 14:09:54

please dude I really need this

AliAkdurak

02-12-2010 08:26:01

We did have the same problem with myGUI and solved the group problem by doing this to our resources.cfg file. Altough it has been sometime since we solved it because MyGUI did not support multiple render windows different GUI concept we developed our own system

Our Resource.CFG looks like this.

[General]
FileSystem=C:\MogreSDK\Media
FileSystem=C:\MogreSDK\Media\fonts
FileSystem=C:\MogreSDK\Media\materials\programs
FileSystem=C:\MogreSDK\Media\materials\scripts
FileSystem=C:\MogreSDK\Media\materials\textures
FileSystem=C:\MogreSDK\Media\models
FileSystem=C:\MogreSDK\Media\overlays
FileSystem=C:\MogreSDK\Media\particle
FileSystem=C:\MogreSDK\Media\gui
FileSystem=C:\MogreSDK\Media\DeferredShadingMedia
FileSystem=.\Media\Backgrounds\
FileSystem=.\Media\Targets\3D\Meshes
FileSystem=.\Media\Targets\3D\Textures
FileSystem=.\Media\Targets\3D\Materials
Zip=C:\MogreSDK\Media\packs\cubemap.zip
Zip=C:\MogreSDK\Media\packs\cubemapsJS.zip
Zip=C:\MogreSDK\Media\packs\dragon.zip
Zip=C:\MogreSDK\Media\packs\fresneldemo.zip
Zip=C:\MogreSDK\Media\packs\ogretestmap.zip
Zip=C:\MogreSDK\Media\packs\skybox.zip

[MyGUI]
FileSystem=Media\MyGUI_Media
FileSystem=Media\MyGUI_Media\Layouts


And this is the piece of code we used to start it.


MyGUI.Managed.Gui.Initialise(RenderWinNativePtr, SceneMgrNativePtr, "core.xml", "MyGUI", "MyGUI.log");


Some Basic Example codes and ofcourse you need to make layout files in the above mention MyGUI place for this to work.

private void DrawTimer()
{
a = missionRuntime.ActiveMission.ShootingTime;
MyGUI.Managed.Gui.Instance.LoadLayout("Timer.layout");
MyGUI.Managed.Widget panelTimer = MyGUI.Managed.Gui.Instance.FindWidget("panelTimer");
MyGUI.Managed.Widget labelTimer = MyGUI.Managed.Gui.Instance.FindWidget("labelTimer");
panelTimer.SetPosition(1620, 10);
panelTimer.SetSize(labelTimer.Size.width, labelTimer.Size.height + 10);
labelTimer.SetColour(MyGUI.Managed.Colour.Red);
labelTimer.SetPosition(10, 10);
temp = labelTimer;
missionRuntime.TimeDetect += new ClassMissionRuntime.MissionRuntimeFlowDetectHandler(missionRuntime_TimeDetect);
}

private void DrawScoreboard()
{
MyGUI.Managed.Gui.Instance.LoadLayout("Scoreboard.layout");
MyGUI.Managed.Window windowScoreboard = MyGUI.Managed.Gui.Instance.FindWidget<MyGUI.Managed.Window>("windowScoreboard", true);
MyGUI.Managed.StaticText labelShot = (MyGUI.Managed.StaticText)windowScoreboard.FindWidget("labelShot");
MyGUI.Managed.StaticText labelHit = (MyGUI.Managed.StaticText)windowScoreboard.FindWidget("labelHit");
MyGUI.Managed.StaticText labelSlash = (MyGUI.Managed.StaticText)windowScoreboard.FindWidget("labelSlash");
labelSlash.Caption = "/";
labelHit.Caption = "0";
labelShot.Caption = "1";
}


I hope it helps you :)

Pyritie

02-12-2010 10:42:21

I don't have a core.xml, do I need one of those?

It crashes right on the .Initialise line.

AliAkdurak

03-12-2010 11:52:06

In My knowledge of MyGUI I think you need one of those and it comes with the package If I dont remember wrong. And you will also need the accompanying files too! All together it looks like this but you should better ask this at MyGUI forums since I really don't know the details.

05.01.2010 02:22 67.589 core.png
05.01.2010 02:22 342 core.xml
05.01.2010 02:22 58.683 core_black_blue.png
05.01.2010 02:22 57.815 core_black_orange.png
05.01.2010 02:22 8.993 core_font.xml
05.01.2010 02:22 300 core_language.xml
05.01.2010 02:22 491 core_language_english_tag.xml
05.01.2010 02:22 563 core_language_russian_tag.xml
05.01.2010 02:22 1.525 core_layer.xml
05.01.2010 02:22 5.838 core_micro_font.PNG
05.01.2010 02:22 15.072 core_pointer.png
05.01.2010 02:22 1.818 core_pointer.xml
05.01.2010 02:22 1.084 core_pointers_W32.xml
05.01.2010 02:22 3.423 core_resource.xml
05.01.2010 02:22 278 core_settings.xml
05.01.2010 02:22 94.102 core_skin.xml
05.01.2010 02:22 181 core_theme.xml
05.01.2010 02:22 242 core_theme_black_blue_tag.xml
05.01.2010 02:22 244 core_theme_black_orange_tag.xml
05.01.2010 02:22 231 core_theme_tag.xml
05.01.2010 02:22 323.456 DejaVuSans-ExtraLight.ttf
05.01.2010 02:22 611.552 DejaVuSans.ttf
03.12.2010 13:34 <DIR> Layouts


These files define how your forms and elements will be drawn. So They have to be somewhere I think.

Pyritie

08-12-2010 17:31:59

Alright, so now I got all of those (turns out I had them anyway, I was just looking in the wrong place). Still the same problem.

Tried redownloading the binaries. No change. Though I did notice that using the debug MyGUI.dll gives me a different error message than the one I'm currently getting (apparently I was using the release one before):
Could not load file or assembly 'MyGUI.dll' or one of its dependencies. The specified module could not be found.

...maybe I should just use http://www.ogre3d.org/tikiwiki/Miyagi instead

EDIT: yeah I already switched to miyagi

kdr35

30-12-2010 13:59:48

Hi, i want to use PhysX in my project. We use Visual Studio 2010 and mogre 1.7.1 so i downloaded new dlls here : http://sourceforge.net/projects/eyecm-physx/files/eyecm-physx-mogre/ then
i developed the project as http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1812&page=PhysX%20Candy%20Wrapper#Implementation

Firstly i created PhysicsManager as below and I use tutorial project and try to use physx in that but i encountered an error which says "Value cannot be null.
Parameter name: NxPhysXSDK object was not created successfully." I am posting tutorial code belows.

Error Line: this.MyPhysics = Mogre.PhysX.Physics.Create();

I searched this error then i found a topic about this. it says "you should initalize physx SDK" and there is a C++ code in the topic.

NxPhysicsSDK * pPhysics ; //declare globally
pPhysics = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
if(!pPhysics)
return;"


but i use mogre wrapper for physx so i can not find NxPhysicsSDK in mogre.physx namespace


How to solve that problem or use physx in mogre ?

thanks...



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mogre.PhysX;
using Mogre.TutorialFramework;
using Mogre;

namespace PhysicsManager
{
public class PhysicsManager
{

public PhysicsManager()
{

}


private Physics _myPhysics;

public Physics MyPhysics
{
get { return _myPhysics; }
set { _myPhysics = value; }
}
private Scene _myScene;

public Scene MyScene
{
get { return _myScene; }
set { _myScene = value; }
}

public bool Initiliase()
{
// create the root object

this.MyPhysics = Mogre.PhysX.Physics.Create();
this.MyPhysics.Parameters.SkinWidth = 0.0025f;

// setup default scene params
SceneDesc sceneDesc = new SceneDesc();
sceneDesc.SetToDefault();
sceneDesc.Gravity = new Vector3(0, -9.8f, 0);
sceneDesc.UpAxis = 1; // NX_Y in c++ (I couldn't find the equivilent enum for C#)

// your class should implement IUserContactReport to use this
//sceneDesc.UserContactReport = this;

this.MyScene = MyPhysics.CreateScene(sceneDesc);

// default material
MyScene.Materials[0].Restitution = 0.5f;
MyScene.Materials[0].StaticFriction = 0.5f;
MyScene.Materials[0].DynamicFriction = 0.5f;

// begin simulation
this.MyScene.Simulate(0);
return true;
}

public void Update(float deltaTime)
{
this.MyScene.FlushStream();
this.MyScene.FetchResults(SimulationStatuses.AllFinished, true);
this.MyScene.Simulate(deltaTime);
}

public void Dispose()
{
this.MyPhysics.Dispose();
}

}
}

Pyritie

30-12-2010 14:14:04

That's weird, my line looks pretty similar to that and I don't have any problems. Maybe you're doing something wrong with the TutorialFramework?

public PhysXMain() {
Launch.Log("[Loading] Creating PhysXMain...");

physics = Physics.Create();
physics.Parameters.SkinWidth = 0.01f; // how far we let objects penetrate each other
physics.Parameters.VisualizationScale = 1;
physics.Parameters.VisualizeCollisionShapes = 1; // true
physics.Parameters.VisualizeActorAxes = 1; // true
physics.Parameters.DefaultSleepLinVelSquared = 0.3f;
physics.Parameters.DefaultSleepAngVelSquared = 0.3f;

physics.RemoteDebugger.Connect("localhost"); // connect to the debugger

...

hedphelym

30-12-2010 15:03:39

hi,
here's a quick demo application I'm working on.

It spawns cubes and spheres by pressing 1 - 2 on keyboard,
number 3 is for cooked meshes, and currently it crashes.

this is how I declare it (if I understand your question correctly).

using Mogre.PhysX;

protected Physics physics;
var physics = Physics.Create();


my source is here for you to look at:
[attachment=0]Physx_demo.zip[/attachment]

kdr35

31-12-2010 08:58:26

Thanks for your demo project. When i run the demo project but i am taking same error.(I didnt change anything on demo project)

I think, physx sdk is not initalized so mogre doesnt use sdk. But i dont know sdk initalizing or if mogre want to any references from sdk to access it. I only downloaded from nvidia web site then i setup.
I use below references.


using Mogre;
using System;
using System.Collections.Generic;
using System.Text;
using Mogre.PhysX;
using MOIS;
using System.IO;


and
I use .Net Framework 4.0 . Is the problem relevant to that?

kdr35

03-01-2011 11:11:43

I solved the problem. I only setup physx SDK but it doesnt be enough also it needs system software such as PhysX_9.10.0513_SystemSoftware. If you can add that detail in SDK intallation part on PhysX Candy Wrapper Page, I think, it may be better for mogre+ physx beginners.

thanks...

hedphelym

03-01-2011 11:43:24

ah, good point. I guess most of us have that already installed with our drives \ games, but to add it as a note would be nice.
Helps other people avoid this issue again :)

Beauty

03-01-2011 13:24:42

it needs system software such as PhysX_9.10.0513_SystemSoftware.
I added this requirement to the PhysX candy wrapper wiki page. It would be nice when you tell me more detailed which installation packages are needed and where it can be downloaded. Then I'll put these details to the wiki page, too.

hedphelym

03-01-2011 13:28:53

http://www.nvidia.com/object/physx_system_software.html

this links to latest NVIDIA PhysX System Software (runtime software).

Beauty

03-01-2011 13:50:27

Ok, update is done. Thanks for your support :D

kdr35

04-01-2011 10:32:57

I guess most of us have that already installed with our drives \ games

Yes, we dont sometimes realize default installed dependencies in game packages etc. :)

kdr35

11-01-2011 10:30:25

Hi,
I am new in physx + mogre. I want to create a flag application in mogre. I found one example in ogre (http://www.ogre3d.org/addonforums/viewtopic.php?t=5888&f=6#p78093) , i try to convert ogre code to mogre code. I largely completed conversion but i have some problems about conversion. I didnt found properties of some class and didnt create a new cloth. While creating cloth , I have null exception.

http://www.ogre3d.org/addonforums/viewtopic.php?t=5888&f=6#p78093 orginal code in ogre forum.

I have converted to mogre code:

CapsuleShapeDesc csd = new CapsuleShapeDesc(0.2f,12f);
csd.LocalPosition = new Vector3(0, -0.2f, 0);
csd.Density = 0;

PhysX.ActorDesc flagPoleDsc = new ActorDesc(csd);
flagPoleDsc.Density = 0;
PhysX.Actor flagPole = phscene.CreateActor(flagPoleDsc);

PhysX.ClothDesc cp = new ClothDesc();
cp.SetToDefault();
cp.Thickness = 0.2f;
cp.BendingStiffness = 0.5f;
cp.Friction = 0.25f;
cp.Flags |= PhysX.ClothFlags.Bending;
cp.Flags |= PhysX.ClothFlags.CollisionTwoway;
cp.Flags |= PhysX.ClothFlags.Visualization;
cp.Flags |= PhysX.ClothFlags.Hardware;
cp.WindAcceleration = new Vector3(-20, 12, -1);
cp.Density = 0.15f;

// cp.meshMaterial = "nx.flag"; //i dont find equivalent value in mogre.
// cp.height = 8; //i dont find equivalent value in mogre.
// cp.width = 0.15f; //i dont find equivalent value in mogre.

PhysX.Cloth flag = phscene.CreateCloth(cp); // I DONT CREATE A CLOTH. WHILE CRETING CLOTH , HANDLE NULL EXEPTION.

flag.AttachToShape(flagPole.Shapes[0], PhysX.ClothAttachmentFlags.Twoway);


In addition to, I dont see on the screen any object such a flagPole and Does mogre physx wrapper support Cloth Part of Nvidia Physx?

McDonte

17-02-2011 14:34:57

I dont see on the screen any object
In the code you posted it is not mentioned, but additionally to the PhysX object you have to create an Ogre object to be rendered, because PhysX is only providing the physics part and Ogre does take care of the graphics part. You might did that in another part of your application but it's necessary to see anything on the screen!

kdr35

17-02-2011 15:16:13

It is not a problem which see anything on the screen. In fact, question is whether physx wrapper cloth support ? I opened another main thread about that problem but anyone didnt write any answer :?
Forum Thread:http://www.ogre3d.org/addonforums/viewtopic.php?f=8&t=13916

Thanks for sugesstion.

Pyritie

17-02-2011 15:24:11

I dont see on the screen any object
In the code you posted it is not mentioned, but additionally to the PhysX object you have to create an Ogre object to be rendered, because PhysX is only providing the physics part and Ogre does take care of the graphics part. You might did that in another part of your application but it's necessary to see anything on the screen!

Plus the physx wrapper doesn't automatically update ogre stuff, so you'll have to do that yourself

I think

kdr35

17-02-2011 17:04:18

I know ogre objects updating with physx objects, I want to do flag example so i need cloth support. While I am creating cloth , physx returns null . I cant solve it. So I wonder whether physx wrapper support clothing. I want to know it. I will do it with plane if i work clothing.