17 #ifndef GZ_RENDERING_BASE_BASEARROWVISUAL_HH_
18 #define GZ_RENDERING_BASE_BASEARROWVISUAL_HH_
22 #include <gz/common/MeshManager.hh>
31 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
45 protected:
virtual void Destroy()
override;
69 protected:
virtual void Init()
override;
72 protected:
bool rotationVisible =
false;
91 while (this->ChildCount() > 0u)
93 auto visual = std::dynamic_pointer_cast<Visual>(this->ChildByIndex(0));
106 return std::dynamic_pointer_cast<Visual>(this->ChildByIndex(0));
113 return std::dynamic_pointer_cast<Visual>(this->ChildByIndex(1));
120 return std::dynamic_pointer_cast<Visual>(this->ChildByIndex(2));
127 this->Head()->SetVisible(_b);
134 this->Shaft()->SetVisible(_b);
141 this->Rotation()->SetVisible(_b);
148 T::SetVisible(_visible);
154 this->Rotation()->SetVisible(this->rotationVisible && _visible);
164 cone->AddGeometry(this->
Scene()->CreateCone());
165 cone->SetOrigin(0, 0, -0.5);
166 cone->SetLocalPosition(0, 0, 0);
167 cone->SetLocalScale(0.1, 0.1, 0.25);
168 this->AddChild(cone);
171 cylinder->AddGeometry(this->
Scene()->CreateCylinder());
172 cylinder->SetOrigin(0, 0, 0.5);
173 cylinder->SetLocalPosition(0, 0, 0);
174 cylinder->SetLocalScale(0.05, 0.05, 0.5);
175 this->AddChild(cylinder);
179 if (!meshMgr->
HasMesh(rotMeshName))
180 meshMgr->
CreateTube(rotMeshName, 0.070f, 0.075f, 0.01f, 1, 32);
183 rotationVis->AddGeometry(this->
Scene()->CreateMesh(rotMeshName));
184 rotationVis->SetOrigin(0, 0, -0.125);
185 rotationVis->SetLocalPosition(0, 0, 0);
186 rotationVis->SetVisible(this->rotationVisible);
187 this->AddChild(rotationVis);
189 this->SetOrigin(0, 0, -0.5);