Class
List
Heirarchy
Modules
Common
Events
Math
Messages
Physics
Rendering
Sensors
Transport
Links
Gazebo Website
Wiki
Tutorials
Download
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
gazebo
math
Spline.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2011 Nate Koenig
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
// Note: Originally cribbed from Ogre3d. Modified to implement Cardinal
18
// spline and catmull-rom spline
19
#ifndef _SPLINE_HH_
20
#define _SPLINE_HH_
21
22
#include <vector>
23
24
#include "
math/Vector3.hh
"
25
#include "
math/Matrix4.hh
"
26
27
namespace
gazebo
28
{
29
namespace
math
30
{
33
35
class
Spline
36
{
38
public
:
Spline
();
39
41
public
:
~Spline
();
42
46
public
:
void
SetTension
(
double
_t);
47
50
public
:
double
GetTension
()
const
;
51
54
public
:
void
AddPoint
(
const
Vector3
&_pt);
55
60
public
:
Vector3
GetPoint
(
unsigned
int
_index)
const
;
61
64
public
:
unsigned
int
GetPointCount
()
const
;
65
68
public
:
Vector3
GetTangent
(
unsigned
int
_index)
const
;
69
71
public
:
void
Clear
();
72
78
public
:
void
UpdatePoint
(
unsigned
int
_index,
const
Vector3
&_value);
79
83
public
:
Vector3
Interpolate
(
double
_t)
const
;
84
90
public
:
Vector3
Interpolate
(
unsigned
int
_fromIndex,
double
_t)
const
;
91
92
107
public
:
void
SetAutoCalculate
(
bool
_autoCalc);
108
113
public
:
void
RecalcTangents
();
114
117
protected
:
bool
autoCalc
;
118
120
protected
: std::vector<Vector3>
points
;
121
123
protected
: std::vector<Vector3>
tangents
;
124
126
protected
:
Matrix4
coeffs
;
127
129
protected
:
double
tension
;
130
};
132
}
133
}
134
#endif