Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKrohm

Posted 31 May 2013 - 02:50 AM

Of course one is left wondering what "exact time of impact" means since timing is one of the first monumental issues to solve when dealing with realtime physics. We could go on noticing we're talking about a logic-controlled object for which standard physics often has limited meaning. Or ask ourselves what "really correct physics" even is. And what about accurate computing on FPU?

 

Personally I'm bold on this topic. All those dudes telling you can do physics yourself (especially by doing canonical math) are doing a disservice to the community.

 

The problem OP notes is a clear demonstration of how canonical math work. Let me show you visually what happens:

[attachment=16042:2013-05-31 10_27_08-Greenshot.png]

The small box here is being pulled to the mouse pointer. Small box upper left corner, when unconstrained will match cursor hotspot.

Expected behaviour: slide to a nerby position (probably on right box lower edge).

What happens: got stuck over the corner between the two boxes to the left (as shown).

Observation: as soon as the pointer moves down a few pixels, crossing right box bounduary, the small box is able to reach the cursor.

 

This behaviour is mathematically sound and correct to a certain degree. How exactly doing more accurate math solves the problem is unclear to me.

What a physics library would do at this point is to put aside the math for a second and consider the two collision primitives are really meant to be contiguous and filter collision accordingly. This does not always work however. That's an indication on how difficult this problem is.

 

So my suggestion is: screw all that. Get some physics library you can use in flash and leverage the effort of someone focusing to this problem specifically. BTW, I've been told flash is going to have rough times ahead.

But supposing you cannot do that, I'd get the hit, and check all other collision primitives for being nearby the one I hit and if a match is found, ignore the collision.

Hopefully this will allow the box to slide a few frames and, provided your de-encroaching works it will be correctly pulled "down" and there should be no problem from now on.


#1Krohm

Posted 31 May 2013 - 02:47 AM

Of course one is left wondering what "exact time of impact" means since timing is one of the first monumental issues to solve when dealing with realtime physics. We could go on noticing we're talking about a logic-controlled object for which standard physics often has limited meaning. Or ask ourselves what "really correct physics" even is. And what about accurate computing on FPU?

 

Personally I'm bold on this topic. All those dudes telling you can do physics yourself (especially by doing canonical math) are doing a disservice to the community.

 

The problem OP notes is a clear demonstration of how canonical math work. Let me show you visually what happens:

[attachment=16042:2013-05-31 10_27_08-Greenshot.png]

The small box here is being pulled to the mouse pointer. Small box upper left corner, when unconstrained will match cursor hotspot.

Expected behaviour: slide to a nerby position (probably on right box lower edge).

What happens: got stuck over the corner between the two boxes to the left (as shown).

Observation: as soon as the pointer moves down a few pixels, crossing right box bounduary, the small box is able to reach the cursor.

 

This behaviour is mathematically sound and correct to a certain degree. How exactly doing more accurate math solves the problem is unclear to me.

What a physics library would do at this point is to put aside the math for a second and consider the two collision primitives are really meant to be contiguous and filter collision accordingly. This does not always work however. That's an indication on how difficult this problem is.

 

So my suggestion is: screw all that. Get some physics library you can use in flash and leverage the effort of someone focusing to this problem specifically. BTW, I've been told flash is going to have rough times ahead.


PARTNERS