Perfect Collision mask for physics?

New releases and general discussions.

Post » Tue Apr 15, 2008 10:57 pm

Yeah you could do it by compositing convex polygons, but not a single concave polygon on its own. I don't think Ellipse in the physics engine uses vertices at all, I suspect it's a custom algorithm, since there are probably specific equations for perfectly round objects.

The reason is (not that I'm an expert) that it's much harder to write an efficient collision detection engine if you can't guarantee a convex polygon. I'm not sure the specifics why. I think it also applies to a dynamic shadows engine, but I'm not sure.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Apr 15, 2008 11:01 pm

[quote="deadeye":16y2kfjp]
I've tried that already, with very poor results. The physics simulation gets hung up on the corners where objects overlap and causes unexpected behavior. Play around with it yourself, you'll see what I mean.[/quote:16y2kfjp]

But i meant more like something built in to construct in the future. You place a few physics objects in the shape you want, and then you click "merge" and they all fuse together into one object. They would still be separate objects thoug, just stuck together perfectly.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Apr 15, 2008 11:19 pm

[quote="Ashley":1o65s6rr]Yeah you could do it by compositing convex polygons, but not a single concave polygon on its own. I don't think Ellipse in the physics engine uses vertices at all, I suspect it's a custom algorithm, since there are probably specific equations for perfectly round objects.

The reason is (not that I'm an expert) that it's much harder to write an efficient collision detection engine if you can't guarantee a convex polygon. I'm not sure the specifics why. I think it also applies to a dynamic shadows engine, but I'm not sure.[/quote:1o65s6rr]

Perhaps what's needed is an algorithm to automagically convert complex polys to tris, the way 3D modelling programs do:



Programs like Max and Maya let you make crazy n-sided polygons, but blow the surface it's all converted to triangles.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Apr 16, 2008 6:10 pm

Using a full 3D physics/graphics engine, I suspect, would make the creation of a 2D game much simpler. I think the focus is to remain 2D, for... speed? I don't know. Though, if I programmed a platformer today, from scratch, not being a programmer, I would use polygons and meshes of them to organize all information.

It would just be... 2.5D, or whatever you call it, for simplicity's sake. The playing field entirely 2D, game environment, collision stuff and appearance somewhere in between. SSB style.
B
4
S
2
G
6
Posts: 161
Reputation: 2,597

Post » Wed Apr 16, 2008 6:27 pm

Havok is free. Dunno how easy it's be to use though.
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Wed Apr 16, 2008 6:58 pm

And ODE is open-source. But, these are future things, if ever, from the looks of it.
B
4
S
2
G
6
Posts: 161
Reputation: 2,597

Post » Sat Apr 19, 2008 8:29 pm

I suppose that Ashley could rename the current Physics behavior to Newton Physics Dynamics and try to implement other engines for 1.0.
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Mon Apr 21, 2008 4:24 pm

Or just replace this current one with an implementation of something made for 2D physics rather than 3D. I believe that in a past discussion on the topic, one 'Chipmunk' was brought up - I meant to look into it but never got around to it. If and/or when Construct gains more 3D capacities, NGD would be a good idea but right now a more concentrated-purpose behavior is needed (wanted).
B
3
S
2
G
4
Posts: 130
Reputation: 1,735

Post » Mon Apr 21, 2008 6:52 pm

What about Box2d?
[url:13mt16jq]http://www.box2d.org/[/url:13mt16jq]
B
21
S
14
G
5
Posts: 106
Reputation: 3,416

Post » Mon Apr 21, 2008 6:56 pm

[quote="yankeesbro":3dyi2598]What about Box2d?
[url:3dyi2598]http://www.box2d.org/[/url:3dyi2598][/quote:3dyi2598]
Dont have pixel collision
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests