-
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.
Merge pull request #15 from viamrobotics/ov-enhancements
Add units, add w prop
- Loading branch information
Showing
22 changed files
with
1,069 additions
and
767 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use strict' | ||
'use strict'; | ||
|
||
module.exports = '@viamrobotics/prettier-config'; | ||
/* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
module.exports = require('@viamrobotics/prettier-config'); |
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 |
---|---|---|
@@ -1,29 +1,32 @@ | ||
# @viamrobotics/three | ||
|
||
Viam-related utilities for THREE.js | ||
|
||
### Orientation Vector | ||
|
||
A class for Viam's [Orientation Vector](https://docs.viam.com/internals/orientation-vector/#edit-on-github) rotation type. | ||
|
||
This class closely resembles other rotation formats like `THREE.Quaternion` or `THREE.Euler`. | ||
|
||
```ts | ||
import * as THREE from 'three' | ||
import { OrientationVector } from '@viamrobotics/three' | ||
import * as THREE from 'three'; | ||
import { OrientationVector } from '@viamrobotics/three'; | ||
|
||
const ov = new OrientationVector() | ||
const quat = new THREE.Quaternion() | ||
const euler = new THREE.Euler() | ||
const ov = new OrientationVector(); | ||
const quat = new THREE.Quaternion(); | ||
const euler = new THREE.Euler(); | ||
|
||
// Common conversions: | ||
ov.toQuaternion(quat) | ||
ov.toEuler(euler) | ||
ov.toQuaternion(quat); | ||
ov.toEuler(euler); | ||
|
||
ov.setFromQuaternion(quat) | ||
ov.setFromQuaternion(quat); | ||
``` | ||
|
||
### ViamObject3D | ||
|
||
Extends THREE.Object3D and adds an `.orientationVector` that auto-updates when other rotation formats are updated. | ||
|
||
```ts | ||
import { ViamObject3D } from '@viamrobotics/three' | ||
``` | ||
import { ViamObject3D } from '@viamrobotics/three'; | ||
``` |
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
Oops, something went wrong.