Gazebo Math
API Reference
8.3.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-math
include
gz
math
Sphere.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 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_SPHERE_HH_
18
#define GZ_MATH_SPHERE_HH_
19
20
#include <optional>
21
#include "
gz/math/MassMatrix3.hh
"
22
#include "
gz/math/Material.hh
"
23
#include "
gz/math/Quaternion.hh
"
24
#include "
gz/math/Plane.hh
"
25
26
namespace
gz::math
27
{
28
// Inline bracket to help doxygen filtering.
29
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
30
//
41
template
<
typename
Precision>
42
class
Sphere
43
{
45
public
:
Sphere
() =
default
;
46
49
public
:
explicit
Sphere
(
const
Precision
_radius
);
50
54
public
:
Sphere
(
const
Precision
_radius
,
const
Material
&
_mat
);
55
58
public
:
Precision
Radius
()
const
;
59
62
public
:
void
SetRadius
(
const
Precision
_radius
);
63
66
public
:
const
gz::math::Material
&
Material
()
const
;
67
70
public
:
void
SetMaterial
(
const
gz::math::Material
&
_mat
);
71
78
public
:
bool
MassMatrix
(
MassMatrix3d
&
_massMat
)
const
;
79
85
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
86
89
public
:
bool
operator==
(
const
Sphere
&
_sphere
)
const
;
90
93
public
:
bool
operator!=
(
const
Sphere
&
_sphere
)
const
;
94
97
public
:
Precision
Volume
()
const
;
98
104
public
:
Precision
VolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
105
113
public
: std::optional<Vector3<Precision>>
114
CenterOfVolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
115
120
public
:
Vector3<Precision>
Centroid
()
const
;
121
130
public
:
Precision
DensityFromMass
(
const
Precision
_mass
)
const
;
131
144
public
:
bool
SetDensityFromMass
(
const
Precision
_mass
);
145
147
private
:
Precision
radius = 0.0;
148
150
private
:
gz::math::Material
material;
151
};
152
155
typedef
Sphere<int>
Spherei
;
156
159
typedef
Sphere<double>
Sphered
;
160
163
typedef
Sphere<float>
Spheref
;
164
}
// namespace GZ_MATH_VERSION_NAMESPACE
165
}
// namespace gz::math
166
#include "gz/math/detail/Sphere.hh"
167
#endif
// GZ_MATH_SPHERE_HH_