[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Tue Jan 20, 2015 8:58 pm

mattb wrote:By the way Rojo, the raycast query doesn't seem to work if chipmunk is used as a family behavior. Not a big deal but I thought I'd mention it.

That is a big deal if it's true, because families are an important feature. Any more info on this?
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Tue Jan 20, 2015 9:40 pm

Updated to version 1.5
Download in first post.

* Change: Renamed the conditions in the "Query" group to with more intuitive titles.
* Fixed: query conditions now work with families.
* Fixed: some of the query conditions were not working with concave polygons or tilemap.

@mattb
That's a cool example. Also thanks for the family bug report.
@Prominent
It's now fixed.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Jan 20, 2015 10:45 pm

@mattb , seems like the line isn't hitting one of the tiles in the tilemap- looks like a bug. Just tried it with the 1.5 version as well. Seems like it happens when a tile shares a corner with another tile and isn't flush with any other tiles.
My guess is it's due to the way the lines are being generated? I know that you could essentially create lines around each tile, and then if a line overlaps another line in the opposite direction just remove one of them.. Then cycle through all and if one line extends from another line, add the length of one to the other and then delete the shorter one.. In the end, you'd have the lowest number of lines constructing the collisions for the map.

you could probably do the calculation before making the lines too..

edit: actually, you'd remove both lines if they overlap in opposite directions..
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Tue Jan 20, 2015 11:32 pm

You're right, never noticed that. Here's a pic showing a similar thing happening in a different tilemap. It only happens on that one tile - the rest work ok.

tilemap_colls.png


(not a great example, but what happens is the normal arrow sprite hits the tile below the top one)

Btw Prominent, I played some of your game the other day (cool stuff) & have been meaning to give you feedback - will do tomorrow if I have time.
You do not have the required permissions to view the files attached to this post.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Wed Jan 21, 2015 12:58 am

@mattb , thanks!

also, here's a shot of the tile issue- I think this shows what's happening more clearly.

tileissue.jpg
You do not have the required permissions to view the files attached to this post.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Wed Jan 21, 2015 1:53 am

I'll look into it tomorrow, it's probably some typo in my code. I'm guessing the shape for that tile wasn't created. Can a body drop through it?
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Wed Jan 21, 2015 2:59 am

@R0J0hound , appears as if bodies don't drop through.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Wed Jan 21, 2015 9:30 am

@mattb

Hey, thanks for the raycast example.. just what i needed :)

and @R0J0hound thanks for the hard work on Chipmunk especially concave objects :)

Another bug i think unless i am missing something.. the orange box should be connected to the purple box but it is obviously connected to the green one.
You do not have the required permissions to view the files attached to this post.
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Wed Jan 21, 2015 6:58 pm

@spongehammer
When you use "imagepoint" it just takes an imagepoint number. So 1 for the first imagepoint, 2 for the second...
0 currently uses the object's center of mass instead of the origin. The built in physics does this, but I think it may not be very intuitive. Thoughts?

So with "imagepoint" use
1, 0 for the first imagepoint
0, 0 for the center of mass

If you use "layout" you can use:
Sprite.ImagePointX(0), Sprite.ImagePointY(0)
or
Sprite.X, Sprite.Y

@Prominent @mattb
It looks like a bug in the js library itself, so it may take longer for me to debug. If you move the tilemap 1 pixel to the right it works flawlessly, oddly enough.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Wed Jan 21, 2015 7:04 pm

@R0J0hound

Ah ok ,thanks. I suppose it doesnt really matter in the end once you know how it works :)
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests