Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coal
coal
Commits
303f076c
Commit
303f076c
authored
12 years ago
by
jpan
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
https://kforge.ros.org/fcl/fcl_ros@84
253336fb-580f-4252-a368-f3cef5a2a82b
parent
0b9a8878
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
trunk/fcl/include/fcl/transform.h
+23
-0
23 additions, 0 deletions
trunk/fcl/include/fcl/transform.h
trunk/fcl/src/transform.cpp
+46
-0
46 additions, 0 deletions
trunk/fcl/src/transform.cpp
with
69 additions
and
0 deletions
trunk/fcl/include/fcl/transform.h
+
23
−
0
View file @
303f076c
...
...
@@ -88,18 +88,22 @@ public:
/** \brief addition */
SimpleQuaternion
operator
+
(
const
SimpleQuaternion
&
other
)
const
;
const
SimpleQuaternion
&
operator
+=
(
const
SimpleQuaternion
&
other
);
/** \brief minus */
SimpleQuaternion
operator
-
(
const
SimpleQuaternion
&
other
)
const
;
const
SimpleQuaternion
&
operator
-=
(
const
SimpleQuaternion
&
other
);
/** \brief multiplication */
SimpleQuaternion
operator
*
(
const
SimpleQuaternion
&
other
)
const
;
const
SimpleQuaternion
&
operator
*=
(
const
SimpleQuaternion
&
other
);
/** \brief division */
SimpleQuaternion
operator
-
()
const
;
/** \brief scalar multiplication */
SimpleQuaternion
operator
*
(
BVH_REAL
t
)
const
;
const
SimpleQuaternion
&
operator
*=
(
BVH_REAL
t
);
/** \brief conjugate */
SimpleQuaternion
conj
()
const
;
...
...
@@ -217,6 +221,25 @@ public:
return
q
.
transform
(
v
)
+
T
;
}
const
SimpleTransform
&
operator
*=
(
const
SimpleTransform
&
other
)
{
T
=
q
.
transform
(
other
.
T
)
+
T
;
q
*=
other
.
q
;
q
.
toRotation
(
R
);
return
*
this
;
}
SimpleTransform
operator
*
(
const
SimpleTransform
&
other
)
const
{
SimpleQuaternion
q_new
=
q
*
other
.
q
;
SimpleTransform
t
;
t
.
q
=
q_new
;
q_new
.
toRotation
(
t
.
R
);
t
.
T
=
q
.
transform
(
other
.
T
)
+
T
;
return
t
;
}
bool
isIdentity
()
const
{
return
(
R
[
0
][
0
]
==
1
)
&&
(
R
[
0
][
1
]
==
0
)
&&
(
R
[
0
][
2
]
==
0
)
&&
(
R
[
1
][
0
]
==
0
)
&&
(
R
[
1
][
1
]
==
1
)
&&
(
R
[
1
][
2
]
==
0
)
&&
(
R
[
2
][
0
]
==
0
)
&&
(
R
[
2
][
1
]
==
0
)
&&
(
R
[
2
][
2
]
==
1
)
...
...
This diff is collapsed.
Click to expand it.
trunk/fcl/src/transform.cpp
+
46
−
0
View file @
303f076c
...
...
@@ -210,12 +210,32 @@ SimpleQuaternion SimpleQuaternion::operator + (const SimpleQuaternion& other) co
data
[
2
]
+
other
.
data
[
2
],
data
[
3
]
+
other
.
data
[
3
]);
}
const
SimpleQuaternion
&
SimpleQuaternion
::
operator
+=
(
const
SimpleQuaternion
&
other
)
{
data
[
0
]
+=
other
.
data
[
0
];
data
[
1
]
+=
other
.
data
[
1
];
data
[
2
]
+=
other
.
data
[
2
];
data
[
3
]
+=
other
.
data
[
3
];
return
*
this
;
}
SimpleQuaternion
SimpleQuaternion
::
operator
-
(
const
SimpleQuaternion
&
other
)
const
{
return
SimpleQuaternion
(
data
[
0
]
-
other
.
data
[
0
],
data
[
1
]
-
other
.
data
[
1
],
data
[
2
]
-
other
.
data
[
2
],
data
[
3
]
-
other
.
data
[
3
]);
}
const
SimpleQuaternion
&
SimpleQuaternion
::
operator
-=
(
const
SimpleQuaternion
&
other
)
{
data
[
0
]
-=
other
.
data
[
0
];
data
[
1
]
-=
other
.
data
[
1
];
data
[
2
]
-=
other
.
data
[
2
];
data
[
3
]
-=
other
.
data
[
3
];
return
*
this
;
}
SimpleQuaternion
SimpleQuaternion
::
operator
*
(
const
SimpleQuaternion
&
other
)
const
{
return
SimpleQuaternion
(
data
[
0
]
*
other
.
data
[
0
]
-
data
[
1
]
*
other
.
data
[
1
]
-
data
[
2
]
*
other
.
data
[
2
]
-
data
[
3
]
*
other
.
data
[
3
],
...
...
@@ -224,6 +244,21 @@ SimpleQuaternion SimpleQuaternion::operator * (const SimpleQuaternion& other) co
data
[
0
]
*
other
.
data
[
3
]
+
data
[
1
]
*
other
.
data
[
2
]
-
data
[
2
]
*
other
.
data
[
1
]
+
data
[
3
]
*
other
.
data
[
0
]);
}
const
SimpleQuaternion
&
SimpleQuaternion
::
operator
*=
(
const
SimpleQuaternion
&
other
)
{
BVH_REAL
a
=
data
[
0
]
*
other
.
data
[
0
]
-
data
[
1
]
*
other
.
data
[
1
]
-
data
[
2
]
*
other
.
data
[
2
]
-
data
[
3
]
*
other
.
data
[
3
];
BVH_REAL
b
=
data
[
0
]
*
other
.
data
[
1
]
+
data
[
1
]
*
other
.
data
[
0
]
+
data
[
2
]
*
other
.
data
[
3
]
-
data
[
3
]
*
other
.
data
[
2
];
BVH_REAL
c
=
data
[
0
]
*
other
.
data
[
2
]
-
data
[
1
]
*
other
.
data
[
3
]
+
data
[
2
]
*
other
.
data
[
0
]
+
data
[
3
]
*
other
.
data
[
1
];
BVH_REAL
d
=
data
[
0
]
*
other
.
data
[
3
]
+
data
[
1
]
*
other
.
data
[
2
]
-
data
[
2
]
*
other
.
data
[
1
]
+
data
[
3
]
*
other
.
data
[
0
];
data
[
0
]
=
a
;
data
[
1
]
=
b
;
data
[
2
]
=
c
;
data
[
3
]
=
d
;
return
*
this
;
}
SimpleQuaternion
SimpleQuaternion
::
operator
-
()
const
{
return
SimpleQuaternion
(
-
data
[
0
],
-
data
[
1
],
-
data
[
2
],
-
data
[
3
]);
...
...
@@ -234,6 +269,17 @@ SimpleQuaternion SimpleQuaternion::operator * (BVH_REAL t) const
return
SimpleQuaternion
(
data
[
0
]
*
t
,
data
[
1
]
*
t
,
data
[
2
]
*
t
,
data
[
3
]
*
t
);
}
const
SimpleQuaternion
&
SimpleQuaternion
::
operator
*=
(
BVH_REAL
t
)
{
data
[
0
]
*=
t
;
data
[
1
]
*=
t
;
data
[
2
]
*=
t
;
data
[
3
]
*=
t
;
return
*
this
;
}
SimpleQuaternion
SimpleQuaternion
::
conj
()
const
{
return
SimpleQuaternion
(
data
[
0
],
-
data
[
1
],
-
data
[
2
],
-
data
[
3
]);
...
...
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