| View previous topic :: View next topic |
| Author |
Message |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Wed Jun 25, 2008 8:57 pm Post subject: Soft bodies physic |
|
|
Hi everyone.
It's not a homebrew for PSP - yet, but maybe someone could find this useful.
I converted walaber JellyPysic engine from C# to C++ and it's working quite nice :>
Here is last code - http://drakon.xxl-web.pl/projects/JellyPhysic_cpp_0_1.rar with some small test that use OpenGl to render shapes.
I have an idea for small game that use this library on PSP - I will post some info when I will make it:>
Ps. If someone is interested I made small test for PSP with library that JellyPhysics is based on - http://drakon.xxl-web.pl/psp/soft_body.rar.
You are moving cursor and dragging body on triangle ;)
[EDIT]
I just updated the source - in last version there was some big memory leaks... Now it's ok. |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Wed Jul 02, 2008 7:01 pm Post subject: |
|
|
Hi once again.
If someone is interested I made quick test for PSP :
http://drakon.xxl-web.pl/psp/PSP_JellyPhysic.rar
On square and circle bodies are added, on triangle you can drag bodies.
Exit is on the start button.
There is still much more to do... optimize more, clean code, remove bugs (memory is ending too quick :/). I would very grateful for some advices about optimizations.
Currently I'm using pspGl for rendering.
Last edited by Drakon on Thu Jul 03, 2008 7:15 am; edited 1 time in total |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Wed Jul 02, 2008 8:01 pm Post subject: |
|
|
seems interesting :) _________________
Upgrade your PSP |
|
| Back to top |
|
 |
Rangu2057
Joined: 23 Jul 2007 Posts: 87 Location: wilmington, NC
|
Posted: Thu Jul 03, 2008 10:14 am Post subject: |
|
|
interesting indeed :)
EDIT: well if you need any help count me in, i need something to do besides play ftb2 all day, btw i can only code in C and a little ASM _________________ the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2) |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Thu Jul 03, 2008 4:59 pm Post subject: |
|
|
Anyone tried running the eboot?
No luck here under 1.50 or 3.52. _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Thu Jul 03, 2008 5:41 pm Post subject: |
|
|
| Art wrote: | Anyone tried running the eboot?
No luck here under 1.50 or 3.52. |
There is currently build only for psp slim and soft above 3.71.
I'm using 3.90 and it's working. |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Thu Jul 03, 2008 6:48 pm Post subject: |
|
|
I've played with your code and got it to work with any fw, this was the change:
added to main.cpp after the includes:
| Code: | extern "C"
{
# include <pspkernel.h>
/* Define the module info section */
PSP_MODULE_INFO(__FILE__, 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int exitCallback(int arg1, int arg2, void *common)
{
sceKernelExitGame () ;
return 0 ;
}
int callbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback ( "Exit Callback", exitCallback, NULL ) ;
sceKernelRegisterExitCallback ( cbid ) ;
sceKernelSleepThreadCB () ;
return 0 ;
}
int setupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread ( "update_thread", callbackThread, 0x11, 0xFA0, 0, 0 ) ;
if ( thid >= 0 )
{
sceKernelStartThread ( thid, 0, 0 ) ;
}
return thid;
}
} |
and the makefile:
| Code: | TARGET = JelloTest
OBJS = main.o
CFLAGS = -O3 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
INCDIR = $(PSPPATH)/include
LIBS = -lJello -lglut -lGLU -lGL -lpspvfpu -lpspge -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgum -lpspgu -lm -lstdc++
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Soft Body Test
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
Note that I build all the Jello Physics as a lib so i can easily import it to other projects instead of compiling it every time. |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Fri Jul 04, 2008 7:17 am Post subject: |
|
|
| Heimdall wrote: | | I've played with your code and got it to work with any fw, this was the change... |
Thanks for tip, strangely it crushed on my slim -_- Could you send me your modified code?
I cleaned some duplicated code and put psp version in svn repository here:
http://jphysicmod.googlecode.com/svn/trunk/
(with normal cpp version and c#,also pack on my website was updated)
Performance is slowly increasing :) But still I'm under mega big impression how they were able to get so good performance in LocoRoco... |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Fri Jul 04, 2008 5:03 pm Post subject: |
|
|
Hi,
I've uploaded the EBOOT + the source path here: http://www.jetcube.eu/projects/JelloPhysics/PSP_JellyPhysic-20080704.zip
About the slim, maybe you are right i've a old fat PSP i've never tested my stuff on the slim... Anyway the patch allows you to build a lib separately from the demo app, so other people can use it. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Jul 04, 2008 5:42 pm Post subject: |
|
|
| Quote: | | But still I'm under mega big impression how they were able to get so good performance in LocoRoco... |
I obtained a similar effect (on a PC) with metaball technique: 8 metaballs constrained with springs around a center. Consider that 2d metaballs are computable in a fast way by GE by superimposing and tresholding precomputed 2d/transparent sprites and rendering everything in a texture (the sprite you will use).
This means no constant inner area for soft bodies, but still a realistic (and FAST) effect.
jean |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Fri Jul 04, 2008 6:51 pm Post subject: |
|
|
@Haimdall - thanks for patch :) I updated svn and now there is build version for fat and slim.
@jean - thanks for pointing out, i will read about this technique :) |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Sat Jul 05, 2008 9:25 am Post subject: |
|
|
Sorry for this spamming...
I changed rendering from pspGL to GU, changed the way that physic is updated and the jump of the performance was quite Big!!! :)
Here it is : http://drakon.xxl-web.pl/psp/PSP_JellyPhysic2.rar
Controls didn't changed.
This is only test - after cleaning some bugs (crush at exit...) I will update svn.
Cheers |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Thu Jul 17, 2008 5:26 pm Post subject: |
|
|
ymm I have a problem with debug :/ I was searching forum but didn't find answer ...
When i'm trying to debug with psp-gdb i get this message on the start :
| Code: | _start (args=0, argp=0x0) at crt0_prx.c:109
109 crt0_prx.c: No such file or directory.
in crt0_prx.c |
it's kinda strange because when i'm trying some samples from sdk it's ok... So the only logical answer is that I'm doing something wrong...
Is there someone that can put light on this ? I would be very grateful.
Ps. here is video how it works on psp for everyone that couldn't see it : http://www.vimeo.com/1352294 |
|
| Back to top |
|
 |
|