Three json
- [x] Skeleton
- [x] Euler
- [x] Quaternion
- [x] AnimationClip
- [x] KeyframeTrack
- [x] Skeleton
- [x] Matrix3
- [x] Matrix4
- [x] Object3D
- [x] Path
- [x] Texture
- [x] Vector2
- [x] Source
- [x] Euler
- [x] Curve
- [x] CurvePath
- [x] BufferGeometry
- [x] BufferAttribute
Extended Objects
- [ ] Scene
- [x] Mesh
- [x] InstancedMesh
- [ ] PerspectiveCamera
- [ ] OrthographicCamera
- [x] Group
- [x] Bone
- [ ] Line
- [ ] Sprite
- [x] SkinnedMesh
- [ ] Points
- [ ] LOD
- [ ] LineSegments
- [ ] LineLoop
- [ ] Fog
- [ ] FogExp2
If you're wondering why i would give Bone, and Group their own types, its because of their
.type
@Methuselah96 What do you think of the progress so far? let me know if how i'm doing it is good before i continue
@kourser Reminder to finish this.
Note to self https://github.com/three-types/three-ts-types/blob/8109927fa28df9359537ea3cdc1b4c777b905a12/types/three/src/core/Object3D.d.ts#L646
expected output format:
{
geometries: geojson[]
materials: materialjson[]
textures: texturejson[]
images: imagejson[]
object: Object3DJSON
}
Thank you
@Hoodgail I traced this PR as the source of the QuaternionTuple change here
https://github.com/three-types/three-ts-types/blame/a6fadb5785285a73ccf9f9dbc8b81186c7ebfa42/types/three/src/math/Quaternion.d.ts#L14
Since fromArray is typed as
fromArray(array: QuaternionTuple, offset?: number): this;
it produces an error when provided an array that doesn't strictly have 4 elements, which is expected when passing an offset. This makes it impractical to use in common scenarios such as when the array is a Float32Array (e.g. packed buffer of multiple quaternions) or otherwise contains >4 elements.
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAKjgQwM5wCoAkBKBRPOAMyghDgHIYALKAUzooCgmBjCAO1XgEcBXZPAC8cDnQDumXAQB0ARQEw6UDsE4AKAJQt2XeDACeYOgBMAglCjIDcEWMkAxADYRBAZgBMFqwfUAObV1uOAgiIlQ6YTgAFhZ+QRkSMm9rdUNjc0trABoQsIiYTSA
Is there a reason array needs to be typed this way?
@mattrossman It looks like this was an oversight on my part. I had completely forgot about the offset argument
It should follow the same way its written in Vector3 at https://github.com/three-types/three-ts-types/blob/a6fadb5785285a73ccf9f9dbc8b81186c7ebfa42/types/three/src/math/Vector3.d.ts#L269
Will you make a pull request? or should i? My apologies !
@Hoodgail I've submitted a PR https://github.com/three-types/three-ts-types/pull/1230, thank you for the suggested fix!