[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Wed Oct 05, 2016 5:42 pm

@statham
I purposely didn't add and conditions to compare expressions of the behavior. You should use system-> compare or pick by comparison with the expression to do it.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Wed Oct 05, 2016 6:49 pm

I wanted to make an object with physical and when stopped, would make an animation
B
13
S
2
Posts: 297
Reputation: 1,717

Post » Thu Oct 06, 2016 5:28 am

@statham
You can still do that as I said.

Add a new condition:
System -> pick by comparison
Select you Sprite as an object type and use the expression Sprite.chipmunk.speed to get the speed.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Wed Oct 19, 2016 7:26 pm

@R0J0hound , I found an issue with the ignore collision stuff.
If physics object uses collision polygon, and sprite is animated, then it won't ignore a collision in cases where you just want to collide when jumping ontop of it. For some reason when a frame changes(even if polygon remains same shape), it collides each time I think, which ends up make it seem like you collide from the top even though you aren't.
Here's a capx: https://1drv.ms/u/s!AhHSZHEulqh_gXKKkewSu_0hXMDg
Any idea on how to get around it? or is this just a limitation we have to deal with?
B
43
S
19
G
65
Posts: 1,101
Reputation: 37,939

Post » Thu Oct 20, 2016 6:10 am

@prominent
I can't open your capx right now but when the animation frame is changed the collision shape is recreated. The only way for it to know if the collision polygons of two different frames are the same is to compare all the points, which may be slower than just recreating it. Also note changing size also causes the collision shape to recreated as well.

So to the physics engine it's a new shape, so it causes a new collision. I guess a workaround in the plugin would be to modify the collision shape instead of recreating it, but there are many caveats with that, and that's something that's absent from the chipmunk documentation so it's not really something it was designed to do.

Anyways the solution is to not change the frame on physics objects. If you want to change appearance, use a seperate object.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Thu Oct 20, 2016 8:29 am

thanks for the info- makes sense. I'll use a separate object.
B
43
S
19
G
65
Posts: 1,101
Reputation: 37,939

Post » Sat Nov 05, 2016 5:36 am

Message: SuperSushi can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
@R0J0hound
Hi, thank you for this powerfull tool!
I have impluse at angle with box2d Physic working perfectly on my game. Calculate on a distance between the ball and my charactere (like Angry Bird but at 360°)

I tried to apply impulse at angle with Chipmunk but i can not find how to make it.
I don't understand where i'am wrong... any idea ?

Images:
https://www.dropbox.com/s/r718iqysbfqif4y/1.jpg?dl=0
https://www.dropbox.com/s/zb9h6osbguhfphn/3.jpg?dl=0
https://www.dropbox.com/s/yxpvze70ymzmawv/2.jpg?dl=0
B
21
S
3
Posts: 2
Reputation: 931

Post » Sat Nov 05, 2016 8:36 am

@SuperSushi
In you second image change the top "rect" to "polar"

Rect lets you give a X and y impulse
And polar lets you set an angle and direction like the physics action you used in the first image.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Mon Nov 07, 2016 1:27 am

@R0J0hound
Yes, that's it !
Thanks a lot
B
21
S
3
Posts: 2
Reputation: 931

Post » Fri Dec 09, 2016 12:38 pm

hi thx for this plugin, but can you tell me how I make simple orbit in this plugin? im try to do it with polar orbit but its confusing to place the numbers

how to calculate it for orbit around one other object from other object?
B
2
Posts: 5
Reputation: 160

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest