AGXDynamics  2.35.0.3
HollowCylinder.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
45  {
46  public:
47 
51  HollowCylinder( agx::Real innerRadius, agx::Real height, agx::Real thickness );
52 
56  agx::Real getOuterRadius() const;
57 
61  agx::Real getInnerRadius() const;
62 
66  agx::Real getHeight() const;
67 
71  agx::Real getThickness() const;
72 
73 
80  void set( agx::Real radius, agx::Real height, agx::Real thickness );
81 
85  void setOuterRadius( agx::Real r );
86 
90  void setInnerRadius( agx::Real r );
91 
95  void setHeight( agx::Real h );
96 
102  void setThickness( agx::Real t );
103 
108  agx::SPDMatrix3x3 calculateInertia(agx::Real mass) const override;
109 
114  virtual agx::Real getVolume() const override;
115 
116  virtual bool hasSupportFunction() const override;
117 
118  virtual Shape *clone() const override;
119 
120  virtual agx::Vec3 getSupportPoint( const agx::Vec3& supportDirection ) const override;
121 
122  virtual const BoundingAABB& updateBoundingVolume() override;
123 
124  virtual BoundingAABB calculateLocalBound() const override;
125 
126  // static BoundingAABB calculateBound(const agx::AffineMatrix4x4& transform, const agx::Real bottomRadius, const agx::Real height);
127 
130 
133 
134  protected:
135 
137  HollowCylinder();
138 
140  virtual ~HollowCylinder();
141  };
142 
143 
144 
145 
146 
148  {
149  return m_entity;
150  }
151 
152 
154  {
155  return getEntity().radius();
156  }
157 
159  {
160  return getOuterRadius() - getThickness();
161  }
162 
164  {
165  return getEntity().height();
166  }
167 
168 
170  {
171  return std::min( getEntity().radius(), getEntity().thickness() );
172  }
173 }
174 
175 
agxPhysics_export.h
agxCollide::HollowCylinder::getInnerRadius
agx::Real getInnerRadius() const
Definition: HollowCylinder.h:158
Shape.h
agxCollide::HollowCylinder::getHeight
agx::Real getHeight() const
Definition: HollowCylinder.h:163
agx::Real
double Real
Definition: Real.h:42
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxCollide::BoundingAABB
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:37
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agxCollide::Shape::m_entity
agx::Physics::Geometry::ShapeRef m_entity
Definition: Shape.h:266
agxCollide::Shape::getEntity
agx::Physics::Geometry::ShapePtr getEntity() const
Definition: Shape.h:396
agxCollide::HollowCylinder
A hollow cylinder shape for geometric intersection tests.
Definition: HollowCylinder.h:44
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agx::min
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:880
agx::SPDMatrix3x3
Specialized type of matrices for holding symmetric positive definite matrices.
Definition: SPDMatrix3x3.h:48
Serializable.h
agx.h
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::Physics::Geometry::HollowCylinderPtr
Pointer to a entity instance of type Physics.Geometry.HollowCylinder.
Definition: HollowCylinderEntity.h:170
HollowCylinderEntity.h
agxCollide::AGX_DECLARE_POINTER_TYPES
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agxCollide::HollowCylinder::getThickness
agx::Real getThickness() const
Definition: HollowCylinder.h:169
agx::Vec3T< Real >
agxCollide::HollowCylinder::getOuterRadius
agx::Real getOuterRadius() const
Definition: HollowCylinder.h:153
agxData::getEntity
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.