File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change 3
3
* @author David Gossow - [email protected]
4
4
*/
5
5
6
- import Vector3 from './Vector3.js' ;
7
- import Quaternion from './Quaternion.js' ;
6
+ import Vector3 , { type IVector3 } from './Vector3.js' ;
7
+ import Quaternion , { type IQuaternion } from './Quaternion.js' ;
8
+
9
+ export interface ITransform {
10
+ /**
11
+ * The ROSLIB.Vector3 describing the translation.
12
+ */
13
+ translation : IVector3 ;
14
+ /**
15
+ * The ROSLIB.Quaternion describing the rotation.
16
+ */
17
+ rotation : IQuaternion ;
18
+ }
8
19
9
20
/**
10
21
* A Transform in 3-space. Values are copied into this object.
11
22
*/
12
- export default class Transform {
13
- /**
14
- * @param {Object } options
15
- * @param {Vector3 } options.translation - The ROSLIB.Vector3 describing the translation.
16
- * @param {Quaternion } options.rotation - The ROSLIB.Quaternion describing the rotation.
17
- */
18
- constructor ( options ) {
23
+ export default class Transform implements ITransform {
24
+
25
+ translation : Vector3 ;
26
+ rotation : Quaternion ;
27
+
28
+ constructor ( options : ITransform ) {
19
29
// Copy the values into this object if they exist
20
30
this . translation = new Vector3 ( options . translation ) ;
21
31
this . rotation = new Quaternion ( options . rotation ) ;
22
32
}
33
+
23
34
/**
24
35
* Clone a copy of this transform.
25
36
*
26
37
* @returns {Transform } The cloned transform.
27
38
*/
28
- clone ( ) {
39
+ clone ( ) : Transform {
29
40
return new Transform ( this ) ;
30
41
}
31
42
}
Original file line number Diff line number Diff line change 1
1
export { default as Pose } from './Pose.js' ;
2
2
export { default as Quaternion , type IQuaternion } from './Quaternion.js' ;
3
- export { default as Transform } from './Transform.js' ;
3
+ export { default as Transform , type ITransform } from './Transform.js' ;
4
4
export { default as Vector3 , type IVector3 } from './Vector3.js' ;
You can’t perform that action at this time.
0 commit comments