cyanskies / hades

A 2d game framework
1 stars 0 forks source link

Collision system #15

Open cyanskies opened 7 years ago

cyanskies commented 7 years ago

A collision base type, with support for comparing any of the the child types.

Axis aligned Rect, Circle, Point

collision_test(returns true if intersecting):

collision_move(returns a vector pointing from the objects current position, to it's final position, this includes allowing the object to use up remaining move by sliding along no-colliding directions):

safe_move(returns the largest non-intersecting move):

collision_normal(returns the normal vector of a move that would result in a collision):

cyanskies commented 7 years ago

Interesting collision tips:

Link to the past gave link two dud 'feeler' entities in front of him, one on his left side, and one on his right. if only one feeler was colliding with an object, then link would slide towards the free one giving the illusion of rounded edges to objects.

cyanskies commented 7 years ago

resources for multi point collision systems

http://info.sonicretro.org/SPG:Solid_Tiles https://gamedev.stackexchange.com/questions/25872/sidescroller-variable-terrain-heightmap-for-walking-collision/25876#25876

cyanskies commented 4 years ago

multipoint can be done by using the smallest move generated by a collection of points.

added checkboxes for each of the functions to better visualise progress on this issue.

cyanskies commented 7 months ago

Rather than solve this problem ourselves, we should look towards https://github.com/OneLoneCoder/olcUTIL_Geometry2D