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
Post Reply
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Interesting... You should be getting an extra line of console output after the IrrPhysx wrapper bit saying whether software or hardware is being used... not sure why that's not there...

It seems to be crashing at some point in ReadScene.cpp between dealing with the flagpole (successfully loaded that mesh) and then dealing with the house.. which doesn't get its physx mesh loaded.. strange...

I guess all i can suggest is doing some further debugging, see what your debugger suggests is the line it's crashing on.
Image Image Image
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Hmmm... would this run in a GeForce 8500 GT?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
roelor
Posts: 240
Joined: Wed Aug 13, 2008 8:06 am

Post by roelor »

Sure it would. It even runs on my laptop with 10 fps!
specs:
256 ram
intel pentium three 860 mhz.
Firefox was still runnning
8 mb ati rage
edit:
wat is the triangle count?
edit*2
it crashes on my pc.
amd athlon 3500+
756 mb ram
512 at radeon sapphire 2600 hd pro (agp version very little driver support. Drivers are a bit unstable. I hope its not that that causes troubles)
it stopped loading after the flag.
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

compiling problem :( [SOLVED MISSING INCLUDE DIR ]

Post by robertgarand »

Hi all,
EDIT:
A BUG IN IMPORT MSVC PROJECT,
WENT THRU BY HAND TO CORRECT PATH TO INCLUDE FILES

I starting (well trying to ) to work with irrphysic, I mad a project out of the hight field as a start, include all form irrlicht, irrphysic and nvidia sdk, lib from the 3 also.
Usually I get around with compilation problem, but this message got me stuck

Code: Select all

`_ZN3irr4core12irrAllocatorIP17SPhysxAndNodePairE12internal_newEj':
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0x52f): undefined reference to `IrrPhysx::createPhysxManager(irr::IrrlichtDevice*, IrrPhysx::SSceneDesc const&, bool)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0xf39): undefined reference to `CGUIParamChanger::CGUIParamChanger(irr::gui::IGUIEnvironment*, irr::gui::IGUIElement*, int, irr::core::rect<int>)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0xfe7): undefined reference to `CGUIParamChanger::addParam(wchar_t*, float)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0x1005): undefined reference to `CGUIParamChanger::addParam(wchar_t*, float)'

there is a few other lines like that, all headers containing the declaration are included. It looks like a problem with the allocator not knowing how to deal with those type of objects!?!
Can someone help me ?
Robert
Last edited by robertgarand on Thu Nov 20, 2008 1:28 am, edited 1 time in total.
If it can't be writen, it can't exist
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

Hi JP, I'm doing a game using physics but not physics based like an action game as Devil May Cry. And I wonder what is the advantage, disadvantage of using a wrapper like yours ?

Because I'm alone develloping the game and it's will be time gain, (no need time to learn PhysX etc ).
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Re: compiling problem :( [SOLVED MISSING INCLUDE DIR ]

Post by JP »

robertgarand wrote:Hi all,
EDIT:
A BUG IN IMPORT MSVC PROJECT,
WENT THRU BY HAND TO CORRECT PATH TO INCLUDE FILES

I starting (well trying to ) to work with irrphysic, I mad a project out of the hight field as a start, include all form irrlicht, irrphysic and nvidia sdk, lib from the 3 also.
Usually I get around with compilation problem, but this message got me stuck

Code: Select all

`_ZN3irr4core12irrAllocatorIP17SPhysxAndNodePairE12internal_newEj':
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0x52f): undefined reference to `IrrPhysx::createPhysxManager(irr::IrrlichtDevice*, IrrPhysx::SSceneDesc const&, bool)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0xf39): undefined reference to `CGUIParamChanger::CGUIParamChanger(irr::gui::IGUIEnvironment*, irr::gui::IGUIElement*, int, irr::core::rect<int>)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0xfe7): undefined reference to `CGUIParamChanger::addParam(wchar_t*, float)'
D:/projet/AppoloXX/../irrlicht-1.4.2/include/irrAllocator.h:(.text+0x1005): undefined reference to `CGUIParamChanger::addParam(wchar_t*, float)'

there is a few other lines like that, all headers containing the declaration are included. It looks like a problem with the allocator not knowing how to deal with those type of objects!?!
Can someone help me ?
Robert
Looks like you may not have included the necessary .h and .cpp files in your project as stated in the error log... namely CGUIParamChanger.cpp and .h and also Wherever SPhysxAndNodePair is defined and declared... ShapeCreation.h and .cpp? You have to actually add them to your project rather than just including them.

Steel Style, the wrapper should save you a lot of time as you say. You won't need to learn the ins and outs of Physx and how to integrate it with Irrlicht, such as converting vector types and matrices etc. All you need to do is learn my simple interface.

The downside is that the support is limited currently... I haven't provided support for a large amount of the Physx SDK, there's just the things you see in the examples basically. But if there's something you really need then you can just let me know and I may be able to sneak it in for you.

So yeah, if you want to send me a PM to talk about your project further and the sort of physics you require then that's cool :)

Mel, your graphics card doesn't matter at all, it can be Nvidia, ATI, Onboard... old, new, borrowed or blue... But if you have a recent GeForce (which yours may be, i'm not sure) then you will be able to benefit from hardware acceleration of the physics. But of course you need to be aware that not all your users will have the same graphics card so you'll have to be careful about detecting when the hardware acceleration is available and doing extra physics stuff maybe and not doing it when it's not available. Or you can just plan your physics so that it supports your lowest target spec and doesn't worry about acceleration at all.
Image Image Image
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

you're right

Post by robertgarand »

Thx for reply JP,
As I said in my edit I had to correct the path and files inclusion.
Some points in import msvc project in CB don't work.
But i had other issues compiling with CB.
Compiler don't recognize sprintf_s and other new functions.
I tried to update my mingw with no effect.
I rewrite some functions to get it compiled, but it is tudious,
and the exe file is like 2 Meg ?!?

If someone have working project for irrphys, I'd gladly take it :)
I must be missing something, even after many hours of search and scrutinizing the MSVC project (I installed MSVC express wich work like a breeze, compiled and ran right away), I don't know what is wrong.

Tia,
Best regards,
Robert
If it can't be writen, it can't exist
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

sprintf_s is a M$ function, so if you don't use VC++, forget it.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

When compiling Irrlicht apps you should rely on the proper replacement of those functions made by Irrlicht. Just use snprintf.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Cheers for the suggestion Hybrid, i'll look into that!

As Dorth says they are Microsoft versions of the functions, they're meant to be safer than the original implementations...

If your .exe is coming out at 2mb then that's something to do with your compiler setup I guess... With the MSVC projects provided you can see i'm getting around 200kb (i think). But to be fair it doesn't really matter how big the .exe is does it? Your project's probably gonna have quite a few mbs of assets so an extra mb or two in the .exe won't hurt ;)
Image Image Image
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

Too much work

Post by robertgarand »

Thx for the replies and procision.
Searching on web, i found that those modification (sprint_f, sopen_f,etc) were propose by M$ to iso commitee in 2005, but not implemented in other compilers yet. The fix is thru redefining the function with preprocessor commands, wich I am not to familiar with.

ex.#define sprintf_s snprintf in irrtypes or other include header

Then cast the msvc function to the standard C99 ones,
That I don't know how to do it safely...

Code: Select all

C99
int __cdecl __MINGW_NOTHROW snprintf(char *, size_t, const char *, ...);
MSVC3005 &+
sprintf_s(_Out_z_bytecap_(_SizeInBytes) char * _DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char * _Format, ...);
Since I don't want to use MSVC, i'll have to go without irrphys :(

If someone have the time and knowledge to fix it, let me/us know.

regards,
Robert
If it can't be writen, it can't exist
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

another feature

Post by 3DModelerMan »

You could also put in cloth support for only part of a mesh, like having cloth that can be applied to a mesh buffer.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

I like this :) You have a very professional programming style.

a few requests.....

I could use a method to render the debug data of a single IPhysxObject instead of the entire scene if needed. I could also use the ability to 'freeze' a particular object's physics activity.

both of these are for editor style applications. When selecting an object to move it around, seeing the physics outline and having it not respond to gravity and such would be helpful for object placement.

also, in my application, you can select an object from the gui (example, a goblin) and drag him into the world. He stays attached to the mouse cursor until you release him. At that point, he falls to the ground and takes off doing whatever his script says. I can wait until he is dropped to build the physics object, but I prefer to build prior if possible and just freeze him.

any thoughts or help is appreicated, and again, bang up job on this wrapper. I redid the entire program (over 50 game objects) from IrrNewt to IrrPhysx in a matter of days. The results are most promising and your work is appreciated. If you need anything, please let me know. This is spectacular work to date.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Re: Too much work

Post by JP »

robertgarand wrote:Thx for the replies and procision.
Searching on web, i found that those modification (sprint_f, sopen_f,etc) were propose by M$ to iso commitee in 2005, but not implemented in other compilers yet. The fix is thru redefining the function with preprocessor commands, wich I am not to familiar with.

ex.#define sprintf_s snprintf in irrtypes or other include header

Then cast the msvc function to the standard C99 ones,
That I don't know how to do it safely...

Code: Select all

C99
int __cdecl __MINGW_NOTHROW snprintf(char *, size_t, const char *, ...);
MSVC3005 &+
sprintf_s(_Out_z_bytecap_(_SizeInBytes) char * _DstBuf, _In_ size_t _SizeInBytes, _In_z_ _Printf_format_string_ const char * _Format, ...);
Since I don't want to use MSVC, i'll have to go without irrphys :(

If someone have the time and knowledge to fix it, let me/us know.

regards,
Robert
Good researching! I will try to get this sorted out so it uses Irrlicht's system for the next version... But for now you could just edit the source so that wherever the MS print functions are just revert them back to the normal versions so instead of whatever i've put just put sprintf. You're gonna have to recompile IrrPhysx anyway if you're not using it with MSVC.

3DModeler, That's something that you can probably do already... A cloth Physx object is created from a single mesh buffer and then can be attached to a rigid body object with the available functions in IClothPhysxObject. So i guess you could just grab the required mesh buffer and then attach it to any colliding shapes (one of the available functions) and that should sort of work... Having said that this probably wouldn't work for a character as I haven't got ragdoll support in yet which is what you'd have to use for animated characters.

Seven, cheers for the suggestions! Freezing a particular object's physical activity is a good one... I guess you could maybe force it currently by setting the object's linear and angular velocity to 0 each frame... Are you wanting to freeze it and then unfreeze it so it continues moving as it was before? Or are you not worried about what it was doing before when you unfreeze it? Basically i'm not sure how easy it would be to freeze and unfreeze to the same state. Rendering a single object in debug probably isn't possible... There is support in Physx to prevent some objects from being rendered in debug, such as heightmaps for sure, but i'm not sure about other objects, i'll look into this and see how well it can be implemented!

Thanks so much for the very kind words, i'm really glad that this is actually being of use to you and will inspire me to keep doing good work on it! Feel free to keep on churning up any requirements. Currently i'm trying to get IrrAI 0.5 out so IrrPhysx work i'm trying to put on the back burner for the time being as I reaaaalllly need to get IrrAI sorted out a bit, but i have to say that IrrPhysx has been awesome to work on, if only because it's been pretty darned easy and fun to develop thus far!
Image Image Image
roelor
Posts: 240
Joined: Wed Aug 13, 2008 8:06 am

Post by roelor »

So ive recently reinstalled irrlicht for use with codeblocks. It was a fast install and Im using the GNU GCC compiler. The thing is when I open an example it states that <irrlicht.h> isnt found. (I can make working irrlicht projects but I cant open this one.) I know I 'm not supposed to ask this but what should I do to open this? can you explain in steps?
(I don't have the directx sdk. Im using opengl)
Post Reply