@viamrobotics/motion-tools 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@
7
7
  OrthographicCamera,
8
8
  } from 'three'
9
9
  import { T, useTask, useThrelte } from '@threlte/core'
10
+ import { Portal } from '@threlte/extras'
10
11
  import { useObjectEvents } from '../hooks/useObjectEvents.svelte'
11
12
  import { poseToObject3d } from '../transform'
12
13
  import { useSettings } from '../hooks/useSettings.svelte'
@@ -25,6 +26,7 @@
25
26
  const settings = useSettings()
26
27
 
27
28
  const name = useTrait(() => entity, traits.Name)
29
+ const parent = useTrait(() => entity, traits.Parent)
28
30
  const pose = useTrait(() => entity, traits.Pose)
29
31
  const positions = useTrait(() => entity, traits.PointsGeometry)
30
32
  const color = useTrait(() => entity, traits.Color)
@@ -96,13 +98,15 @@
96
98
  })
97
99
  </script>
98
100
 
99
- <T
100
- is={points}
101
- name={name.current}
102
- {...events}
103
- bvh={{ maxDepth: 40, maxLeafTris: 20 }}
104
- >
105
- <T is={geometry} />
106
- <T is={material} />
107
- {@render children?.()}
108
- </T>
101
+ <Portal id={parent.current}>
102
+ <T
103
+ is={points}
104
+ name={name.current}
105
+ {...events}
106
+ bvh={{ maxDepth: 40, maxLeafTris: 20 }}
107
+ >
108
+ <T is={geometry} />
109
+ <T is={material} />
110
+ {@render children?.()}
111
+ </T>
112
+ </Portal>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",