Darthfett / A-Priori-Physics-System

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.
3 stars 0 forks source link

Resting state/acceleration toggling don't work together #35

Open Darthfett opened 12 years ago

Darthfett commented 12 years ago

With the resting state affecting acceleration, the previous solution to enable/disable a source of acceleration by adding/subtracting a constant vector does not work.

For example, if the player is holding acc-left, and enters the resting state when going up a ramp, acceleration will be incorrect if the player releases acc-left.

Darthfett commented 12 years ago

Right now this is a very hard problem to solve, due to the multiple sources of acceleration, and multiple sources of resting cases. A very common situation, is how to deal with a square object resting upon a flat object -- two points of contact creates two separate events/points in time which need to be resolved correctly.

A simple way to solve the issue would be to simply keep each source of acceleration separate, and re-calculate combined acceleration affected by resting objects. This wouldn't be very efficient, intuitive, and could potentially have issues with scenarios that are not solvable (such as resting against two objects which are squeezing an object together).