Physics engines? (simple)
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Physics engines? (simple)
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 is the main problem. It just needs to be something simple, all I really need is basic velocity force and gravity.
Thanks .
(havn't tried MSVC5 yet) or I get hundreds of compile warnings. PhysX doesn't compile on GCC is the main problem. It just needs to be something simple, all I really need is basic velocity force and gravity.
Thanks .
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
If warnings are your only issue, try
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.
Code: Select all
#pragma warning( disable : XXXX )
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.
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.
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
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
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Physics engines? (simple)
Stupid compiler. What does it know about C++ anyway?3DModelerMan wrote:I can't change to MSVC8
(havn't tried MSVC5 yet) or I get hundreds of compile warnings.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
cool
Rogerborg, I definitely think the compiler knows more about C++ than me otherwise I would know how to get rid of the warnings.
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).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
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Physics node
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
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...
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...
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)
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)
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
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
hmmm
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
okay
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar