Open cyanskies opened 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.
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
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.
Rather than solve this problem ourselves, we should look towards https://github.com/OneLoneCoder/olcUTIL_Geometry2D
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):