[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Sun Mar 01, 2015 11:29 am

So much goodness here. Thank you oh great R0j0Hound. If I make what I'm intending to make, you get a BILLION free copies!!
B
39
S
6
G
1
Posts: 306
Reputation: 2,948

Post » Sun Mar 01, 2015 8:51 pm

outside position updating is worst then web.js for collision games (as pool ) nothing much different...

I do not understand.

@damjancd and everyone else with encouraging words to say, Thanks, I'm glad this is useful.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

Post » Mon Mar 02, 2015 5:16 pm

@R0J0hound

I am unsure what the max force for a joint setting is for. If i do a test based on the return of Jointimpulse then i can break the joint when i want, regardless of whether max force is set to infinity or not. Where would i use max force ?

Thanks
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Mon Mar 02, 2015 7:26 pm

@spongehammer
Max force limits the amount of force a joint can exert. One possible use is to limit motor force. Also it can be used for situations where a things bind up. Without a max force the objects can break free at a high rate of speed once they're no longer bound up.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

Post » Mon Mar 02, 2015 10:24 pm

@R0J0hound

Ah thanks :) I will have to mess about with it so really see what it does .
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Tue Mar 03, 2015 6:21 pm

@R0j0hound I may have encountered a bug/feature.... when you have a global sprite with Chipmunk applied to it, it works normally but there is a javascript error generated in case you switch the animation of the sprite ( even if you disable the chipmunk physics and then change the animation, the error continues to be generated ).

Image
B
14
S
3
G
1
Posts: 78
Reputation: 1,037

Post » Thu Mar 05, 2015 11:48 am

@R0J0hound

Hi , there seems to be a bug with the motor joint. See attached capx. For me anything under 50x50px stops rotating almost straight away.
You do not have the required permissions to view the files attached to this post.
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Thu Mar 05, 2015 4:51 pm

I have a random question. Should we be using dt whenever we apply a force? I'm confused if physics is at a fixed timestep. If timestep is 1/30, that means if fps is 60fps, it would update twice per frame(120 physics cycles)? if it is 30fps, it would still update twice per frame(60 physics cycles)?..
hm.. If that's the case, then apply dt to forces is necessary, unless I'm not understanding it correctly.

edit: also, if that's the case, then gravity would change based on fps?
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Thu Mar 05, 2015 7:47 pm

@striimix
I can't reproduce it. Can you provide a capx that gives that error?

@spongehammer
That's just a case of over aggressive sleeping. Disabling sleeping fixes it. Although it is odd that size has anything to do with it.

@Prominent
You shouldn't need to use dt anywhere. A fixed timestep of 1/30 is the timestep used per frame. So if the game is running at 60fps then after 60 frames the physics will be 2 seconds along compared to the actual 1 second.

You can specify a variable timestep but that isn't so good with physics, so a fixed timestep is recommended. The drawback is the physics can run faster/slower depending on the screen refresh rate, aka it's not framerate independent. That said you could detect the fps of the game when it starts and set the timestep based on that.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

Post » Thu Mar 05, 2015 9:10 pm

Sleeping ! i can hear it snoring :) . Thanks :)
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest