StateAccessor is supposed to compute its bbox directly from the state it relies on.
The (good) whole idea is to avoid
- duplicating code
- compute a bbox from the same positions a multiple times.
For example a node containing a Mechanical State, a Mass (implementing StateAccessor) and a Forcefield (implementing StateAccessor) just need to compute the bbox from the positions of the Mechanical State itself.
The problem is that for now, the only usable Mechanical State, MechanicalObject, computes its Bounding Box only if it is supposed to be rendered (having its data showObject set to true)
|
if( onlyVisible && !showObject.getValue() ) return; |
So effectively all the components implementing StateAccessor and not overriding the computeBBox() do not compute their bounding box (except if the linked mechanical object is drawn), like for example the family of components FEMForcefield.
StateAccessor is supposed to compute its bbox directly from the state it relies on.
The (good) whole idea is to avoid
For example a node containing a Mechanical State, a Mass (implementing StateAccessor) and a Forcefield (implementing StateAccessor) just need to compute the bbox from the positions of the Mechanical State itself.
The problem is that for now, the only usable Mechanical State, MechanicalObject, computes its Bounding Box only if it is supposed to be rendered (having its data
showObjectset to true)sofa/Sofa/Component/StateContainer/src/sofa/component/statecontainer/MechanicalObject.inl
Line 2799 in 912335e
So effectively all the components implementing StateAccessor and not overriding the computeBBox() do not compute their bounding box (except if the linked mechanical object is drawn), like for example the family of components FEMForcefield.