Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
c3aa1f34
Commit
c3aa1f34
authored
Dec 18, 2019
by
Pierre Fernbach
Browse files
add operator == in rotation_spline
parent
539a5a8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/curves/helpers/effector_spline_rotation.h
View file @
c3aa1f34
...
...
@@ -72,6 +72,33 @@ class rotation_spline : public curve_abc_quat_t {
return
quat_from_
.
slerp
(
time_reparam_
(
u
)[
0
],
quat_to_
).
coeffs
();
}
/**
* @brief isApprox check if other and *this are equals, given a precision treshold.
* This test is done by discretizing, it should be re-implemented in the child class to check exactly
* all the members.
* @param other the other curve to check
* @param order the order up to which the derivatives of the curves are checked for equality
* @param prec the precision treshold, default Eigen::NumTraits<Numeric>::dummy_precision()
* @return true is the two curves are approximately equals
*/
virtual
bool
isApprox
(
const
rotation_spline
&
other
,
const
Numeric
prec
=
Eigen
::
NumTraits
<
Numeric
>::
dummy_precision
(),
const
size_t
order
=
5
)
const
{
return
min_
==
other
.
min_
&&
max_
==
other
.
max_
&&
dim_
==
other
.
dim_
&&
quat_from_
.
isApprox
(
other
.
quat_from_
,
prec
)
&&
quat_to_
.
isApprox
(
other
.
quat_to_
,
prec
)
&&
time_reparam_
.
isApprox
(
other
.
time_reparam_
,
prec
,
order
);
}
virtual
bool
operator
==
(
const
rotation_spline
&
other
)
const
{
return
isApprox
(
other
);
}
virtual
bool
operator
!=
(
const
rotation_spline
&
other
)
const
{
return
!
(
*
this
==
other
);
}
virtual
quat_t
derivate
(
time_t
/*t*/
,
std
::
size_t
/*order*/
)
const
{
throw
std
::
runtime_error
(
"TODO quaternion spline does not implement derivate"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment