AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
HollowCylinder.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
20
21#include <agx/agx.h>
22#include <agxCollide/Shape.h>
25
26namespace 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
86
91
96
103
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
129 agx::Physics::Geometry::HollowCylinderPtr getEntity() const;
130
133
134 protected:
135
138
140 virtual ~HollowCylinder();
141 };
142
143
144
145
146
147 inline agx::Physics::Geometry::HollowCylinderPtr HollowCylinder::getEntity() const
148 {
149 return m_entity;
150 }
151
152
153 inline agx::Real HollowCylinder::getOuterRadius() const
154 {
155 return getEntity().radius();
156 }
157
158 inline agx::Real HollowCylinder::getInnerRadius() const
159 {
160 return getOuterRadius() - getThickness();
161 }
162
163 inline agx::Real HollowCylinder::getHeight() const
164 {
165 return getEntity().height();
166 }
167
168
169 inline agx::Real HollowCylinder::getThickness() const
170 {
171 return std::min( getEntity().radius(), getEntity().thickness() );
172 }
173}
174
175
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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
#define AGXPHYSICS_EXPORT
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:38
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
A hollow cylinder shape for geometric intersection tests.
void setThickness(agx::Real t)
Sets the thickness for the hollow cylinder.
virtual agx::Vec3 getSupportPoint(const agx::Vec3 &supportDirection) const override
Returns the support point on face of the shape.
void set(agx::Real radius, agx::Real height, agx::Real thickness)
Sets all parameters for the hollow cylinder.
virtual const BoundingAABB & updateBoundingVolume() override
Calculate the bounding volume based on the current Shape parameters including transformation.
agx::SPDMatrix3x3 calculateInertia(agx::Real mass) const override
Calculate the inertia of the HollowCylinder.
void setHeight(agx::Real h)
Sets the height for the hollow cylinder.
virtual Shape * clone() const override
Create a clone.
void setInnerRadius(agx::Real r)
Sets the inner radius for the hollow cylinder.
virtual bool hasSupportFunction() const override
void setOuterRadius(agx::Real r)
Sets the outer radius for the hollow cylinder.
virtual agx::Real getVolume() const override
Calculate the volume of this cylinder.
virtual BoundingAABB calculateLocalBound() const override
Calculate the bounding volume in the local coordinate system.
HollowCylinder(agx::Real innerRadius, agx::Real height, agx::Real thickness)
Creates a hollow cylinder.
Base class for a shape.
Definition: Shape.h:58
Specialized type of matrices for holding symmetric positive definite matrices.
Definition: SPDMatrix3x3.h:48
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41