Gazebo Math
API Reference
8.1.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
//
37
template
<
typename
Precision>
38
class
Sphere
39
{
41
public
:
Sphere
() =
default
;
42
45
public
:
explicit
Sphere
(
const
Precision
_radius
);
46
50
public
:
Sphere
(
const
Precision
_radius
,
const
Material
&
_mat
);
51
54
public
:
Precision
Radius
()
const
;
55
58
public
:
void
SetRadius
(
const
Precision
_radius
);
59
62
public
:
const
gz::math::Material
&
Material
()
const
;
63
66
public
:
void
SetMaterial
(
const
gz::math::Material
&
_mat
);
67
74
public
:
bool
MassMatrix
(
MassMatrix3d
&
_massMat
)
const
;
75
81
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
82
85
public
:
bool
operator==
(
const
Sphere
&
_sphere
)
const
;
86
89
public
:
bool
operator!=
(
const
Sphere
&
_sphere
)
const
;
90
93
public
:
Precision
Volume
()
const
;
94
100
public
:
Precision
VolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
101
109
public
: std::optional<Vector3<Precision>>
110
CenterOfVolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
111
120
public
:
Precision
DensityFromMass
(
const
Precision
_mass
)
const
;
121
134
public
:
bool
SetDensityFromMass
(
const
Precision
_mass
);
135
137
private
:
Precision
radius = 0.0;
138
140
private
:
gz::math::Material
material;
141
};
142
145
typedef
Sphere<int>
Spherei
;
146
149
typedef
Sphere<double>
Sphered
;
150
153
typedef
Sphere<float>
Spheref
;
154
}
// namespace GZ_MATH_VERSION_NAMESPACE
155
}
// namespace gz::math
156
#include "gz/math/detail/Sphere.hh"
157
#endif
// GZ_MATH_SPHERE_HH_