Reccomendations for physics

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Reccomendations for physics

Post by armakapo »

Hello community!
I'm having a problem with my project, it's rpg-style. I only need gravity for it, not complicated collisions or stuff. I've tried with the CollisionResponseAnimator, but its gravity is pretty bad, it works frame-dependant and with strange values (hard to find the correct value for it). The other problem with it is that the character is able to climb "hills". Even with different values for the ellipsoid radius and SlidingSpeed, it's very buggy and can still climb steep hills and get stuck in kinda plain areas. I was thinking in using a physics engine for this, but I don't know which one should I use. Can you reccomend me one? It doesn't need to be too sophisticated, as I only need a good working gravity.
Thanks in advance, any help appreciated!
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Reccomendations for physics

Post by REDDemon »

you can try to use Newton or Bullet. Adding simple terrain collision and gravity would be very easy.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Reccomendations for physics

Post by armakapo »

I'll give a try to newton, already tried with bullet but can't get my programs to compile while using the bullet libs, because of some linking problems. It seems the libs were compiled with using a non default debugger (sjlj or so). The other option is recompiling the libs for gcc but that gives a lot of new problems.
Thanks for your help, will post again here after I try Newton. Any other opinion will be appreciated too!
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Re: Reccomendations for physics

Post by Iyad »

Why don't you keep irrlicht's collision detection and simply calculate by yourself the gravitationnal force between to objects. This is way easier if you simply want gravity and collision detection. And if the force is strong enough between the "land" and the object probably it won't climb the hills...
#include <Iyad.h>
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Reccomendations for physics

Post by serengeor »

armakapo wrote:I'll give a try to newton, already tried with bullet but can't get my programs to compile while using the bullet libs, because of some linking problems.
That's the spirit. Soon you'll drop the whole project cause it didn't compile.
Working on game: Marrbles (Currently stopped).
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Reccomendations for physics

Post by armakapo »

@serengeor hey hey I'm not giving anything up, just checking more options because I spend a few hours trying to make bullet work and wasn't able to do it, and there was pretty much no information on the werb about the errors I was getting. @Iyad To do something like that I guess I'll have to modify irrlicht's code, I dont know if I can put my hands on the collision algorithms
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Reccomendations for physics

Post by REDDemon »

for bullet VS project files are provided with the standard package, while the Code::Blocks project files can be imported from VS files. Almost a year ago i tried to compile bullet and worked pretty nice (using c::b + gcc). You can also try one of the wrappers to bullet or newton that you can find in the "project announcement" forum. I think their authors have precompiled newton and bullet in their packages
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Reccomendations for physics

Post by armakapo »

I've downloaded irrBullet a few days ago. The thing is that when I link with the Bullet libs, I get a lot of errors of undefined references (all repeated, they are 3: unwind_sjlj_register, unwind_sjlj_unregister and gxx_personality_sj0).
Those errors come from bullet libraries, not from my code or irrBullet either. There is very little information about those errors on the web, but I'm guessing I have an old version of gcc (I don't use code::blocks) so I'll see how can I fix this. If you know something about these errors please tell! Thanks
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Reccomendations for physics

Post by serengeor »

armakapo wrote:@serengeor hey hey I'm not giving anything up, just checking more options because I spend a few hours trying to make bullet work and wasn't able to do it
The time spent might be because of your lack of knowledge.
armakapo wrote:there was pretty much no information on the werb about the errors I was getting.
Sure there weren't. About 172,000 results (0.21 seconds)
Working on game: Marrbles (Currently stopped).
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Reccomendations for physics

Post by armakapo »

I checked a lot of them and still doing, but no solution yet (tried a lot already). I posted here because may be any of you already faced that problem before and could give me a hand. I loaded the projects with c::b, used the gcc version it came with, and still I'm getting some errors. Now they are only undef. reference to gxx_personality_v0 and Unwind_resume. I'll try more solutions but if you went through this before I'll really appreciate any pointer :)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Reccomendations for physics

Post by serengeor »

You should copy and post here at least the first few errors (exact with error codes).
Working on game: Marrbles (Currently stopped).
armakapo
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Reccomendations for physics

Post by armakapo »

Here is the error report from code::blocks:

Code: Select all

-------------- Build: Win32 GCC Release in Affectors ---------------
 
Linking console executable: ..\..\bin\win32_gcc\Affectors.exe
obj\Release\main.o:main.cpp:(.text+0x39): undefined reference to `_Unwind_Resume'
obj\Release\main.o:main.cpp:(.text+0xc7): undefined reference to `_Unwind_Resume'
obj\Release\main.o:main.cpp:(.text+0x113): undefined reference to `_Unwind_Resume'
obj\Release\main.o:main.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0x91): undefined reference to `_Unwind_Resume'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0x11f): undefined reference to `_Unwind_Resume'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0x628): undefined reference to `_Unwind_Resume'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0xb60): undefined reference to `_Unwind_Resume'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0xe1a): undefined reference to `_Unwind_Resume'
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.text+0x10d8): more undefined references to `_Unwind_Resume' follow
obj\Release\framework\exampleframework.o:exampleframework.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x149): undefined reference to `_Unwind_Resume'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x1cd): undefined reference to `_Unwind_Resume'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x347): undefined reference to `_Unwind_Resume'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x34f): undefined reference to `_Unwind_Resume'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x3f7): undefined reference to `_Unwind_Resume'
obj\Release\affectorsexample.o:affectorsexample.cpp:(.text+0x692): more undefined references to `_Unwind_Resume' follow
obj\Release\affectorsexample.o:affectorsexample.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
and here the one I'm getting with my other IDE:

Code: Select all

..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btTypedConstraint.o):btTypedConstraint.cpp:(.text+0x408): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btTypedConstraint.o):btTypedConstraint.cpp:(.text+0x41e): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btTypedConstraint.o):btTypedConstraint.cpp:(.text+0x48a): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btTypedConstraint.o):btTypedConstraint.cpp:(.text+0x4d1): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x26c2): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2708): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2865): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2908): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x295f): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2998): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2af5): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2b98): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2be5): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2c04): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2c77): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2cf1): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2d35): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2d54): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2dc7): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text+0x2e41): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0x15): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0x34): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0xaf): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD0Ev[btRigidBody::~btRigidBody()]+0xf5): undefined reference to `_Unwind_SjLj_Resume'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0x15): undefined reference to `__gxx_personality_sj0'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0x34): undefined reference to `_Unwind_SjLj_Register'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0xa4): undefined reference to `_Unwind_SjLj_Unregister'
..\..\Irrlicht\IrrBullet\lib\win32_gcc/libbulletdynamics.a(btRigidBody.o):btRigidBody.cpp:(.text$_ZN11btRigidBodyD1Ev[btRigidBody::~btRigidBody()]+0xea): undefined reference to `_Unwind_SjLj_Resume'
collect2: ld returned 1 exit status
 
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Reccomendations for physics

Post by serengeor »

http://bytes.com/topic/c/answers/433942 ... onality_v0
This might be your exact problem, and a solution for it.
Working on game: Marrbles (Currently stopped).
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Reccomendations for physics

Post by hendu »

You need to rebuild the irrbullet/bullet libs with your own compiler, the binaries are incompatible with your gcc build.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Reccomendations for physics

Post by serengeor »

hendu wrote:You need to rebuild the irrbullet/bullet libs with your own compiler, the binaries are incompatible with your gcc build.
Does bullet even come with precompiled libs?
Working on game: Marrbles (Currently stopped).
Post Reply