Skip to content

Commit fe4d016

Browse files
committed
IR-4678-Fix-cross-imports-from-spatial-to-engine-package
1 parent ebca584 commit fe4d016

21 files changed

+59
-59
lines changed

src/engine/benchmarks/AvatarBenchmark.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { UserID } from '@ir-engine/common/src/schema.type.module'
33
import {
44
Engine,
55
Entity,
6+
EntityTreeComponent,
67
EntityUUID,
78
UUIDComponent,
89
createEntity,
910
getComponent,
11+
removeEntityNodeRecursively,
1012
setComponent,
1113
useComponent,
1214
useOptionalComponent
@@ -25,10 +27,6 @@ import { TransformComponent } from '@ir-engine/spatial'
2527
import { RigidBodyComponent } from '@ir-engine/spatial/src/physics/components/RigidBodyComponent'
2628
import { Object3DComponent } from '@ir-engine/spatial/src/renderer/components/Object3DComponent'
2729
import { VisibleComponent, setVisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
28-
import {
29-
EntityTreeComponent,
30-
removeEntityNodeRecursively
31-
} from '@ir-engine/spatial/src/transform/components/EntityTree'
3230
import React, { useEffect } from 'react'
3331
import { Group, MathUtils, Quaternion, Vector3 } from 'three'
3432
import {

src/examples/GLTFs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { State, getMutableState, useImmediateEffect } from '@ir-engine/hyperflux
66
import { Entity, EntityUUID, UUIDComponent, createEntity, removeEntity } from '@ir-engine/ecs'
77

88
import config from '@ir-engine/common/src/config'
9+
import { EntityTreeComponent } from '@ir-engine/ecs'
910
import { AnimationComponent } from '@ir-engine/engine/src/avatar/components/AnimationComponent'
1011
import { GLTFComponent } from '@ir-engine/engine/src/gltf/GLTFComponent'
1112
import { ModelComponent } from '@ir-engine/engine/src/scene/components/ModelComponent'
1213
import { AmbientLightComponent, DirectionalLightComponent, TransformComponent } from '@ir-engine/spatial'
1314
import { NameComponent } from '@ir-engine/spatial/src/common/NameComponent'
1415
import { RendererState } from '@ir-engine/spatial/src/renderer/RendererState'
1516
import { VisibleComponent, setVisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
16-
import { EntityTreeComponent } from '@ir-engine/spatial/src/transform/components/EntityTree'
1717
import { AnimationClip, Color, Euler, Quaternion } from 'three'
1818
import { RouteData } from '../sceneRoute'
1919
import { useExampleEntity } from './utils/common/entityUtils'

src/examples/MultipleCanvasCameras.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import config from '@ir-engine/common/src/config'
22
import {
3+
EntityTreeComponent,
34
EntityUUID,
45
UUIDComponent,
56
UndefinedEntity,
67
createEntity,
78
generateEntityUUID,
89
getMutableComponent,
910
hasComponent,
11+
removeEntityNodeRecursively,
1012
setComponent
1113
} from '@ir-engine/ecs'
1214
import { GLTFComponent } from '@ir-engine/engine/src/gltf/GLTFComponent'
@@ -21,10 +23,6 @@ import { InputComponent } from '@ir-engine/spatial/src/input/components/InputCom
2123
import { RendererComponent } from '@ir-engine/spatial/src/renderer/WebGLRendererSystem'
2224
import { SceneComponent } from '@ir-engine/spatial/src/renderer/components/SceneComponents'
2325
import { VisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
24-
import {
25-
EntityTreeComponent,
26-
removeEntityNodeRecursively
27-
} from '@ir-engine/spatial/src/transform/components/EntityTree'
2826
import React, { useEffect, useRef } from 'react'
2927

3028
let count = 0

src/examples/MultipleCanvasScenes.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import config from '@ir-engine/common/src/config'
22
import {
3+
EntityTreeComponent,
34
EntityUUID,
45
UUIDComponent,
56
UndefinedEntity,
67
createEntity,
78
generateEntityUUID,
89
hasComponent,
10+
removeEntityNodeRecursively,
911
setComponent
1012
} from '@ir-engine/ecs'
1113
import { GLTFComponent } from '@ir-engine/engine/src/gltf/GLTFComponent'
@@ -20,10 +22,6 @@ import { InputComponent } from '@ir-engine/spatial/src/input/components/InputCom
2022
import { RendererComponent } from '@ir-engine/spatial/src/renderer/WebGLRendererSystem'
2123
import { SceneComponent } from '@ir-engine/spatial/src/renderer/components/SceneComponents'
2224
import { VisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
23-
import {
24-
EntityTreeComponent,
25-
removeEntityNodeRecursively
26-
} from '@ir-engine/spatial/src/transform/components/EntityTree'
2725
import React, { useEffect, useRef } from 'react'
2826

2927
const useScene = (canvas: React.MutableRefObject<HTMLCanvasElement>) => {

src/examples/PhysicsDynamicObjects.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Entity, removeEntity, useOptionalComponent } from '@ir-engine/ecs'
33
import { GLTFComponent } from '@ir-engine/engine/src/gltf/GLTFComponent'
44
import { getMutableState, useImmediateEffect, useMutableState } from '@ir-engine/hyperflux'
55
import '@ir-engine/ir-bot/src/functions/BotHookSystem'
6-
import { EngineState } from '@ir-engine/spatial/src/EngineState'
6+
import { ReferenceSpaceState } from '@ir-engine/spatial'
77
import { RendererState } from '@ir-engine/spatial/src/renderer/RendererState'
88
import React, { useEffect } from 'react'
99
import { useRouteScene } from '../sceneRoute'
@@ -12,7 +12,7 @@ import { createPhysicsEntity } from './multipleScenes'
1212
export default function PhysicsDynamicObjects() {
1313
const sceneEntity = useRouteScene('ir-engine/default-project', 'public/scenes/default.gltf')!
1414
useNetwork({ online: false })
15-
const viewerEntity = useMutableState(EngineState).viewerEntity.value
15+
const viewerEntity = useMutableState(ReferenceSpaceState).viewerEntity.value
1616

1717
useImmediateEffect(() => {
1818
if (!viewerEntity) return

src/examples/Retargeting.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ import createGLTFExporter from '@ir-engine/engine/src/assets/functions/createGLT
2020
import { GLTF } from '@ir-engine/engine/src/assets/loaders/gltf/GLTFLoader'
2121
import { NO_PROXY, defineState, getMutableState, getState, none, useHookstate } from '@ir-engine/hyperflux'
2222

23-
import { Engine, getComponent, setComponent } from '@ir-engine/ecs'
23+
import { Engine, EntityTreeComponent, getComponent, setComponent } from '@ir-engine/ecs'
2424
import { getGLTFAsync } from '@ir-engine/engine/src/assets/functions/resourceLoaderHooks'
2525
import { MixamoBoneNames } from '@ir-engine/engine/src/avatar/AvatarBoneMatching'
2626
import { TransformComponent } from '@ir-engine/spatial'
2727
import { NameComponent } from '@ir-engine/spatial/src/common/NameComponent'
2828
import { GroupComponent, addObjectToGroup } from '@ir-engine/spatial/src/renderer/components/GroupComponent'
2929
import { VisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
30-
import { EntityTreeComponent } from '@ir-engine/spatial/src/transform/components/EntityTree'
3130
import { VRMHumanBoneName } from '@pixiv/three-vrm'
3231
import { Template } from './utils/template'
3332

src/examples/ShadowExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { getMutableState, none, useHookstate, useMutableState } from '@ir-engine
1616
import {
1717
DirectionalLightComponent,
1818
PointLightComponent,
19+
ReferenceSpaceState,
1920
SpotLightComponent,
2021
TransformComponent
2122
} from '@ir-engine/spatial'
22-
import { EngineState } from '@ir-engine/spatial/src/EngineState'
2323
import { NameComponent } from '@ir-engine/spatial/src/common/NameComponent'
2424
import { RendererComponent } from '@ir-engine/spatial/src/renderer/WebGLRendererSystem'
2525
import { addObjectToGroup } from '@ir-engine/spatial/src/renderer/components/GroupComponent'
@@ -118,7 +118,7 @@ const SceneReactor = (props: { sceneEntity: Entity }) => {
118118

119119
export default function ShadowExampleEntry() {
120120
const entity = useHookstate(UndefinedEntity)
121-
const engine = useMutableState(EngineState)
121+
const engine = useMutableState(ReferenceSpaceState)
122122
const renderer = useOptionalComponent(engine.viewerEntity.value, RendererComponent)
123123

124124
useEffect(() => {

src/examples/Splines.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import React, { useEffect } from 'react'
22

3-
import { Engine, EntityUUID, UUIDComponent } from '@ir-engine/ecs'
3+
import { Engine, EntityTreeComponent, EntityUUID, UUIDComponent } from '@ir-engine/ecs'
44
import { setComponent } from '@ir-engine/ecs/src/ComponentFunctions'
55
import { createEntity } from '@ir-engine/ecs/src/EntityFunctions'
66
import { SplineComponent } from '@ir-engine/engine/src/scene/components/SplineComponent'
77
import { SplineTrackComponent } from '@ir-engine/engine/src/scene/components/SplineTrackComponent'
88
import { NameComponent } from '@ir-engine/spatial/src/common/NameComponent'
99
import { addObjectToGroup } from '@ir-engine/spatial/src/renderer/components/GroupComponent'
1010
import { VisibleComponent } from '@ir-engine/spatial/src/renderer/components/VisibleComponent'
11-
import { EntityTreeComponent } from '@ir-engine/spatial/src/transform/components/EntityTree'
1211
import { TransformComponent } from '@ir-engine/spatial/src/transform/components/TransformComponent'
1312
import { BoxGeometry, Mesh, MeshBasicMaterial, Quaternion, SphereGeometry, Vector3 } from 'three'
1413
import { Template } from './utils/template'

src/examples/WebXR.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { MediaIconsBox } from '@ir-engine/client-core/src/components/MediaIconsBox'
22
import { Shelves } from '@ir-engine/client-core/src/components/Shelves'
33
import { XRLoading } from '@ir-engine/client-core/src/components/XRLoading'
4-
import { Engine, setComponent } from '@ir-engine/ecs'
4+
import { Engine, EntityTreeComponent, setComponent } from '@ir-engine/ecs'
55
import { loadEmptyScene } from '@ir-engine/engine/tests/util/loadEmptyScene'
66
import { getMutableState } from '@ir-engine/hyperflux'
77
import { CameraOrbitComponent } from '@ir-engine/spatial/src/camera/components/CameraOrbitComponent'
88
import { RendererState } from '@ir-engine/spatial/src/renderer/RendererState'
99
import { BackgroundComponent } from '@ir-engine/spatial/src/renderer/components/SceneComponents'
10-
import { EntityTreeComponent } from '@ir-engine/spatial/src/transform/components/EntityTree'
1110
import React, { useEffect } from 'react'
1211
import { Color } from 'three'
1312

src/examples/XRMeshes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { createEntity, removeEntity, useEntityContext } from '@ir-engine/ecs/src
66
import { NameComponent } from '@ir-engine/spatial/src/common/NameComponent'
77
import { addObjectToGroup, removeObjectFromGroup } from '@ir-engine/spatial/src/renderer/components/GroupComponent'
88

9+
import { EntityTreeComponent } from '@ir-engine/ecs'
910
import { QueryReactor } from '@ir-engine/ecs/src/QueryFunctions'
1011
import { TransformComponent } from '@ir-engine/spatial'
1112
import { ColliderComponent } from '@ir-engine/spatial/src/physics/components/ColliderComponent'
1213
import { RigidBodyComponent } from '@ir-engine/spatial/src/physics/components/RigidBodyComponent'
1314
import { CollisionGroups, DefaultCollisionMask } from '@ir-engine/spatial/src/physics/enums/CollisionGroups'
1415
import { BodyTypes, Shapes } from '@ir-engine/spatial/src/physics/types/PhysicsTypes'
15-
import { EntityTreeComponent } from '@ir-engine/spatial/src/transform/components/EntityTree'
1616
import { XRDetectedMeshComponent } from '@ir-engine/spatial/src/xr/XRDetectedMeshComponent'
1717
import { XRDetectedPlaneComponent } from '@ir-engine/spatial/src/xr/XRDetectedPlaneComponent'
1818
import { Template } from './utils/template'

0 commit comments

Comments
 (0)