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 »

For those of you in China (or anyone else who's had trouble downloading IrrPhysx) I've uploaded the zips to rapidshare as well and provided the links here. Let me know if you have any trouble with rapidshare.
Image Image Image
IrrNoob
Posts: 110
Joined: Sun Nov 16, 2008 8:01 pm
Location: Fort Collins, Us

Post by IrrNoob »

JP wrote: IrrNoob, IrrPhysx is compiled with MSVC 08 already and the project files are provided so you shouldn't have any work to do there...
I'm trying to combine my project with your examples, so thats why I need your examples to compile from source.
Carama
Posts: 10
Joined: Sun Dec 14, 2008 12:44 pm

Post by Carama »

i tried to fix the bug with the terrain ... i made a irr scene with just a terrain and skybox and light and it worked perfect.

it is possible that physX have a limitation for objects at hardware render?



EDIT:

I added the terrain behinde the light at the scene.irr. Now it work with the whole scene. Have anybody a idea why?
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

very well... after installing everything, adding lots of include paths and library paths, manually editing the GameExample.vcproj compiling and lots of other stuff, it now compiles on my Microsoft Visual C++ 2005 Express Edition...
I've been trying to find an acceptable character controller with an acceptable physics engine for irrlicht in the last couple of days and at least irrphysx seems to be faster than irrnewt... I've got this somehow stuttering performance with irrnewt animating a capsule with FRIgetDirectionPositionY(core::vector3df(0,0,rigell_speed)) ... dont know why.. well at least its a capsule and not a sphere which leads me to my question... I've read the following:
// Create an FPS camera so we can see the scene and easily move around
// Link it up to a Physx sphere object for collision and gravitational purposes
// Once character controllers are supported by IrrPhysx this will be updated
when will that happen ? or is there an updated version somewhere around... right now when I touch the cursor up key... my character sphere flies high speed outside of the terrain... cant really move, its way to fast... any ideas ?

btw.

the svn version of irrlicht uses 7 arguments for drawVertexPrimitiveList, the last one is irr::video::E_INDEX_TYPE so I changed CDebugRenderer.cpp in line 78 from:

Code: Select all

if (indexIndex >= 65530) { // 66536 index limit so before we reach it fire off a render and reset to zero
				driver->drawVertexPrimitiveList(pVertList, vertIndex, pIndexList, indexIndex / 2, video::EVT_STANDARD, scene::EPT_LINES);
				indexIndex = 0;
				vertIndex = 0;
			}
to

Code: Select all

if (indexIndex >= 65530) { // 66536 index limit so before we reach it fire off a render and reset to zero
				driver->drawVertexPrimitiveList(pVertList, vertIndex, pIndexList, indexIndex / 2, video::EVT_STANDARD, scene::EPT_LINES, irr::video::E_INDEX_TYPE::EIT_16BIT);
				indexIndex = 0;
				vertIndex = 0;
			}
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

ok, it moves at a normal speed now. I didnt realize you're actually using the normal

Code: Select all

camera = smgr->addCameraSceneNodeFPS(NULL, 100, 0.1, -1, NULL, 0, true);
for moving the camera... adjusting the move speed parameter from 100 to 0.1 fixed my problem... now I should exchange the sphere for a capsule and things should look nicer...
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Is that with Irr 1.5? The camera params changed in 1.5 under the hood so projects have to update what they're passing.

I don't know when the character controller stuff will be added to IrrPhysx... can't guarantee anything i'm afraid! I'm currently getting IrrAI 0.5 ready for release which should be done by mid January and then after that i may do IrrPhysx 0.3 and try getting the character controller into that.
Image Image Image
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

yes its 1.5... well I changed the sphere for a capsule now and made sure it stays upright... looks quite fine... thanks for all the work...

Code: Select all

cameraPair->PhysxObject = physxManager->createCapsuleObject(pos, core::vector3df(0,0,0), 5.0f, 10.0f, 1000.0f, 0);

Code: Select all

//...code before

while (device->run()) {

//...code between

         // Update the camera pair too as we've not added that to the objects array
			cameraPair->updateTransformation();
         // Make sure the capsule stays upright	
         cameraPair->PhysxObject->setRotation(core::vector3df(0,0,0));
			// Begin the render process
			driver->beginScene(true, true, video::SColor(225,120,120,120));

			// Render the scene
			smgr->drawAll();
					
			// Render Physx debug data
			physxManager->renderDebugData(video::SColor(225,255,255,255));

			// Render the GUI
			guienv->drawAll();

			// Finish the render process
			driver->endScene();
}
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Nice one, a capsule should work better than a sphere as it approximates a human shape much better!
Image Image Image
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

hmm I've question here. is there any way to make a character to walk on a platform which isn't flat? I mean something like

Image
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Trigger zones with variable gravities?
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

You could always disable the default gravity and use a forcefield to create gravity for localized regions. This would require direct access to PhysX though, since IrrPhysX does not yet wrap this functionality.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I don't know whether forcefields would be the right path to take.. but having said that i've not looked at forcefields much!

I think Dorth's suggestions of just changing the gravity as necessary would probably work fine... What you could do (with the current version of IrrPhysx) is raycast down from your player and get the normal of the surface he's on and then change the whole physics scene's gravity to the negative of that...

Actually that wouldn't work... because then any loose objects placed elsewhere would be affected by this change so might fall off other sections of the map...
Image Image Image
fmx

Post by fmx »

Not if you only gave (irr)PhysX the triangles of the "walkable" parts, no loose objects etc, also maybe look into Collision-Groups (don't know if iPX supports them though)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

well changing the entire scene's gravity would affect everything, that's the problem so collision groups or walkable parts aren't the problem, that would be to do with raycasting the surface being walked on.

i suppose you could just create your camera controller in a way that it's not affected by any gravity and you just apply the gravity as necessary yourself... the same would have to go with all other objects too... just have a zero-g environment as far as Physx is concerned and then you apply gravity per object yourself by setting the linear velocity....
Image Image Image
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

@ Virion
psychonauts, one of my favourite games... In that screeny we're in the mind of a paranoid security guard if I'm not mistaken.

well I think gravity would be the absolute wrong way to tackel that kind of problem but each face or polygon on the walkable areas has a face normal whose vector can easily be calculated and always points in character orientation and jumping direction... all you have to do is make sure your character stays in that orientation, stuck to the ground except when jumping...

well, correct myself maybe you could just set gravity to the opposite vector frame for frame... dunno
Post Reply