Gazebo Math

API Reference

9.0.0
Cone.hh
Go to the documentation of this file.
1/*
2 * Copyright 2024 CogniPilot Foundation
3 * Copyright 2024 Open Source Robotics Foundation
4 * Copyright 2024 Rudis Laboratories
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18*/
19#ifndef GZ_MATH_CONE_HH_
20#define GZ_MATH_CONE_HH_
21
22#include <optional>
24#include "gz/math/Material.hh"
25#include "gz/math/Plane.hh"
26#include "gz/math/Quaternion.hh"
27
28namespace gz::math
29{
30 // Forward declarations
31 class ConePrivate;
32
33 // Inline bracket to help doxygen filtering.
34 inline namespace GZ_MATH_VERSION_NAMESPACE {
35 //
45 template<typename Precision>
46 class Cone
47 {
51 public: Cone() = default;
52
58 public: Cone(const Precision _length, const Precision _radius,
61
68 public: Cone(const Precision _length, const Precision _radius,
69 const Material &_mat,
72
75 public: Precision Radius() const;
76
79 public: void SetRadius(const Precision _radius);
80
83 public: Precision Length() const;
84
87 public: void SetLength(const Precision _length);
88
95
103
106 public: const Material &Mat() const;
107
110 public: void SetMat(const Material &_mat);
111
120 public: bool MassMatrix(MassMatrix3d &_massMat) const;
121
128 public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
129
132 public: bool operator==(const Cone &_cone) const;
133
136 public: Precision Volume() const;
137
144
152 public: std::optional<Vector3<Precision>>
154
164
177 public: bool SetDensityFromMass(const Precision _mass);
178
180 private: Precision radius = 0.0;
181
183 private: Precision length = 0.0;
184
186 private: Material material;
187
189 private: Quaternion<Precision> rotOffset =
191 };
192
196
200
204 } // namespace GZ_MATH_VERSION_NAMESPACE
205} // namespace gz::math
206#include "gz/math/detail/Cone.hh"
207#endif // GZ_MATH_CONE_HH_