Skip to content

REFAC: Remove PbdObject, replace with PbdMethod behaviour

Shreeraj Jadhav requested to merge refac/move-PbdObject-to-PbdMethod into ECS_Updates

Brief Description

Remove the PbdObject class and refactor all its functions (including functions inherited from DynamicObject, SceneObject) into a new SceneBehaviour class called PbdMethod.

This PR includes some other changes/fixes such as:

  1. More consistent use of initialize() virtual function throughout CollisionInteraction and CollisionHandling classes.
  2. New macro imstkSetGetMacro to enforce dumb setter getter functions that cannot be modified to add any other behaviour related to initializations. All initializations should happen inside the overriden initialize() function which will also first call its Parent::initialize().
  3. Constructors of concrete classes take concrete Component and Behaviour types as input rather than generic Entity, while the parent/more abstract classes like CollisionInteraction and CollisionHandling will continue to take Entity as input. The initialization step should validate all input and fetch all needed components beforehand to avoid dynamic_casting (as much as possible) and getComponent calls inside the simulation loop.
  4. I have also attempted to slim-down the parent classes that are supposedly abstract but still have functions/implementations scattered across the class hierarchy.
  5. Removed unnecessary Getter functions such as CollisionHandling::getObjectA/B because they are not really needed much and also, these members are often swapped internally, and therefore there is no guarantee which object will be returned by these getter functions.
  6. Use of IMSTK_TYPE_NAME throughout all Component and SceneBehaviour classes.

Also worth noting:

These changes are not yet reflected in the

  • C# Wrappers
  • Benchmarking Tools

Plan is to fix the C# wrappers and benchmarking once most of these ECS changes are settled.

Edited by Shreeraj Jadhav

Merge request reports