Skip to content

[GPU] Considering abstraction of PreCollisionInteractor and init() method

follow-up for #179 (closed), which is closed by !384 (merged):

  1. what was true for free() is also true for init(). Wouldn't it be cooler if the object was already fully valid when it was created? Because what happens if someone creates the object and forgets to call init() manually? The program will crash when the object is deleted.
  2. I was wondering why simulation or parameter knows at all about probes and actuators. It's just the name of the variable, but it's actually all from type PreCollisionInteractor. So why can't we just have one list of PreCollisionInteractor? And then in UpdateGrid27::updateGrid() there is a interactWithProbes() and interactWithActuators(). Again we are breaking the abstraction. We are dealing with preCollisionsInteractors and should not know about probes and actuators. The problem here seems to be that interact is called once before the first collision and once after. If this has to be the case, is it perhaps not correct that probes and actuators have the same abstraction?