AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
HollowCone.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
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
113
114
120
128 void set( agx::Real topOutsideRadius, agx::Real bottomOutsideRadius, agx::Real height, agx::Real thickness );
129
134
139
143 void setHeight( agx::Real height );
144
148 void setThickness( agx::Real thickness );
149
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
175 agx::Physics::Geometry::HollowConePtr getEntity() const;
176
179
180 protected:
181
184
186 virtual ~HollowCone();
187 };
188
189
190
191
192
193 inline agx::Physics::Geometry::HollowConePtr HollowCone::getEntity() const
194 {
195 return m_entity;
196 }
197
198
199 inline agx::Real HollowCone::getTopOuterRadius() const
200 {
201 return getEntity().topRadius();
202 }
203
204 inline agx::Real HollowCone::getBottomOuterRadius() const
205 {
206 return getEntity().bottomRadius();
207 }
208
209
210 inline agx::Real HollowCone::getBottomInnerRadius() const
211 {
212 return getBottomOuterRadius() - getThickness();
213 }
214
215 inline agx::Real HollowCone::getHeight() const
216 {
217 return getEntity().height();
218 }
219
220 inline agx::Real HollowCone::getThickness() const
221 {
222 return std::min( getEntity().bottomRadius(), getEntity().thickness() );
223 }
224
225}
#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 right circular hollow cone shape for geometric intersection tests.
Definition: HollowCone.h:46
void set(agx::Real topOutsideRadius, agx::Real bottomOutsideRadius, agx::Real height, agx::Real thickness)
Sets all parameters for the hollow cone.
HollowCone(agx::Real topInnerRadius, agx::Real bottomInnerRadius, agx::Real innerHeight, agx::Real outerHeight, agx::Real thickness)
Creates a Hollow Cone based upon inner radiuses (hole size) and thickness.
void setThickness(agx::Real thickness)
Sets the thickness for the hollow cone.
virtual Shape * clone() const override
Create a clone.
void setHeight(agx::Real height)
Sets the height for the hollow cone.
virtual agx::Vec3 getSupportPoint(const agx::Vec3 &supportDirection) const override
Returns the support point on face of the shape.
void setTopOuterRadius(agx::Real r)
Sets the top radius for the hollow cone.
HollowCone(agx::Real topOuterRadius, agx::Real bottomOuterRadius, agx::Real outerHeight, agx::Real thickness)
Creates a Hollow Cone based upon outside cone measurements and thickness to get a hollow inside.
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 HollowCone.
virtual bool hasSupportFunction() const override
virtual agx::Real getVolume() const override
Calculate the volume of this cylinder.
agx::Real getTruncatedHeight() const
Returns the height of the truncated part.
agx::Real getAngle() const
Returns the angle between the cone axis and side.
virtual BoundingAABB calculateLocalBound() const override
Calculate the bounding volume in the local coordinate system.
void setBottomOuterRadius(agx::Real r)
Sets the bottom radius for the hollow cone.
virtual agx::Vec3 getCenter() const override
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