No collision on the Openmoko Freerunner

Official forum for the Chipmunk2D Physics Library.
Post Reply
simon
Posts: 2
Joined: Tue Sep 09, 2008 8:41 am
Contact:

No collision on the Openmoko Freerunner

Post by simon »

hi

I want to make a physics playground for the openmoko freerunner http://www.openmoko.org/ (arm cpu).

I decided to run the Demo1 from svn (Rev 27) to test the device. As it has no opengl support yet, I rewrote the drawing function (in main.c) to use libcairo in a GTK window. I didn't change any chipmunk code. The resulting code can be downloaded from here: http://wenner.ch/files/public/simon/tmp ... est.tar.gz

Drop the two files into ./src and run: gcc -Wall -O3 -std=gnu99 -ffast-math *.c `pkg-config --libs --cflags gtk+-2.0` -o moko-test

The problem: The app runs fine on my x86 Debian Linux box. It looks exacly like the OpenGl version. But if I crosscompile it for arm and run it on my Freerunner the collision does not work anymore. The box in Demo1 just falls through the stairs. I tried huge update and drawing intervals as I thought It is a performace problem, but it didn't change anything.

Chipmunk seems to run on the iphone, which is arm too, isn't it? So it should run. Or are there any architecture specific changes needed? I'm not familiar with this architecture yet.

It would be nice if someone could enlighten me.

Cheers,
Simon

Edit: typo
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: No collision on the Openmoko Freerunner

Post by slembcke »

Try it without --ffast-math maybe. It could be causing GCC to optimize out certain cases relating to infinity or NaNs that Chipmunk uses. I use it on PPC/x86/iPhone, but I think the FPUs on those processors simply do it all in hardware anyway.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
simon
Posts: 2
Joined: Tue Sep 09, 2008 8:41 am
Contact:

Re: No collision on the Openmoko Freerunner

Post by simon »

Your hint was correct. I realised that my biuldsystem (official Openmoko Toolchain) added even additional parameters (-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -fpermissive -fvisibility-inlines-hidden). After removing all of them, collision works as expected.

Thanks! You are my hero. :-)
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: No collision on the Openmoko Freerunner

Post by slembcke »

My suspicions were correct then. Good to know.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests