IrrPhysx 0.2 - Nvidia Physx 2.8.1 wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Did you try both links available here:
http://chris.j.mash.googlepages.com/irrphysxdownload

If not then I can email it to you :)

Incidentally I'm still working on IrrPhysx 0.2 for Irrlicht 1.5... It's pretty much fine now I think, just need to run through it all to make sure everything's working as expected and then I'll be able to upload it. Unfortunately I'm having a pretty stressful time with other things so I'm not finding much spare time to get this done!
Image Image Image
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post by MarcinS »

I tried to compile "BoxesExample" in VS2008 and i get

Code: Select all

1>------ Build started: Project: BoxesExample, Configuration: Release Win32 ------
1>Compiling...
1>CGUIParamChanger.cpp
1>..\CommonCode\CGUIParamChanger.cpp(262) : error C2440: 'initializing' : cannot convert from 'irr::f32' to 'irr::core::string<T>'
1>        with
1>        [
1>            T=wchar_t
1>        ]
1>        Constructor for class 'irr::core::string<T>' is declared 'explicit'
1>        with
1>        [
1>            T=wchar_t
1>        ]
1>CGridSceneNode.cpp
1>..\CommonCode\CGridSceneNode.cpp(185) : error C2660: 'irr::video::IVideoDriver::drawVertexPrimitiveList' : function does not take 6 arguments

Is this becouse of some changes in IrrLicht in version 1.5 or what is it ? As i know explicit protect from hiden change of type but have only i this error ?

if this problem was already solved, i apologize for not finidng it on this forum

And another thing is

I get this error while trying to bulid IrrPhysx in VStudio 2008. I added the paths in VS options and the files are on this location : c:\irrphysx\...

Code: Select all

1>------ Build started: Project: IrrPhysx, Configuration: Debug Win32 ------
1>Compiling...
1>CCloth.cpp
1>c:\irrphysx\src\cphysxmesh.h(5) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CClothPhysxMesh.cpp
1>c:\irrphysx\src\cphysxmesh.h(5) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CClothPhysxObject.cpp
1>c:\irrphysx\src\cclothphysxobject.h(4) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CConvexPhysxMesh.cpp
1>c:\irrphysx\src\cphysxmesh.h(5) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CDebugRenderer.cpp
1>c:\irrphysx\src\cdebugrenderer.cpp(3) : fatal error C1083: Cannot open include file: 'NxDebugRenderable.h': No such file or directory
1>Cooking.cpp
1>c:\irrphysx\src\cooking.h(4) : fatal error C1083: Cannot open include file: 'NxCooking.h': No such file or directory
1>CPhysxManager.cpp
1>c:\irrphysx\src\ccontactreport.h(4) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CPhysxMesh.cpp
1>c:\irrphysx\src\cphysxmesh.h(5) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CPhysxObject.cpp
1>c:\irrphysx\src\cphysxobject.h(4) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>CTrianglePhysxMesh.cpp
1>c:\irrphysx\src\cphysxmesh.h(5) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>IrrPhysx.cpp
1>c:\irrphysx\src\ccontactreport.h(4) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>MathConversion.cpp
1>c:\irrphysx\src\mathconversion.h(4) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory
1>Streams.cpp
1>c:\irrphysx\src\streams.cpp(2) : fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directory

JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yep the first one is because the current IrrPhysx 0.2 is compiled with Irr1.4.2 and you're using Irr1.5.

Fortunately for you I've just uploaded a 1.5 compatible version so get that from the first page of this post and your problem will be solved :)

The second problem, when compiling IrrPhysx is because you don't have the Physx SDK installed, or at least not in the same place as the IrrPhysx solution has been told it is. You do need the SDK, even if you're not compiling IrrPhysx so you'll need to download it if you've not got it :)
Image Image Image
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post by MarcinS »

"Why to use debuger when can't read" ;p

Now (as i read agian what the errors were) i recognized that the problem was not with your class files but with location of PhysX ;]


Now with 1.5 ver. of you wrapper and corrected paths everything sims to work

Maby that is again "my problem" with paths but to get working the examples i had to copy "media" folder do folder "exmaples" (bulding examples was ok but then crash while trying to find jpg etc. , but i am talking NOT about thoese from "bin")
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post by MarcinS »

Hmm there is something wrong with forum server.

I tried to create my own aplicatication with IrrPhysx

Code: Select all

input receiver; //my own IEventReceiver Class
	
IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(800, 600), 32, false, true, false, &receiver);
if (device == 0)return 1; 
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();	
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
core::array<SPhysxAndNodePair*> objects;

SSceneDesc sceneDesc;
IPhysxManager* physxManager = createPhysxManager(device,sceneDesc);

And while compiling i get such an error

Code: Select all


1>Main.obj : error LNK2019: unresolved external symbol "class IrrPhysx::IPhysxManager * __cdecl IrrPhysx::createPhysxManager(class irr::IrrlichtDevice *,struct IrrPhysx::SSceneDesc const &,bool)" (?createPhysxManager@IrrPhysx@@YAPAVIPhysxManager@1@PAVIrrlichtDevice@irr@@ABUSSceneDesc@1@_N@Z) referenced in function _main



But when i compile examples from IrrPhysx everetyhing goes allright. First i thought that maby again some paths are wrong. But my Visual Studio 2008 recognize the SSceneDesc and IPhysxManager (2008 Pro- Yes i've got oryginal one form Microsoft Academic Alliance..or whatever the name of it is).

I tried

Code: Select all

 #pragma comment(lib, "Irrlicht.lib") 
but end with some strange errors like :

Code: Select all


1>IrrPhysx.lib(IrrPhysx.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>libcmt.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR90D.dll)
1>libcmt.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR90D.dll)



SOLVED

I changed the C/C++ Generation Code method as it some one wrote some post before
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post by MarcinS »

Pie21 wrote:
That part works fine, it's the rotation that buggers up, and I think I figured out why last night. In the case of the rotation, it gets the current rotation and adds 0.1 * deltaT (which is what pManager->getDT() returns - I figured that belonged in the GameManager, and didn't want to make too many things public) for every frame for which the turn key is held. Again, very crude but it works... at least up to 90 degrees.
In my case after the rotation reach 90 degrees program ends with debuging info:

Code: Select all

Unhandled exception at 0x0656bb7f in TestProgram.exe: 0xC0000005: Access violation reading location 0x5c5c00a0.


and ofcourse TestProgram is a name of my program

Code: Select all

pEgo->pair->PhysxObject->getRotation(nodeRotation);

if(receiver.IsKeyDown(irr::KEY_KEY_A))
			{
			nodeRotation.Y -= pEgo->wSpeed() * frameDeltaTime;
			if(nodeRotation.Y <= -360) nodeRotation.Y = 0;
			pEgo->pair->PhysxObject->setRotation(nodeRotation);
			}
I think i just have to wait for wrapper of character control ;]
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

have you run the debugger on it to see which line of code is crashing? Whether it's in your app or within IrrPhysx or somewhere even deeper?

You can build a debug library of IrrPhysx which would help see inside the IrrPhysx code at runtime.
Image Image Image
hzsyber
Posts: 52
Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.

Post by hzsyber »

hi,jp

i have a question(problem?)

i try example of cloth,i set device is d3d9, load texture can't show flag.
look img 1.
log say:Could not get lower surface level for mip map generation
i change to default opengl, texture is good look img 2. why?

my display card is 8600m
img1:Image

img2:Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Not sure about that one really... I've had that log error before with 1x1 textures but not with the flag i don't think.

To be honest it's not an IrrPhysx problem per se, rather an Irrlicht problem so it wouldn't affect you using IrrPhysx and may work fine with your own assets.
Image Image Image
humorstar
Posts: 25
Joined: Sat Oct 04, 2008 3:50 am

Post by humorstar »

What is status of IrrPhyX now? PhyX seems to be a better choice than ODE. Maybe I will switch to PhyX. I saw there are IrrPhyX v0.2 and v0.3 by different authors. Which one should I use?

Thanks for the great work,
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

You can also try Bullet btw, it's a very good physic lib. Terribly abysmal documentation that's not worth half a cent, but really good lib that bends quickly to your will if you know how to read code or have the patience to wait on the forums ;)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

humorstar; v0.3 was done by Sio2 as a bit of an accident and mis-communication... Currently the source/lib for that is unavailable as Sio2 hasn't uploaded it... I've tried contacting him to get hold of it so I can release it properly with the official IrrPhysx but he's not been responding.

So basically v0.2 is what you use (v0.3 only has the addition of fluid simulation and that only works if you have a very recent GeForce card that will accelerate Physx).

So anyway, I tried doing some more IrrPhysx work on the weekend and low and behold Mr Gates is on my case to get my MSVC08 registered... Which I've already done! I did it ages ago when I still had the internet and now I can't do it because I don't have the internet so can't use MSVC anymore :evil:

Very annoying indeed...

Fortunately it shouldn't be too long before I have the internet again, though that could be 2 months actually... In the meantime I'm thinking of bringing my laptop into work and hooking it up to the net here to get MSVC registered on it and then I can use that at least...
Image Image Image
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

Ok I think I found a bug, but I don't know if it is Irrlicht or your code:

If you start the boxes-example:

1. create a big tower
2. create a explosion
3. repeat 1 + 2 several times (5-6 should be enough)
4. You will see the explosion does almost nothing if the fps are very low

-> Looks like some calculations are skipped!??

Same thing for all the other demos.

Sadly I also have seen skipping with the fps cam on low frames, and at the "New_Irrlicht_Particle_Affectors" examples (spline demo).

But I'm unsure if this is Irrlicht or bad code.


Edit:

Btw. I think I found another bug:

in CPhysxManager.cpp Line 1070

should be

if (Explosions[e]->CurrentRadius > Explosions[e]->MaxRadius) Explosions[e]->CurrentRadius = Explosions[e]->MaxRadius;

instead of

if (Explosions[e]->CurrentRadius < Explosions[e]->MaxRadius) Explosions[e]->CurrentRadius = Explosions[e]->MaxRadius;

Thats not the solution to my problem, so please help me!

Edit2:

Ok so I looked at the code of void CPhysxManager::updateExplosions(f32 elapsedTime)

And I think the system is wrong.
(If I am wrong, please don't mind but this is getting me crazy)

If I understand the code right, the lower the framerate, the lower the explosion-force, because the force is added not so often as if the framerate is higher.

Shouldn't it be so, that you recalculate the force with the elapsed time? Atm you just use it for the TimeToGo and the actual size of the explosion.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Good catch gecko, certainly sounds like it should be using the elapsed time so that must have just been an oversight on my part! I'll make a note and fix it for the next version, same goes for the other things you mentioned :)

Little update: Got the character controllers working pretty well and i've been making a Materials & Movement example too which will show how to apply different materials (with different params like how bouncy they are, how much friction they have) to objects and also how to make things like moving platforms (at Mel's request quite a while ago!)
Image Image Image
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

OMG I am right? Amazing :shock:
When do you plan to bring your next version?
Post Reply