Soft bodies physic
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/Jelly ... pp_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.
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/Jelly ... pp_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.
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.
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.
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:
and the makefile:
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.
added to main.cpp after the includes:
Code: Select all
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;
}
}
Code: Select all
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
Thanks for tip, strangely it crushed on my slim -_- Could you send me your modified code?Heimdall wrote:I've played with your code and got it to work with any fw, this was the change...
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...
Hi,
I've uploaded the EBOOT + the source path here: http://www.jetcube.eu/projects/JelloPhy ... 080704.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.
I've uploaded the EBOOT + the source path here: http://www.jetcube.eu/projects/JelloPhy ... 080704.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.
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).But still I'm under mega big impression how they were able to get so good performance in LocoRoco...
This means no constant inner area for soft bodies, but still a realistic (and FAST) effect.
jean
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
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
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 :
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
When i'm trying to debug with psp-gdb i get this message on the start :
Code: Select all
_start (args=0, argp=0x0) at crt0_prx.c:109
109 crt0_prx.c: No such file or directory.
in crt0_prx.c
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