IslandzVW / halcyon

InWorldz Halcyon 3d virtual reality world simulator
BSD 3-Clause "New" or "Revised" License
21 stars 26 forks source link

PhysX needs an update - currently doesn't work on Linux! #463

Closed kf6kjg closed 6 years ago

kf6kjg commented 6 years ago

The version we are currently using of PhysX is before nVidia released Linux support in PhysX. This leaves Linux running the rather pathetic implementation of "BasicPhysics" I created that just simply allows avatar movement and avatar-ground collisions.

The primary problem is that we've got our own fork of PhysX.Net, a .NET wrapper for PhysX, that should have any relevant changes found and ported as PRs back up to upstream.

So subtasks are as follows:

  1. Find changes to our own fork and get them PR'd upstream if not already there or solved alternately.
  2. Bring in the NuGet package of PhysX.Net and test it.
  3. Iterate any needed changes to the above or Halcyon to make everything happy.
ddaeschler commented 6 years ago

This was a major undertaking for multiple reasons last I investigated:

As already identified, the physx.net package had a bunch of issues that I had to fix where patches were not merged that I know of. Many of these issues were crashers, memory leaks, or O(n) / O(n^2) issues that had to be rectified before the package would perform at all well on long running and demanding simulation processes.

It was not possible to compile C++/CLI on linux. If this has changed that removes the biggest hurdle. Though it is possible to run pure C++ with only CLR calls on linux, this does not describe the bindings to physx.

I had started down an alternate path with swig wrappers to be bound to the current physic code for these reasons, but it was not completed work.

YMMV and things may have changed

kf6kjg commented 6 years ago

Thanks for the history David! BTW, any idea what revision of the upstream repo was forked off of? Since it went through SVN then uploaded back to GitHub from SVN, it's lost that info.

kf6kjg commented 6 years ago

Doing some research it turns out that C++/CLI is still a no-go on anything but Windows with notes that it's likely not going to happen. The entire library would have to be rewritten using P/Invoke which is basically a rewrite - not something a lib maintainer wants to do.

mdickson commented 6 years ago

David was the SWIG work every checked in anywhere? And yes C++/CLI isn't a viable option. You'd need P/Invoke wrappers as a replacement

emperorstarfinder commented 6 years ago

Hi there,

So I know that Halcyon uses the PhysX fork from StillDesigns so I am not sure if this will work or be of help but I figure at the very minimum it might at least provide some ideas going forward as you figure out the implementation of PhysX for Linux. If it does not help it is okay as I will have only wasted a couple of moments to provide the information. But even information passed on can be helpful even if in the end it does not work.

Before they officially switched over to Halcyon, the M-O-S-E-S project did, in fact, have a working PhysX wrapper for Linux in their fork of OpenSim. My team stumbled onto it as it was mentioned to us by one of our upstream providers. We found it on their projects page. However, since the time we found it they have added it to their GitHub organization as a repository. The link I am passing you is to their README.txt in that repository which contains instructions on how they built the wrapper, but if you click on the repository link you can also see their code. The link is: https://github.com/M-O-S-E-S/physx-wrapper/blob/master/README.txt

As I indicated I am not sure if they had this particular wrapper working on their Halcyon fork or not. At the very minimum, it was for an earlier version of OpenSim. So it might or might not work or even be viable here. I should also note that the versions of OpenSim that did have PhysX in the source code (i don't remember whether it was working, however, but I don't believe it was) likely was using the dlls direct from the Nvidia PhysX repositories which you can get access to but you have to register with Nvidia directly to get access to those repositories.

At any rate I hope this is of some help, even if at the very least it gives you some ideas to look at.

kf6kjg commented 6 years ago

This issue was moved to HalcyonGrid/halcyon#2