-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests, allow non-normalization behavior
- Loading branch information
1 parent
de6ca54
commit dccb80a
Showing
3 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { describe, it } from 'vitest'; | ||
import { ViamObject3D } from '../src/object-3d'; | ||
import { expect } from 'vitest'; | ||
|
||
describe('ViamObject3D', () => { | ||
const object3D = new ViamObject3D(); | ||
|
||
it('Updates the rotation when when an orientation vector is modified', () => { | ||
object3D.orientationVector.th = Math.PI; | ||
expect(object3D.rotation.z).toBeCloseTo(Math.PI); | ||
expect(object3D.orientationVector.th).toBeCloseTo(Math.PI); | ||
}); | ||
|
||
it('Updates the orientation vector when rotation is modified', () => { | ||
object3D.rotation.z = Math.PI; | ||
expect(object3D.orientationVector.th).toBeCloseTo(Math.PI); | ||
expect(object3D.rotation.z).toBeCloseTo(Math.PI); | ||
}); | ||
}); |