Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
6bf794e9
Commit
6bf794e9
authored
6 years ago
by
Simon Ottenhaus
Browse files
Options
Downloads
Patches
Plain Diff
fixed Lerp(Quaternionf)
parent
331ec14d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/math/Helpers.cpp
+4
-3
4 additions, 3 deletions
VirtualRobot/math/Helpers.cpp
VirtualRobot/math/Helpers.h
+1
-1
1 addition, 1 deletion
VirtualRobot/math/Helpers.h
with
5 additions
and
4 deletions
VirtualRobot/math/Helpers.cpp
+
4
−
3
View file @
6bf794e9
...
...
@@ -20,6 +20,7 @@
*/
#include
"Helpers.h"
#include
"LinearInterpolatedOrientation.h"
#include
<stdexcept>
using
namespace
math
;
...
...
@@ -76,13 +77,13 @@ float Helpers::Lerp(float a, float b, float f)
Eigen
::
Vector3f
Helpers
::
Lerp
(
const
Eigen
::
Vector3f
&
a
,
const
Eigen
::
Vector3f
&
b
,
float
f
)
{
return
Eigen
::
Vector3f
(
Lerp
(
a
(
0
),
b
(
0
),
f
),
Lerp
(
a
(
1
),
b
(
1
),
f
),
Lerp
(
a
(
1
),
b
(
1
),
f
),
Lerp
(
a
(
2
),
b
(
2
),
f
));
}
Eigen
::
Quaternionf
Helpers
::
Lerp
(
const
Eigen
::
Quaternionf
&
a
,
const
Eigen
::
Quaternionf
&
b
,
float
f
)
Eigen
::
Quaternionf
Helpers
::
Lerp
(
const
Eigen
::
Quaternionf
&
a
,
const
Eigen
::
Quaternionf
&
b
,
float
f
,
bool
clamp
)
{
return
a
.
slerp
(
f
,
b
);
return
LinearInterpolatedOrientation
(
a
,
b
,
0
,
1
,
clamp
).
Get
(
f
);
}
float
Helpers
::
ILerp
(
float
a
,
float
b
,
float
f
)
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/math/Helpers.h
+
1
−
1
View file @
6bf794e9
...
...
@@ -37,7 +37,7 @@ namespace math
static
float
Clamp
(
float
min
,
float
max
,
float
value
);
static
float
Lerp
(
float
a
,
float
b
,
float
f
);
static
Eigen
::
Vector3f
Lerp
(
const
Eigen
::
Vector3f
&
a
,
const
Eigen
::
Vector3f
&
b
,
float
f
);
static
Eigen
::
Quaternionf
Lerp
(
const
Eigen
::
Quaternionf
&
a
,
const
Eigen
::
Quaternionf
&
b
,
float
f
);
static
Eigen
::
Quaternionf
Lerp
(
const
Eigen
::
Quaternionf
&
a
,
const
Eigen
::
Quaternionf
&
b
,
float
f
,
bool
clamp
);
static
float
ILerp
(
float
a
,
float
b
,
float
f
);
static
float
Lerp
(
float
a
,
float
b
,
int
min
,
int
max
,
int
val
);
static
float
Angle
(
Eigen
::
Vector2f
v
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment