File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -43,4 +43,30 @@ Pose.prototype.clone = function() {
4343 return new Pose ( this ) ;
4444} ;
4545
46+ /**
47+ * Multiplies this pose with another pose without altering this pose.
48+ *
49+ * @returns Result of multiplication.
50+ */
51+ Pose . prototype . multiply = function ( pose ) {
52+ var p = pose . clone ( ) ;
53+ p . applyTransform ( { rotation : this . orientation , translation : this . position } ) ;
54+ return p ;
55+ } ;
56+
57+ /**
58+ * Computes the inverse of this pose.
59+ *
60+ * @returns Inverse of pose.
61+ */
62+ Pose . prototype . getInverse = function ( ) {
63+ var inverse = this . clone ( ) ;
64+ inverse . orientation . invert ( ) ;
65+ inverse . position . multiplyQuaternion ( inverse . orientation ) ;
66+ inverse . position . x *= - 1 ;
67+ inverse . position . y *= - 1 ;
68+ inverse . position . z *= - 1 ;
69+ return inverse ;
70+ } ;
71+
4672module . exports = Pose ;
You can’t perform that action at this time.
0 commit comments