Google

Mogre + Physx

Discussion regarding the Managed .Net Wrapper for Ogre, MOGRE (http://sourceforge.net/projects/mogre)

Moderators: OGRE Team, MOGRE Moderators

Mogre + Physx

Postby TADS » Sun Aug 02, 2009 9:57 pm

hi all there is a aplha download for Mogre + physx at

https://sourceforge.net/projects/eyecm-physx/files/

i had asked if it could be done and they made the wrapper for it i havnt tested it yet as im not ready to input this yet but im sure afew of you are
TADS
 
Posts: 5
Joined: Fri Feb 22, 2008 1:02 am

Re: Mogre + Physx

Postby AndroidAdam » Wed Aug 05, 2009 6:17 pm

What version of Mogre is this for, 1.4.8, or 1.6.2?
AndroidAdam
 
Posts: 106
Joined: Thu Sep 11, 2008 7:19 pm

Re: Mogre + Physx

Postby AndroidAdam » Sun Aug 09, 2009 3:30 am

I can't find the world class in this dll.
In NxOgre the class is called world, in the actual physX sdk it's called NxPhysicsSDK.
The class includes the essential CreateScene function, any ideas on what it's called here?
AndroidAdam
 
Posts: 106
Joined: Thu Sep 11, 2008 7:19 pm

Re: Mogre + Physx

Postby TADS » Sun Aug 09, 2009 10:39 am

if i remember right they just take the NX bit off the front but i will start to look at this soon just been abit busy as of late.

this is a messeage i got of the person that made the wrapper

All the classes that are named NxSomething in C++ are called Something in PhysX Candy Wrapper. So, a NxScene is called simply Scene.

and this was the email i got of him

Hello!

I've created the binaries that should plug right into Mogre. I just hope
I just hope I haven't inadvertently transposed the data in the matrix class.

You can download it at:
https://sourceforge.net/projects/eyecm-physx/files/

I'll move it to alpha/beta/release as someone does some testing. I don't
have much time to do this myself.
TADS
 
Posts: 5
Joined: Fri Feb 22, 2008 1:02 am

Re: Mogre + Physx

Postby AndroidAdam » Sun Aug 09, 2009 9:19 pm

I was impressed with the use of .net conventions, especially the use of properties. If I can figure out what class is the equivalent of world I could do some testing.
AndroidAdam
 
Posts: 106
Joined: Thu Sep 11, 2008 7:19 pm

Re: Mogre + Physx

Postby smoove » Sun Aug 09, 2009 9:57 pm

Hello!

You'll need to do something along the lines :

Code: Select all
using Mogre.PhysX;

// pseudo c#

class Whateva
{
  static Physics p;
  static Scene mainscene;

  public static Physics InitPhysicsAndCreateScene()
  {
    var scd = new SceneDesc( SceneFlags.EnableActiveTransforms );
    //
    scd.BackgroundThreadCount = 2;
    //
    p = Phyics.Create();
    mainscene = p.CreateScene( scd );
    //
    return p;
  }

  public static StopPhysics()
  {
    p.Dispose(); // also disposes all the scenes/actors/bodies/joints etcetera.
  }

  public static void OnFirstFrame()
  {
    mainscene.Simulate( 0 );
  }
  public static void AfterFrameUpdate()
  {
    // make all changes to the state of PhysX objects before this line

    const float dt = 1.0f / 60;
    //
    // begin calculating next frame
    mainscene.Simulate( dt );
  }

  public static void BeforeFrameUpdate()
  {
    // get physics results from previous frame
    mainscene.FlushStream();
    mainscene.FetchResults( SimulationStatuses.AllFinished, true );
    mainscene.UpdateActiveTransforms();

    // now copy all matrices (that have changed) from physx to your engine's scene graph
    using ( var ats = mainscene.GetActiveTransforms() )
    {
      foreach ( var at in ats )
      {
          Node n = (Node)at.Actor.UserData; // I don't know what kind of scene elements Mogre uses, sorry
          if ( n == null ) continue;
          //
          n.WorldMatrix = at.Actor2World;
      }
    }
  }

}


Happy coding,
smoove
smoove
 
Posts: 1
Joined: Sun Aug 09, 2009 9:33 pm

Re: Mogre + Physx

Postby AndroidAdam » Mon Aug 10, 2009 5:10 am

Ok, so the Physics class is the equivalent of the World class, thanks.
AndroidAdam
 
Posts: 106
Joined: Thu Sep 11, 2008 7:19 pm

Re: Mogre + Physx

Postby issingle » Thu Sep 17, 2009 9:18 am

Great Job.
Thanks a lot.smoove
i'll embed this wrapper into my work
issingle
 
Posts: 15
Joined: Thu Sep 17, 2009 9:12 am

Re: Mogre + Physx

Postby noobs » Wed Nov 11, 2009 1:35 am

Sorry for bumping, just thought it would be better to post here then to start new thread.
Could some one give a working code whit just say one entity that lays on a flat ground?
I'm reading some tutorials on nxogre and didn't get far, would it be better to read the physX tutorials?

Thanks
noobs
 
Posts: 8
Joined: Fri Nov 06, 2009 1:16 pm

Re: Mogre + Physx

Postby hedphelym » Tue Dec 15, 2009 8:00 am

A sample for this would be great.. Been trying to figure out how to get PhysX into mogre, but no luck yet..
User avatar
hedphelym
 
Posts: 115
Joined: Sat Oct 25, 2008 6:21 pm
Location: Norway - Kristiansand

Re: Mogre + Physx

Postby Kohedlo » Sat Dec 19, 2009 1:46 pm

Hi all. I trying to create simple physics scene, but no anything.
How to view created pys object by visualisation7 -aka show bounding box of invseble phys obj.
Thanks.
Imperial Engine Test_SDK 1.050 coming soon!
See www.kohedlostudio.com
User avatar
Kohedlo
 
Posts: 48
Joined: Sat Nov 21, 2009 5:35 pm

Re: Mogre + Physx

Postby hedphelym » Sat Dec 19, 2009 3:40 pm

you have to create an object in mogre, then set it's position from the position of the physx object.
You can use the nvidia physx debugger to view the "physical" mesh and simulation.
User avatar
hedphelym
 
Posts: 115
Joined: Sat Oct 25, 2008 6:21 pm
Location: Norway - Kristiansand

Re: Mogre + Physx

Postby Kohedlo » Thu Dec 24, 2009 8:29 pm

Thanks. In wrapper(is really cool) i find method - GetDebugRenderable() in scene class.

Need write method -shower lines, triangles and so.

Code: Select all
void DebugRenderer_renderData(DebugRenderable data)
        {
           data.Points;
           data.Lines;
           data.Triangles;
        }


Is right way7
See actors in scene is great need(stone of stumbling) for my project.
Imperial Engine Test_SDK 1.050 coming soon!
See www.kohedlostudio.com
User avatar
Kohedlo
 
Posts: 48
Joined: Sat Nov 21, 2009 5:35 pm

Re: Mogre + Physx

Postby hedphelym » Thu Dec 24, 2009 9:08 pm

Thanks for all your effort! I'm really looking forward to see how things work out!

One thing that would be really powerful is the "serialization", where you just use a xml exported
from 3d app, and then it "just works".. we do this at a project at work (not mogre, but c++ version),
(But on my personal projects I use C#, and really want to get physx working.).
I'm not the coder on the c++ stuff at work, I just do C#, this is why I do not have any indepth info..

The plugin we\I use is the physx plugin for 3dsmax:
http://developer.nvidia.com/object/physx_dcc_plugins.html

If you'd like any samplescenes with physx XML data included, just let me know, I can make some :)
User avatar
hedphelym
 
Posts: 115
Joined: Sat Oct 25, 2008 6:21 pm
Location: Norway - Kristiansand

Re: Mogre + Physx

Postby hedphelym » Sat Jan 02, 2010 4:34 pm

Does anyone have some info to share on getting this to work? :)
User avatar
hedphelym
 
Posts: 115
Joined: Sat Oct 25, 2008 6:21 pm
Location: Norway - Kristiansand

Next

Return to MOGRE

Who is online

Users browsing this forum: Beauty, Yahoo [Bot] and 4 guests

cron