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
2f278408
Commit
2f278408
authored
5 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add pos_quat_to_mat4f to be consistens with filename (keeping old overloads pos_mat3f_to_mat4)
parent
5d8800fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SimoxUtility/math/convert/pos_quat_to_mat4f.h
+36
-6
36 additions, 6 deletions
SimoxUtility/math/convert/pos_quat_to_mat4f.h
with
36 additions
and
6 deletions
SimoxUtility/math/convert/pos_quat_to_mat4f.h
+
36
−
6
View file @
2f278408
...
...
@@ -6,9 +6,10 @@
namespace
simox
::
math
{
template
<
class
D1
>
inline
meta
::
enable_if_mat4
<
D1
>
pos_
mat3f
_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D1
>&
m4
)
pos_
quat
_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D1
>&
m4
)
{
m4
.
setIdentity
();
m4
.
template
topLeftCorner
<
3
,
3
>()
=
q
.
toRotationMatrix
();
...
...
@@ -19,26 +20,55 @@ namespace simox::math
template
<
class
D1
,
class
D2
>
inline
meta
::
enable_if_vec3_mat4
<
D1
,
D2
>
pos_
mat3f
_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D2
>&
m4
)
pos_
quat
_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D2
>&
m4
)
{
m4
.
setIdentity
();
m4
.
template
topLeftCorner
<
3
,
3
>()
=
q
.
toRotationMatrix
();
m4
.
template
topRightCorner
<
3
,
1
>()
=
pos
;
}
inline
Eigen
::
Matrix4f
pos_
mat3f
_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
)
inline
Eigen
::
Matrix4f
pos_
quat
_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
)
{
Eigen
::
Matrix4f
m4
;
pos_
mat3f
_to_mat4f
(
x
,
y
,
z
,
q
,
m4
);
pos_
quat
_to_mat4f
(
x
,
y
,
z
,
q
,
m4
);
return
m4
;
}
template
<
class
D1
>
inline
meta
::
enable_if_vec3
<
D1
,
Eigen
::
Matrix4f
>
pos_
mat3f
_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
)
pos_
quat
_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
)
{
Eigen
::
Matrix4f
m4
;
pos_
mat3f
_to_mat4f
(
pos
,
q
,
m4
);
pos_
quat
_to_mat4f
(
pos
,
q
,
m4
);
return
m4
;
}
// Legacy overloads of pos_mat3f_to_mat4f().
template
<
class
D1
>
inline
meta
::
enable_if_mat4
<
D1
>
pos_mat3f_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D1
>&
m4
)
{
pos_quat_to_mat4f
(
x
,
y
,
z
,
q
,
m4
);
}
template
<
class
D1
,
class
D2
>
inline
meta
::
enable_if_vec3_mat4
<
D1
,
D2
>
pos_mat3f_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
,
Eigen
::
MatrixBase
<
D2
>&
m4
)
{
pos_quat_to_mat4f
(
pos
,
q
,
m4
);
}
inline
Eigen
::
Matrix4f
pos_mat3f_to_mat4f
(
float
x
,
float
y
,
float
z
,
const
Eigen
::
Quaternionf
&
q
)
{
return
pos_quat_to_mat4f
(
x
,
y
,
z
,
q
);
}
template
<
class
D1
>
inline
meta
::
enable_if_vec3
<
D1
,
Eigen
::
Matrix4f
>
pos_mat3f_to_mat4f
(
const
Eigen
::
MatrixBase
<
D1
>&
pos
,
const
Eigen
::
Quaternionf
&
q
)
{
return
pos_quat_to_mat4f
(
pos
,
q
);
}
}
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