Gazebo Math

API Reference

9.0.0
Ellipsoid.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17#ifndef GZ_MATH_ELLIPSOID_HH_
18#define GZ_MATH_ELLIPSOID_HH_
19
20#include <optional>
22#include "gz/math/Material.hh"
23#include "gz/math/Plane.hh"
24
25namespace gz::math
26{
27 // Inline bracket to help doxygen filtering.
28 inline namespace GZ_MATH_VERSION_NAMESPACE {
29 //
37 template<typename Precision>
39 {
42 public: Ellipsoid() = default;
43
46 public: explicit Ellipsoid(const Vector3<Precision> &_radii);
47
52 const Material &_mat);
53
56 public: Vector3<Precision> Radii() const;
57
60 public: void SetRadii(const Vector3<Precision> &_radii);
61
64 public: const Material &Mat() const;
65
68 public: void SetMat(const Material &_mat);
69
76 public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
77
80 public: bool operator==(const Ellipsoid &_ellipsoid) const;
81
84 public: Precision Volume() const;
85
92
100 public: std::optional<Vector3<Precision>>
102
112
125 public: bool SetDensityFromMass(const Precision _mass);
126
129
131 private: Material material;
132 };
133
137
141
145 } // namespace GZ_MATH_VERSION_NAMESPACE
146} // namespace gz::math
147#include "gz/math/detail/Ellipsoid.hh"
148#endif // GZ_MATH_ELLIPSOID_HH_