AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
Cone.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
49 {
50 public:
51
55 Cone( agx::Real topRadius, agx::Real bottomRadius, agx::Real height );
56
60 agx::Real getTopRadius() const;
61
65 agx::Real getBottomRadius() const;
66
70 agx::Real getHeight() const;
71
76
77
82
89 void set( agx::Real topRadius, agx::Real bottomRadius, agx::Real height );
90
95
100
104 void setHeight( agx::Real height );
105
111
112
113 virtual agx::Vec3 getCenter() const override;
114
119 virtual agx::Real getVolume() const override;
120
121 virtual bool hasSupportFunction() const override;
122
123 virtual Shape *clone() const override;
124
125 virtual agx::Vec3 getSupportPoint( const agx::Vec3& supportDirection ) const override;
126
127 virtual const BoundingAABB& updateBoundingVolume() override;
128
129 virtual BoundingAABB calculateLocalBound() const override;
130
131
133 agx::Physics::Geometry::ConePtr getEntity() const;
134
137
141 static agx::Real computeTruncatedHeight( agx::Real topRadius, agx::Real bottomRadius, agx::Real height );
142
143 protected:
144
147
149 virtual ~Cone();
150 };
151
152
153
154
155
156 inline agx::Physics::Geometry::ConePtr Cone::getEntity() const
157 {
158 return m_entity;
159 }
160
161
162 inline agx::Real Cone::getTopRadius() const
163 {
164 return getEntity().topRadius();
165 }
166
167 inline agx::Real Cone::getBottomRadius() const
168 {
169 return getEntity().bottomRadius();
170 }
171
172 inline agx::Real Cone::getHeight() const
173 {
174 return getEntity().height();
175 }
176
177
178}
#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
A right circular cone shape for geometric intersection tests.
Definition: Cone.h:49
agx::Real getTruncatedHeight() const
virtual BoundingAABB calculateLocalBound() const override
Calculate the bounding volume in the local coordinate system.
virtual agx::Real getVolume() const override
Calculate the volume of this cylinder.
Cone(agx::Real topRadius, agx::Real bottomRadius, agx::Real height)
Creates a cone.
virtual bool hasSupportFunction() const override
agx::SPDMatrix3x3 calculateInertia(agx::Real mass) const override
Calculate the inertia of the Cone.
virtual const BoundingAABB & updateBoundingVolume() override
Calculate the bounding volume based on the current Shape parameters including transformation.
agx::Real getAngle() const
virtual agx::Vec3 getCenter() const override
virtual agx::Vec3 getSupportPoint(const agx::Vec3 &supportDirection) const override
Returns the support point on face of the shape.
void set(agx::Real topRadius, agx::Real bottomRadius, agx::Real height)
Sets all parameters for the cone.
void setHeight(agx::Real height)
Sets the height of the cone.
void setTopRadius(agx::Real r)
Sets the top radius for the cone.
virtual Shape * clone() const override
Create a clone.
void setBottomRadius(agx::Real r)
Sets the bottom radius for the cone.
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
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