File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Sofa/Component/Visual/src/sofa/component/visual Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,22 @@ void VisualMesh::init()
5656 }
5757}
5858
59+ void VisualMesh::computeBBox (const core::ExecParams* exec_params, bool onlyVisible)
60+ {
61+ if (!d_enable.getValue ())
62+ return ;
63+
64+ if (onlyVisible && !sofa::core::visual::VisualParams::defaultInstance ()->displayFlags ().getShowVisualModels ())
65+ return ;
66+
67+ type::BoundingBox bbox;
68+ for (const auto & i : sofa::helper::getReadAccessor (d_position))
69+ {
70+ bbox.include (i);
71+ }
72+ this ->f_bbox .setValue (bbox);
73+ }
74+
5975void VisualMesh::doDrawVisual (const core::visual::VisualParams* vparams)
6076{
6177 auto * drawTool = vparams->drawTool ();
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class VisualMesh : public core::visual::VisualModel
4141 sofa::BaseLink::FLAG_STOREPATH | sofa::BaseLink::FLAG_STRONGLINK> l_topology;
4242
4343 void init () override ;
44+ void computeBBox (const core::ExecParams*, bool onlyVisible) override ;
4445
4546protected:
4647
You can’t perform that action at this time.
0 commit comments