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
nixxe
Posts: 2
Joined: Mon Apr 13, 2009 1:15 am

Post by nixxe »

Found something else when playing around with this, the heightfield is rendered with tris as ///// but physx is using \\\\\ (or the other way around...). In this image i used my skill in paint to mark one "square" and the 2 tris for it, and you can see that the debug lines are on the other diagonal.
Image
*EDIT*
Just found out you can change the diagonal :)
Changed

Code: Select all

			currentSample->tessFlag = 1;
to

Code: Select all

			currentSample->tessFlag = 0;
and the bug was fixed.
*/EDIT*

The "out of box" gameexample for irrlicht 1.5 (with system software 8.06.12) crashed and after downloading all SDKs as showed in first post and compiled in MSVC 2008 express it still crashed until I removed ROUND.

Can't see what the problem can be, this is a clean computer with nothing more then WinXP sp3 and MSVC on, my hardware is AMD Athlon XP 2500+ and NVidia GeForce 7600 GS, will try it on some other computers and see if I can get it running there.

One other thing is that since physx is using 1.0 for 1 meter all forces like gravity and stuff gets wrong when using big models. One way is to make all models in real scale but that can lead to other bad stuff like getting extremely close up on wall and so on, so a scalevalue for IrrLicht<->IrrPhysx seams like a good solution. In the gameexample 0.1 seams to fit just right since. That way you can model in meter, inch or just any madeup size and still get every force value just like in the real world.[/code]
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I knew about that tesselation flag in the heightmaps and had it setup correctly... or atleast i thought i did... strange that it wasn't right... maybe it was wrong in that specific heighfield type.. :s

I know there's issues with the scaling between irrlicht and physx, though i'm not sure how to setup a scaling factor particularly.. I suppose you could just scale any distances/sizes coming into irrphysx by the set amount but to me that sounds a bit error prone! :lol:
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

JP wrote:What's so special about FPS games that need objects with holes in them?
Well... i need something better than bounding box for detecting bullet colision with players! Player is a animated, moveable model.

how can it be done? Should i make it in irrlicht physic engine, maybe newton? Or in pure irrlicht?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

For that you'd want to basically create a ragdoll shape around the animated model. It's something I've got planned for IrrPhysx but won't be available in the near future I'm afraid.

You could do it in Irrlicht by just putting a bounding box around each body part of the animated model and testing the bullet for intersection with each one.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

JP wrote: You could do it in Irrlicht by just putting a bounding box around each body part of the animated model and testing the bullet for intersection with each one.
Yes, i tought about it.. it let me detect where players hit, calculate health loss (100 head, 75 torso, 25 leg etc). But it isnt so easy solution!



Maybe other physic engine offer something like it? Newton or smth else?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah sure any physics engine will offer the same functionality but again it's not going to be a breeze to set it up, you'd have to go through the same steps (if not more) as you would with using Irrlicht to do it.
Image Image Image
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

So physx is the best option for me?
When (in game loop) can i add velocity to objects, after or before phys->simulate??
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Don't do anything to physx objects between simulate and getResults (or whatever the matching function is called... i can't quite recall if that's right at the moment as my brain is mush...) as you can cause crashes or unexpected behaviour.
Image Image Image
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

I think addPlane() function is memory leak 24 bytes. You forget free IPhysxObject from createPlaneObject().

Code: Select all

{79} normal block at 0x003F3568, 24 bytes long.
 Data: <DcF             > 44 63 46 00 04 00 00 00 00 00 CD CD CD CD CD CD 
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Quite possibly! I'll add that to my list of things to check out :)
Image Image Image
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

Could u please show destruction mesh example ?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Nope, not done anything like that myself.... You can do some sort of destruction in Physx, not entirely sure how it works or how best to do it really but you won't see it in IrrPhysx for quite some time I shouldn't think!
Image Image Image
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

This could be done with PHYSX as it can be done with any other physic engine.

- You have to create your mesh in a 3D application in pieces (Called gibs)
- Assemble back the pieces in the application
- put the physic forces at play.
- The only thing I've saw about "gibs" is that the engine will redefine the bounding box around the mesh and reset the pivot. (As the pieces are assembled in the 3D application and their pivot is the same as when the object is complete), in hammer that feature is called "autocenter"

If you mean, that the engine will break the object in pieces, create new faces (geometry), apply textures on them and will fly them away. That not for today. There are some tools that exist today that could do that but are design tools, I do not know of any tool that can do that runtime, it must be prepared first.

Like HAVOK, they sell a specific set of tools that will allow you to do that in some restrained way. The tool will prepare your mesh for the physic collision in the engine, and will break the model in pieces. The tool will define fracture points and break the model from this(theses) point.

You can check at their tool set here:
http://www.havok.com/content/view/72/57/
The PDF to their specific tool called HAVOK DESTRUCTION:
http://www.havok.com/images/Havok_Destr ... f_2008.pdf
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah in my Alestorm game on PS3 I had cannonballs fragmenting on hard surfaces and I merely did that by removing the sphere object on collision and creating 4 new objects representing fragmented parts of the cannonball. Effectively it does the trick and is probably what most games do in this case.

I think you can get a bit cleverer about it with some of the built in stuff Physx provides but not a huge amount more...
Image Image Image
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

@christianclavet OK i understand your suggestion. But how about NVIDIA APEX framework. I interested APEX Destruction and Turbulence. Is u test APEX framework, isn't it ?
Last edited by wing64 on Sun Apr 19, 2009 4:14 am, edited 1 time in total.
Post Reply