Physics with irregular objects.

New releases and general discussions.

Post » Tue Oct 07, 2008 4:49 pm

[quote="Cheez":rpt6xbib]For one, the custom mask is already very frustrating to use, not the least of the reasons being that I can't edit it afterwards[/quote:rpt6xbib]
Agree. David said in his original implementation that he would expand on it in the near future to properly be able to select and move around points; it is very limited at the moment, but decidedly better than not having a custom collision mask at all. It's definitely unfinished though.

[quote:rpt6xbib]if an object happens to have a quarter circle in it or something along those lines, what do I do about that?[/quote:rpt6xbib]
Approximate it with a series of straight lines. Seriously, as far as I know, all commercial games also do this. A true curve is a rare thing to come by in computing simulation - as Arima said, they're faked. The physics interactions of a surface approximated by straight lines should be comparable to if it were a true surface. The more lines you use the more accurate it will be, but the more CPU it will use.

Also, Box2D physics (the engine behind the Physics behavior) doesn't support curves anyway. So we're stuck there!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Oct 07, 2008 6:02 pm

[quote="Ashley":u6qynu00]Approximate it with a series of straight lines.[/quote:u6qynu00] I never said it had to be a true curve.

Since we're now talking about using straight lines anyway, why not include that type of option? I used to mess around with a Doom level editor that could take a line and curve it with an adjustable amount of precision by adding extra vertices equally along the line. Would it be too much to eventually add a feature to approximate a curve of one's choice automatically? By hand it's doable, but for the sake of accuracy there should be an option like that in the end... Maybe even an option to approximate the outline of an object as my original concern was?

And one last thing while i'm posting this: Can a hollow object be made, either now or eventually, using these custom masks? This isn't anything that would be of use to me, but I may as well ask.
B
2
G
4
Posts: 29
Reputation: 1,108

Post » Wed Oct 08, 2008 8:19 am

Box2d allows you to have collision shapes that are made up of multiple polygons, so eventually I'll impliment custom collisions so that you can add points inbetween points, start a new shape, possible subtract one shape from another to make hollow objects etc. As It stands, if you need to make a hollow object you'll need to make a small gap in one of the faces. As for curves the only type of curve box2d supports is a regular circle....any other type of implimentation would have to be by approximating a curve with straight lines and that kind of maths escapes me. Besides I find zooming in on my sprites and placing points around perfectly adiquate. Finally I'd like to remind you that Construct is free...I mean its not like we've charged you $300 and expect you to type in the co-ordinates of each point manually via actions :P
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Wed Oct 08, 2008 8:24 am

While we're on the subject of collision masks, I'm sure i've said this before but haven't got feedback
David, surely you're aware that at the moment, the ellipse collision mask draws a perfect circle rather than an ellipse with the dimensions of the sprite right? is that going to be fixed?
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Wed Oct 08, 2008 8:27 am

Yeah...box 2d doesn't support ellipses....I could approximate it with a circle made out of polygons...how many points do you think I should use? I decided 32 because thats how many ends are on the London Eye :P

Edit : Ellipses now work yay!
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Wed Oct 08, 2008 9:07 am

I dunno what that is but it works for me :D
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest