It is currently Fri May 24, 2013 2:25 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 84 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Mon Aug 29, 2011 9:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
I had a couple of questions:
1. When the output wrapper to version 6?
2. In this version of the wrapper is missing a lot of commands, and in some procedures do not match the number of parameters. The author has no plans to add a brief description of the structures and commands?
3. What exactly does this function: cpSpaceHashEach (*space\activeShapes,@DrawShape(),#Null) ?

Little things will not ask, I will try to understand them myself.

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Mon Aug 29, 2011 11:37 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
I had a couple of questions:
1. When the output wrapper to version 6?
2. In this version of the wrapper is missing a lot of commands, and in some procedures do not match the number of parameters. The author has no plans to add a brief description of the structures and commands?
3. What exactly does this function: cpSpaceHashEach (*space\activeShapes,@DrawShape(),#Null) ?

Little things will not ask, I will try to understand them myself.

1) When it is done and not before the 4.60 is released. Sorry.
2) Tell me what you are missing and I will add it to the wrapper. Some function have to wrap a little bit more. That's the reason for different parameter. In most cases it is the return value of a structure which PureBasic can not handle correct.
3) Read the docu here: http://chipmunk-physics.net/release/ChipmunkLatest-Docs/ or ask in this forum:http://chipmunk-physics.net/forum/

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 12:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
I do not hurry you, just want to know: I continue to write under the current version of the procedure, or should wait for a new one.
"Tell me what you are missing..."
Without some procedures you can do if you know the description of the structures .But when some have additional parameters, it is not clear that there sent. I wanted to try a code, taken from the forum and could not implement it for lack of commands and mismatches.
Code:
// velocity of the two surfaces in relation to the collision normal at the collision point
static inline cpFloat
hit_velocity(cpBody *a, cpBody *b, cpVect p, cpVect n){
   cpVect r1 = cpvsub(p, a->p);
   cpVect r2 = cpvsub(p, b->p);
   cpVect v1_sum = cpvadd(a->v, cpvmult(cpvperp(r1), a->w));
   cpVect v2_sum = cpvadd(b->v, cpvmult(cpvperp(r2), b->w));
   
   return cpvdot(cpvsub(v2_sum, v1_sum), n);
}

// This is a pre-solve callback
static bool
bumpSoundCallback(cpArbiter *arb, cpSpace *space, void *unused)
{
   cpShape *a, *b; cpArbiterGetShapes(arb, &a, &b);
   cpContact *contacts = arb->contacts;
   
   const cpFloat min = 10.0f;
   const cpFloat max = 300.0f;
   cpFloat nspeed = cpfabs(hit_velocity(a->body, b->body, contacts[0].p, contacts[0].n));

   if(nspeed > min){
      ALfloat volume = fmax(fminf((nspeed - min)/(max - min), 1.0f), 0.0f);
      playSound(bumpSound, volume, 1.0f);
   }
   return TRUE;
}


Here
cpvsub, cpvmult - need 3 parameters instead of 2. What are they?

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 9:15 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
1) I continue to write under the current version of the procedure, or should wait for a new one.
2) Without some procedures you can do if you know the description of the structures .But when some have additional parameters, it is not clear that there sent. I wanted to try a code, taken from the forum and could not implement it for lack of commands and mismatches.
Code:
// velocity of the two surfaces in relation to the collision normal at the collision point
static inline cpFloat
hit_velocity(cpBody *a, cpBody *b, cpVect p, cpVect n){
   cpVect r1 = cpvsub(p, a->p);
   cpVect r2 = cpvsub(p, b->p);
   cpVect v1_sum = cpvadd(a->v, cpvmult(cpvperp(r1), a->w));
   cpVect v2_sum = cpvadd(b->v, cpvmult(cpvperp(r2), b->w));
   
   return cpvdot(cpvsub(v2_sum, v1_sum), n);
}

// This is a pre-solve callback
static bool
bumpSoundCallback(cpArbiter *arb, cpSpace *space, void *unused)
{
   cpShape *a, *b; cpArbiterGetShapes(arb, &a, &b);
   cpContact *contacts = arb->contacts;
   
   const cpFloat min = 10.0f;
   const cpFloat max = 300.0f;
   cpFloat nspeed = cpfabs(hit_velocity(a->body, b->body, contacts[0].p, contacts[0].n));

   if(nspeed > min){
      ALfloat volume = fmax(fminf((nspeed - min)/(max - min), 1.0f), 0.0f);
      playSound(bumpSound, volume, 1.0f);
   }
   return TRUE;
}


Here
3) cpvsub, cpvmult - need 3 parameters instead of 2. What are they?

1) PLease continue with your work. The Chimunk 6.x wrapper will not be free like the 5.x wrapper version.
Only 5.x will be still free. I will make a update to ther latest 5x version (5.3.5) after release of PureBasic 4.60.
2) Only cp* functions are public functions. Were you have this example source?
3) cpvsub, cpvmult, ... returning a structure of cpVect. As long PureBasic cannot handle structures as return value as long such kind of functions have to be wrapped. The first parameter is the return value.

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 5:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
Quote:
Were you have this example source?
This code is taken from the chipmunk-physics forum. Posted some guy with a nick slembcke. :)

Thank you. Somehow I figured out that code. There were link errors due to cpfabs, cpfmax, cpfmin - had to throw them away. :)
In general, it seems I am close to completing a wrapper for your wrapper. :)

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 6:08 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
Quote:
Were you have this example source?

1)This code is taken from the chipmunk-physics forum. Posted some guy with a nick slembcke. :)

Thank you. Somehow I figured out that code.
2) There were link errors due to cpfabs, cpfmax, cpfmin - had to throw them away. :)
3)In general, it seems I am close to completing a wrapper for your wrapper. :)

1) There is a lot of such examples on the Chipmunk forum. I do not knowing all.
2) Polink errors?
3) Fine. You are not alone ;-)

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 6:45 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
Quote:
Fine. You are not alone
And who else mpz?
I'm writing it for my little game, so it will not be universal.

Quote:
Polink errors?

POLINK: error Unresolved external symbol 'cpfabs@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmax@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmin@@YANN@Z'

Add
Test program today, changed all the settings. The slowdown started after 1000 (small) objects, that I was not happy. Hoped for more. In connection with the question: cpSpaceResizeActiveHash shure works? I tried different settings, even removed it, no effect.

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 11:31 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
Quote:
Fine. You are not alone
And who else mpz?
I'm writing it for my little game, so it will not be universal.

Quote:
Polink errors?

POLINK: error Unresolved external symbol 'cpfabs@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmax@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmin@@YANN@Z'

Add
Test program today, changed all the settings. The slowdown started after 1000 (small) objects, that I was not happy. Hoped for more. In connection with the question: cpSpaceResizeActiveHash shure works? I tried different settings, even removed it, no effect.

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Tue Aug 30, 2011 11:32 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
Quote:
Fine. You are not alone
And who else mpz?
I'm writing it for my little game, so it will not be universal.

Quote:
Polink errors?

POLINK: error Unresolved external symbol 'cpfabs@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmax@@YANN@Z'
POLINK: error Unresolved external symbol 'cpfmin@@YANN@Z'

Add
Test program today, changed all the settings. The slowdown started after 1000 (small) objects, that I was not happy. Hoped for more. In connection with the question: cpSpaceResizeActiveHash shure works? I tried different settings, even removed it, no effect.

Post your code and I can say more

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Wed Aug 31, 2011 1:33 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
Quote:
Post your code and I can say more

It will be difficult. But I tried the example that you put a wrapper, Chipmunk4PB_Demo.pb- there exact same situation.
I do not see any difference with or without cpSpaceResizeActiveHash.

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Wed Aug 31, 2011 9:46 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
Maybe this answer is the right for you:
http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=1485&p=6887&hilit=cpSpaceResizeActiveHash#p6887

Question about Chipmunk functions should be be better ask on the Chipmunk board ;-)

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Wed Aug 31, 2011 2:44 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
The point is that I first looked at the forum and judging by the posts it works for them. Change the settings have a visible effect, but I do not have any effect, even if I delete the hash command.

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Thu Oct 06, 2011 7:37 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
After a long break, I returned to Сhipmunk:

http://www.youtube.com/watch?v=Xr-CicRCmKs

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Thu Oct 06, 2011 2:49 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1299
Location: Germany: 49º 45' 21.96" N 10º 38' 4.04" E
AndyLy wrote:
After a long break, I returned to Сhipmunk:

http://www.youtube.com/watch?v=Xr-CicRCmKs

Sweet. But I think it is not using PureBasic. Right?

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
http://chipmunk4purebasic.freeforums.org/index.php


Top
 Profile  
 
 Post subject: Re: Who is also working on a Chipmunk wrapper (2D physic eng
PostPosted: Thu Oct 06, 2011 3:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 11:50 am
Posts: 122
Location: GRI
Quote:
Sweet. But I think it is not using PureBasic. Right?


Why have you decided so? Of course this is PureBasic! Pure PureBasic.

_________________
'Happiness for everybody, free, and no one will go away unsatisfied!'
MP3D video: www.youtube.com/watch?v=HtNN6kWFjsE


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 84 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye