REFAC: Remove PbdObject, replace with PbdMethod behaviour
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:
- More consistent use of
initialize()
virtual function throughoutCollisionInteraction
andCollisionHandling
classes. - 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 overrideninitialize()
function which will also first call itsParent::initialize()
. - Constructors of concrete classes take concrete
Component
andBehaviour
types as input rather than genericEntity
, while the parent/more abstract classes likeCollisionInteraction
andCollisionHandling
will continue to takeEntity
as input. The initialization step should validate all input and fetch all needed components beforehand to avoiddynamic_casting
(as much as possible) andgetComponent
calls inside the simulation loop. - I have also attempted to slim-down the parent classes that are supposedly abstract but still have functions/implementations scattered across the class hierarchy.
- 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. - Use of
IMSTK_TYPE_NAME
throughout allComponent
andSceneBehaviour
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