[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Mon Nov 20, 2017 1:53 pm

hi , have chipmunk grabling hook tutorial or exaple capax ?
B
16
S
5
Posts: 23
Reputation: 1,120

Post » Tue Dec 12, 2017 5:26 am

Any future plans to port the Plugin over Construct 3? This would be freaking awesome! Because the standard box2d Plugin has some performance laggs
B
17
S
9
G
2
Posts: 42
Reputation: 2,589

Post » Tue Dec 12, 2017 7:41 am

Xh3maa wrote:Any future plans to port the Plugin over Construct 3? This would be freaking awesome! Because the standard box2d Plugin has some performance laggs


If you read the thread 2 pages back - you will see the following post from R0J0hound that states he has no plans to convert to C3: https://www.scirra.com/forum/behavior-chipmunk-physics_p1136595?&sid=1aa581358862d0efd568915895ec0b14&sid=5ad861a2a0f2991e7b053c091fb3ed82#p1136595.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
145
S
33
G
89
Posts: 5,909
Reputation: 62,581

Post » Thu Dec 14, 2017 11:37 am

Can someone help me with collision layers? I cant get it to work. I know how it works with groups. But i need that two objects in one Layer would collide together, but both objects are attached on one object and they are all in one collision group
B
17
S
9
G
2
Posts: 42
Reputation: 2,589

Post » Thu Jan 04, 2018 11:39 pm

I know this has already been asked (With no response as far as I can see.) but how the hell do you use the collision layers? The tip it gives "If two objects with this bitwise anded together is non zero, they can collide." makes no sense to me. PLEASE HELP!!!
B
25
S
4
Posts: 74
Reputation: 1,346

Post » Fri Jan 05, 2018 1:33 am

If you think of the layer property as binary you have 8 separate layers. The objects can be in all the layers or even a few of them. For example “11111111” would be all the layers, “00000001” would only be the first one, and “01010101” would be every other layer. Anyways any two objects will collide only if they share a layer. For example an object in layers “00001111” will collide with an object in layers “00000001” because they are both in the first layer. Whereas an object in layers “11110000” won’t collide with an object in layers “00001111” because they have no layers in common.

You can also look at the chipmunk documentation linked in the first page for another explanation. You actually have 32 layers if you treat layers as hexadecimal.
“Bit wise and” is a way to check if two numbers have bits in common.
B
100
S
38
G
134
Posts: 5,554
Reputation: 85,321

Post » Tue Apr 03, 2018 10:10 pm

Hi, @R0J0hound
I am trying to make my own ragdoll system with your physic and Spriter. My problem:
when I spawn physics sprites, it inherit angles of spriter animation. So, for example: head has 3 degrees and body has 355 degrees. I connected it with piviot joint which is works nice, and rotary limit joint (limits: -50 and 50), which brake everything, because the limits between 355(body) and 3(head) too big for chipmunk math(but we understand it just 8 degrees). meanwhile if I turn a bit the spriter animation, and body becames 5 degrees and 13 for head, all works ok.
Any idea?
B
12
S
1
Posts: 18
Reputation: 538

Post » Fri Apr 13, 2018 6:45 pm

When I check the collision layer expression, it gives an odd number.. how do I translate it to the 00000000 format?

for example I get 268435456 but I need it to read 10000000 (the layer it is set at)

nvmind.. I'm implementing an expression into my own plugin that will do this.. i found way to convert using javascript
B
51
S
24
G
70
Posts: 1,196
Reputation: 41,370

Post » Fri Apr 20, 2018 5:25 pm

Hello R0J0hound - I am attempting the old chestnut "Weld two objects together so they act like one object".
While I think it can be achieved using joints this seems unnecessarily inefficient.
I noticed in the Chipmunk documentation - "You can attach as many shapes to a single body as you need to in order to define a complex shape." - this seems much more like what I want.
Is there any way of doing this with your plug-in?
I suspect the answer is No given the constraints of how Construct 2 works, in which case what joint do you think might be the least inefficient way to achieve this?
Cheers,
RR
MY GAMES
INCOMING Classic missile base commander game:
https://www.scirra.com/arcade/action-games/incoming-20122
(Touch control or Mouse supported)

"Down", minimal gravity platformer:
https://www.scirra.com/arcade/puzzle-games/down-1276
B
20
S
5
Posts: 36
Reputation: 2,581

Post » Fri Apr 20, 2018 9:02 pm

@RattyRat
You can't do that with the plugin, and modifying it to do so will have lots of caveats. The idea came up when I was making the behavior but I opted for making things easier to use. It's something best served by a ground up re-write and re-design of how it deals with the js library. I'm not really modifying or creating plugins or behaviors lately though. Lots of work for little gain imo. I have other more entertaining and interesting projects i'd want to do first, but if those succeed I may not be back.

Anyways, the behavior manages the conversion of c2 coordinants to chipmunk coordinants, and vise versa. The complication is c2 uses the origin as the object center and chipmunk uses the center of mass (COM). To have multiple objects welded together they'd have a shared COM, and it would have to be updated every time things are moved with anything but the physics engine. There are other properties that would need to be updated as well. At least that's my thought.

-cheers
B
100
S
38
G
134
Posts: 5,554
Reputation: 85,321

Previous

Return to Completed Addons

Who is online

Users browsing this forum: DroidDev, Rafison, repkino and 0 guests