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
Capsule.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_CAPSULE_HH_
18
#define GZ_MATH_CAPSULE_HH_
19
20
#include <optional>
21
#include "
gz/math/MassMatrix3.hh
"
22
#include "
gz/math/Material.hh
"
23
#include "
gz/math/Plane.hh
"
24
25
namespace
gz::math
26
{
27
// Inline bracket to help doxygen filtering.
28
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
29
//
44
template
<
typename
Precision>
45
class
Capsule
46
{
49
public
:
Capsule
() =
default
;
50
54
public
:
Capsule
(
const
Precision
_length
,
const
Precision
_radius
);
55
60
public
:
Capsule
(
const
Precision
_length
,
const
Precision
_radius
,
61
const
Material
&
_mat
);
62
65
public
:
Precision
Radius
()
const
;
66
69
public
:
void
SetRadius
(
const
Precision
_radius
);
70
73
public
:
Precision
Length
()
const
;
74
77
public
:
void
SetLength
(
const
Precision
_length
);
78
81
public
:
const
Material
&
Mat
()
const
;
82
85
public
:
void
SetMat
(
const
Material
&
_mat
);
86
93
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
94
97
public
:
bool
operator==
(
const
Capsule
&
_capsule
)
const
;
98
101
public
:
Precision
Volume
()
const
;
102
108
public
:
Precision
VolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
109
117
public
: std::optional<Vector3<Precision>>
118
CenterOfVolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
119
124
public
:
Vector3<Precision>
Centroid
()
const
;
125
134
public
:
Precision
DensityFromMass
(
const
Precision
_mass
)
const
;
135
148
public
:
bool
SetDensityFromMass
(
const
Precision
_mass
);
149
151
private
:
Precision
radius = 0.0;
152
154
private
:
Precision
length = 0.0;
155
157
private
:
Material
material;
158
};
159
162
typedef
Capsule<int>
Capsulei
;
163
166
typedef
Capsule<double>
Capsuled
;
167
170
typedef
Capsule<float>
Capsulef
;
171
}
// namespace GZ_MATH_VERSION_NAMESPACE
172
}
// namespace gz::math
173
#include "gz/math/detail/Capsule.hh"
174
#endif
// GZ_MATH_CAPSULE_HH_