ODE in ps2dev.org svn compilation error

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

ODE in ps2dev.org svn compilation error

Post by Shazz »

I was wondering if ODE examples should compile, I've got this pspgl error :
$ make drawstuff-test
psp-ar rc lib/libdrawstuff.a drawstuff/src/drawstuff.o drawstuff/src/psp.o
psp-ranlib lib/libdrawstuff.a
psp-gcc -c -Wall -fno-rtti -fno-exceptions -Wall -I/usr/local/pspdev/psp/sdk/include -g -Iinclude -IOPCODE -DdTRIMESH_ENABLED -O0 -o drawst
uff/dstest/dstest.o drawstuff/dstest/dstest.cpp
psp-gcc -o drawstuff/dstest/dstest.exe drawstuff/dstest/dstest.o lib/libode.a lib/libdrawstuff.a -L/usr/local/pspdev/psp/sdk/lib -lGLU -lGL
-lpspdisplay -lpspge -lpsprtc -lpspctrl -lstdc++ -lpspdebug -lpspsdk -lm -lc -lpsputility -lpspuser -lpspkernel
lib/libdrawstuff.a(drawstuff.o): In function `Texture':
drawstuff/src/drawstuff.cpp:243: undefined reference to `glPixelStorei'
drawstuff/src/drawstuff.cpp:244: undefined reference to `glPixelStorei'
...
thanks
- TiTAN Art Division -
http://www.titandemo.org
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

It gives the same error on my system.
(Windows XP, cygwin)
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

According to the commit message for rev 1232:
Get test programs to build; some of them even run. Needs recent goop.org PSPGL.
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

Aha, you too eh?
Have you actually ported ODE, or are you just trying the samples?
I've got a running port of ODE, and i'm currently working on a game. If anyone's interested, I'll release the ODEPSP library to the public.
EDIT: Just to prove i'm not lying:
Image

EDIT 2: I see, I didn't notice that there was a ps2 port of ODE. Oh well.
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

Yeah, I wasn't quite ready to announce the SVN tree for general consumption, but its all basically there. The only test programs which are usefully working are the test_chain* ones.

All the tests rely on OpenGL, but ODE itself doesn't.

The crash test runs, but ironically, crashes after the first frame. I haven't looked into why yet.

From the look of it, ODE should be a good candidate to use the VFPU, since the core math is all matrix stuff.

AnonymousTipster, did you have to do much more to ODE? So far, I've found it has been mostly a matter of getting it to cross compile, with no other deep changes. If you have other changes, perhaps you can contribute them to the SVN tree.
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

I haven't changed very much source-code wise, I'm not using a compiled library, I have all the files in a folder named ode, and my makefile assembles all the source files into .o files, and links them with the program at compile. The advantage to this is that it lets you change some of the source code, and compile it with the app, rather than re-compiling the library.
Whilst porting ODE, the only problems I had involved getting C++ code to work properly, because the files were mostly C++, but a couple were C. That made the compiler do some very weird things, including reading all the files back-to-front! All this means is that any program that uses ODE needs to use .cpp, and not .c. I think that using extern "C" is OK though.
The worst problems I encountered weren't to do with getting it to compile, it was getting the simulation to behave. It took me a while to get the sample in the photo (dropping cubes onto a plane) to work at a decent framerate.
In my sample code, I have a couple of helper functions which take an ODE Body and return a PSP GU matrix (much like the routine in DrawStuff), which makes implementing it with the PSPs native functions quite easy.

As for porting the ODE samples, they may prove useful to show how it integrates with PSPGL, but the physics in them are often non-applicable or non-compileable. For example, there is a buggy sample which is supposed to show how vehicles work. It has three wheels. Theoretically, it should be easy to add on another wheel to make a car, but it requires a LOT of tweaking (as I found out), because you can't get the two wheels to turn exactly in parallel, so they fight each other and end up launching the vehicle into the sky. The sample i've used I made from scratch, but borrowed the near_callback function. It's about as simple as you can get for showing how to init the GU and ODE, getting them to work together.

Phew, that was a long post ^o^. Anyways, I'll upload the files to my server and make a thread about it tomorrow (GMT).
bengarney
Posts: 24
Joined: Sat Oct 22, 2005 6:48 pm

Post by bengarney »

Are you capping at 60fps, or is that just a refresh/synch issue?

(The reason I ask is because if you want your whole game to run at 30fps, you usually want each component to be running at 100+fps.)

I'd be really interested to see what sort of optimizations to ODE you could do with the VFPU. Speaking of it, are there any examples on how to use the VFPU?
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

It depends on the load, in the game I working on with it, it can go up to 100fps, but usually hovers around 70.
Post Reply