Physics engines? (simple)

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Physics engines? (simple)

Post by 3DModelerMan »

I know it's been asked a million times before but. Which physics wrapper is the best choice for the GCC MinGW compiler? I can't change to MSVC8
(havn't tried MSVC5 yet) or I get hundreds of compile warnings. PhysX doesn't compile on GCC :cry: is the main problem. It just needs to be something simple, all I really need is basic velocity force and gravity.
Thanks :D .
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

If warnings are your only issue, try

Code: Select all

#pragma warning( disable : XXXX )
where XXXX is the number of the warning(s) which is bothering you. Or, perhaps you could try programming in a way which doesn't produce errors. It seems to me like you're attacking this problem from the wrong direction.
skumar
Posts: 201
Joined: Thu Feb 14, 2008 6:24 pm
Location: kerala state india
Contact:

Post by skumar »

#pragma warning( disable : XXXX )
Hey Ion Dune....is this pragma thing applicable to gcc??????
skumar
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Doesn't seem to be the case.

However, on this issue of disabling warnings in MSVC, there is also a project compile option to disable all warnings, or set the warning level.
fmx

Post by fmx »

why not just fix your code and eliminate all reason for warnings? The code will still compile perfectly in other compilers too, and it keeps things nice and easy.

As far as simple physics go, using ANY physics-engine would be overkill.

Just do simple velocity calculations with Irrlicht:

For each "object" to be affected by Gravity (or any kind of Forces), store in a class somewhere:
- Mass (KG)
- Velocity vector (Meters)
- Current Force Vector (N)

Then in an Update Loop somewhere:
- Reset All forces on all objects (objectForce = vector3df(0,0,0) )
- apply Gravity (objectForce += vector3df( 0,-10,1) )
- apply any other Forces
- calculate velocity (objectVel = dt * objectforce / objectMass)
- apply velocity to object position (objectPos += dt * objectVel)

and you should be good to go.

Or do you think Irrlicht would benefit with having a "simplePhysicsSceneNode" for cases like this where using a physics-engine really is not neccessary?
I'm sure I could cook one up if anyone is interested ;)
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Re: Physics engines? (simple)

Post by rogerborg »

3DModelerMan wrote:I can't change to MSVC8
(havn't tried MSVC5 yet) or I get hundreds of compile warnings.
Stupid compiler. What does it know about C++ anyway?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

cool

Post by 3DModelerMan »

Rogerborg, I definitely think the compiler knows more about C++ than me :lol: otherwise I would know how to get rid of the warnings.
Or do you think Irrlicht would benefit with having a "simplePhysicsSceneNode" for cases like this where using a physics-engine really is not neccessary?
I'm sure I could cook one up if anyone is interested :wink:
That would definitely be a thing Irrlicht should have. I never have really thought of a time when I need more than just that(so far at least).
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Actually, I think the whole physic of Irr should be split from the main code, and flag-chosen for compilation ;)
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Physics node

Post by 3DModelerMan »

Actually what would be better, is if ISceneNode could have member functions like addForce and setVelocity added. Or some sort of those kind of functions for time based movement (as long as there's an addForce one).
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Certainly not! Irrlicht is a graphic engine, not a game engine. I'm all for distributing some collisions and mayhaps some physics with it, but as separated as can be, not in the base scene element!
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

well most warnings come from double to float or float to integer conversions and needlessly spam the output window... disable all warning in the project settings is quite a relief and makes finding fatal errors a lot easier...

ProjectProperties -> C/C++ -> WarningLevel -> Off (/W0)

and actually I believe I read something about physX compiling on GCC, after editing the case sensitive includes etc.
irrNewt is also recommendable I think...
fmx

Post by fmx »

I'm with Dorth on this one, no need for Irrlicht to have such functions by default.

I should have something for you later today or in a few days latest, probably make a new project topic for it. It might end-up becoming a simple sort of physics-engine in a way, although definitly not a replacement for the real-deal physics-engine like Newton, Bullet or PhysX (in terms of efficieny and accuracy).

Depends how "powerful" it needs to be:
forces and velocities (affecting individual scene-nodes) is an absolute must-have, but collision-detection probably would be taking it too far IMO.

BTW, have you tried disabling the warnings yet? If you could get MSVC working then that'd be a start in the right direction (physics engine or not)
;)
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

I could compile ODE in MinGW (code::blocks), though it lacks precission, sometimes, it misses collisions with cylinders, and i don't know if it would work well with arbitrary triangle meshes. But for a basic engine, it should work. In fact, anything that don't rely on an external library (like Physx or, in an rare case, Newton) and can be compiled under Linux, should be (theoretically) capable of compiling under MinGW, for the compiler is the same in structure.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

hmmm

Post by 3DModelerMan »

I thought it was a bad idea to ignore compiler warnings though.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

okay

Post by 3DModelerMan »

So I got it switched now. And disabled the compile warnings. But now I'm getting these obscure linker warnings

Code: Select all

-------------- Build: Pingy's adventure in Pingy's adventure ---------------

main.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Linking console executable: data\bin\Pingy's adventure.exe
LINK : warning LNK4044: unrecognized option '/pg'; ignored
LINK : warning LNK4044: unrecognized option '/lgmon'; ignored
LINK : warning LNK4044: unrecognized option '/s'; ignored
Output size is 129.00 KB
Process terminated with status 0 (0 minutes, 4 seconds)
0 errors, 4 warnings
 
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply