AGX Dynamics  2.37.2.0
HollowCone.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/agxPhysics_export.h>
20 
21 #include <agx/agx.h>
22 #include <agxCollide/Shape.h>
24 #include <agxStream/Serializable.h>
25 
26 namespace agxCollide
27 {
28 
30 
46  {
47  public:
64  HollowCone( agx::Real topInnerRadius, agx::Real bottomInnerRadius, agx::Real innerHeight, agx::Real outerHeight, agx::Real thickness );
65 
66 
80  HollowCone( agx::Real topOuterRadius, agx::Real bottomOuterRadius, agx::Real outerHeight, agx::Real thickness );
81 
82 
86  agx::Real getTopOuterRadius() const;
87 
91  agx::Real getBottomOuterRadius() const;
92 
96  agx::Real getBottomInnerRadius() const;
97 
101  agx::Real getHeight() const;
102 
106  agx::Real getThickness() const;
107 
112  agx::Real getTruncatedHeight() const;
113 
114 
119  agx::Real getAngle() const;
120 
128  void set( agx::Real topOutsideRadius, agx::Real bottomOutsideRadius, agx::Real height, agx::Real thickness );
129 
133  void setTopOuterRadius( agx::Real r );
134 
138  void setBottomOuterRadius( agx::Real r );
139 
143  void setHeight( agx::Real height );
144 
148  void setThickness( agx::Real thickness );
149 
154  agx::SPDMatrix3x3 calculateInertia(agx::Real mass) const override;
155 
160  virtual agx::Real getVolume() const override;
161 
162  virtual agx::Vec3 getCenter() const override;
163 
164  virtual bool hasSupportFunction() const override;
165 
166  virtual Shape *clone() const override;
167 
168  virtual agx::Vec3 getSupportPoint( const agx::Vec3& supportDirection ) const override;
169 
170  virtual const BoundingAABB& updateBoundingVolume() override;
171 
172  virtual BoundingAABB calculateLocalBound() const override;
173 
176 
179 
180  protected:
181 
183  HollowCone();
184 
186  virtual ~HollowCone();
187  };
188 
189 
190 
191 
192 
194  {
195  return m_entity;
196  }
197 
198 
200  {
201  return getEntity().topRadius();
202  }
203 
205  {
206  return getEntity().bottomRadius();
207  }
208 
209 
211  {
212  return getBottomOuterRadius() - getThickness();
213  }
214 
216  {
217  return getEntity().height();
218  }
219 
221  {
222  return std::min( getEntity().bottomRadius(), getEntity().thickness() );
223  }
224 
225 }
A right circular hollow cone shape for geometric intersection tests.
Definition: HollowCone.h:45
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:861
Base class for a shape.
Definition: Shape.h:53
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXPHYSICS_EXPORT
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
agx::Real getTopOuterRadius() const
Definition: HollowCone.h:199
Pointer to a entity instance of type Physics.Geometry.HollowCone.
Specialized type of matrices for holding symmetric positive definite matrices.
Definition: SPDMatrix3x3.h:48
agx::Physics::Geometry::ShapePtr getEntity() const
Definition: Shape.h:396
agx::Real getBottomOuterRadius() const
Definition: HollowCone.h:204
agx::Real getThickness() const
Definition: HollowCone.h:220
agx::Real getHeight() const
Definition: HollowCone.h:215
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
agx::Real getBottomInnerRadius() const
Definition: HollowCone.h:210
double Real
Definition: Real.h:42
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:37
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
AGX_DECLARE_POINTER_TYPES(SpaceListener)
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.