OfficerYoda / Fhysics

A Physics simulation
MIT License
0 stars 0 forks source link

Object not inserting into multiple QTNodes #83

Closed OfficerYoda closed 2 weeks ago

OfficerYoda commented 2 weeks ago

When an object is lying on the edge between two nodes it will only be inserted into one. It prefers the nodes in the following order: top left --> top right --> bottom left --> bottom right with it mostly preffering the top left.

OfficerYoda commented 2 weeks ago

It was caused by wrong ordering in of two boolean values. Before:

successfullyInserted = successfullyInserted || child!!.insert(obj)

After:

successfullyInserted = child!!.insert(obj) || successfullyInserted