@ntalmagor/3drize-viewer 0.1.12 → 0.1.13
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.
|
@@ -1,33 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import type { AnimationSequence, CameraState, CreatedObjectSettings, DeviceType, FogSettings, GeneralObjectSettings, GridConfig, HdrSettings, OceanSettings, PhysicsSettings, RainSettings, SkySettings, StarsSettings, TimeSettings } from "@ntalmagor/3drize-core";
|
|
4
|
-
import { type ThreeEvent } from '@react-three/fiber';
|
|
5
|
-
type ProductionSceneProps = {
|
|
6
|
-
device: DeviceType;
|
|
7
|
-
onObjectsReady?: () => void;
|
|
8
|
-
gridSettings: GridConfig;
|
|
9
|
-
hdr: HdrSettings;
|
|
10
|
-
physicsSettings: PhysicsSettings;
|
|
11
|
-
generalObjectSettings: GeneralObjectSettings;
|
|
12
|
-
ocean: OceanSettings;
|
|
13
|
-
cameraSettings: CameraState;
|
|
14
|
-
selectedLight: any;
|
|
15
|
-
objects: CreatedObjectSettings[];
|
|
16
|
-
lighting: any;
|
|
17
|
-
controls: any;
|
|
18
|
-
geometry: any;
|
|
19
|
-
structure: any;
|
|
20
|
-
isPathMode: boolean;
|
|
21
|
-
editingPath: any;
|
|
22
|
-
sky: SkySettings;
|
|
23
|
-
timeSettings: TimeSettings;
|
|
24
|
-
starsSettings: StarsSettings;
|
|
25
|
-
clouds: any;
|
|
26
|
-
rainSettings: RainSettings;
|
|
27
|
-
fogSettings: FogSettings;
|
|
28
|
-
animationSequences: AnimationSequence[];
|
|
29
|
-
onObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
30
|
-
};
|
|
2
|
+
import type { ProductionSceneProps } from "@ntalmagor/3drize-core";
|
|
31
3
|
declare const ProductionScene: React.FC<ProductionSceneProps>;
|
|
32
4
|
export default ProductionScene;
|
|
33
5
|
//# sourceMappingURL=ProductionScene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductionScene.d.ts","sourceRoot":"","sources":["../../src/components/ProductionScene.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductionScene.d.ts","sourceRoot":"","sources":["../../src/components/ProductionScene.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAsC,oBAAoB,EAAG,MAAM,wBAAwB,CAAC;AAexG,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2HnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,17 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { OrbitControls } from "@react-three/drei";
|
|
3
3
|
import { Physics } from "@react-three/rapier";
|
|
4
4
|
import { Vector3 } from "three";
|
|
5
|
-
// import GridHelper from "/GridHelper";
|
|
6
|
-
// import { ShaderMesh } from "~/components/MaterialCreator/components";
|
|
7
|
-
// import StructureRenderer from "~/components/StructureRenderer/StructureRenderer";
|
|
8
|
-
import PathRenderer from "./PathRenderer.js";
|
|
9
5
|
import LightsManager from "./LightsManager.js";
|
|
10
6
|
import EnvironmentManager from "./EnvironmentManager.js";
|
|
11
7
|
import CameraController from "./CameraController.js";
|
|
12
8
|
import Ocean from "./Ocean.js";
|
|
13
9
|
import ObjectsRenderer from "./ObjectsRenderer.js";
|
|
14
10
|
import { useInteraction } from "../hooks/useInteraction.js";
|
|
15
|
-
const ProductionScene = ({ onObjectsReady, onObjectClick, gridSettings, hdr, physicsSettings, generalObjectSettings, ocean, cameraSettings, selectedLight, objects, lighting, controls, geometry, structure,
|
|
11
|
+
const ProductionScene = ({ onObjectsReady, onObjectClick, gridSettings, hdr, physicsSettings, generalObjectSettings, ocean, cameraSettings, selectedLight, objects, lighting, controls, geometry, structure, sky, timeSettings, starsSettings, clouds, rainSettings, fogSettings, animationSequences, }) => {
|
|
16
12
|
const sunSystem = sky.sunSystem;
|
|
17
13
|
const mode = 'default';
|
|
18
14
|
// console.log({animationSequences})
|
|
@@ -34,6 +30,6 @@ const ProductionScene = ({ onObjectsReady, onObjectClick, gridSettings, hdr, phy
|
|
|
34
30
|
});
|
|
35
31
|
onObjectClick && onObjectClick(createdObject, ref, event);
|
|
36
32
|
};
|
|
37
|
-
return (_jsxs(Physics, { gravity: physicsSettings.gravity, paused: !physicsSettings.enabled, debug: physicsSettings.debug, children: [_jsx(LightsManager, { lights: lighting, selectedLight: selectedLight }), _jsx(EnvironmentManager, { hdrSettings: hdr, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystem.visible, sunSize: sunSystem.sunSize, moonSize: sunSystem.moonSize, sunIntensity: sunSystem.intensity, castShadow: sunSystem.castShadow, shadowMapSize: sunSystem.shadowMapSize, starsSettings: starsSettings, skyControllerSettings: sky.visible && !sunSystem.visible ? sky : undefined, cloudsSettings: clouds, cloudsMaterialSettings: clouds.materialSettings, rainSettings: rainSettings, fogSettings: fogSettings }), _jsx(CameraController, { settings: cameraSettings }), _jsx(Ocean, { settings: ocean }), _jsx(ObjectsRenderer, { cameraSettings: cameraSettings, generalObjectSettings: generalObjectSettings, createdObjects: objects, onObjectsReady: onObjectsReady, handleObjectClick: handleObjectClick }),
|
|
33
|
+
return (_jsxs(Physics, { gravity: physicsSettings.gravity, paused: !physicsSettings.enabled, debug: physicsSettings.debug, children: [_jsx(LightsManager, { lights: lighting, selectedLight: selectedLight }), _jsx(EnvironmentManager, { hdrSettings: hdr, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystem.visible, sunSize: sunSystem.sunSize, moonSize: sunSystem.moonSize, sunIntensity: sunSystem.intensity, castShadow: sunSystem.castShadow, shadowMapSize: sunSystem.shadowMapSize, starsSettings: starsSettings, skyControllerSettings: sky.visible && !sunSystem.visible ? sky : undefined, cloudsSettings: clouds, cloudsMaterialSettings: clouds.materialSettings, rainSettings: rainSettings, fogSettings: fogSettings }), _jsx(CameraController, { settings: cameraSettings }), _jsx(Ocean, { settings: ocean }), _jsx(ObjectsRenderer, { cameraSettings: cameraSettings, generalObjectSettings: generalObjectSettings, createdObjects: objects, onObjectsReady: onObjectsReady, handleObjectClick: handleObjectClick }), _jsx(OrbitControls, { makeDefault: true, enabled: controls.enabled, target: new Vector3(...controls.target), enablePan: controls.enablePan, enableRotate: controls.enableRotate, autoRotate: controls.autoRotate, autoRotateSpeed: controls.autoRotateSpeed, zoomSpeed: controls.zoomSpeed, panSpeed: controls.panSpeed, rotateSpeed: controls.rotateSpeed, minDistance: controls.minDistance, maxDistance: controls.maxDistance, minPolarAngle: controls.minPolarAngle ? controls.minPolarAngle : -Infinity, maxPolarAngle: controls.maxPolarAngle ? controls.maxPolarAngle : Infinity, minAzimuthAngle: controls.minAzimuthAngle ? controls.minAzimuthAngle : -Infinity, maxAzimuthAngle: controls.maxAzimuthAngle ? controls.maxAzimuthAngle : Infinity })] }));
|
|
38
34
|
};
|
|
39
35
|
export default ProductionScene;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneBuilder.d.ts","sourceRoot":"","sources":["../../src/components/SceneBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAa,iBAAiB,EAAe,MAAM,wBAAwB,CAAC;AAQxF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"SceneBuilder.d.ts","sourceRoot":"","sources":["../../src/components/SceneBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAa,iBAAiB,EAAe,MAAM,wBAAwB,CAAC;AAQxF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyK7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -100,6 +100,6 @@ const SceneBuilder = ({ project, width = "100%", height = "100vh", style = {}, c
|
|
|
100
100
|
if (onSceneInitialized) {
|
|
101
101
|
onSceneInitialized();
|
|
102
102
|
}
|
|
103
|
-
}, children: _jsx(ProductionScene, { device: "desktop", onObjectsReady: undefined, gridSettings: environment.grid, hdr: environment.hdr, physicsSettings: physicsSettings, generalObjectSettings: generalObjectSettings, ocean: environment.ocean, cameraSettings: camera, selectedLight: null, objects: sceneObjects, lighting: project.lights || [], controls: controls, geometry: project.settings?.materialCreator?.geometry || null, structure: project.settings?.structure || null,
|
|
103
|
+
}, children: _jsx(ProductionScene, { device: "desktop", onObjectsReady: undefined, gridSettings: environment.grid, hdr: environment.hdr, physicsSettings: physicsSettings, generalObjectSettings: generalObjectSettings, ocean: environment.ocean, cameraSettings: camera, selectedLight: null, objects: sceneObjects, lighting: project.lights || [], controls: controls, geometry: project.settings?.materialCreator?.geometry || null, structure: project.settings?.structure || null, sky: environment.sky, timeSettings: timeSettings, starsSettings: environment.stars, clouds: environment.clouds, rainSettings: environment.rain, fogSettings: environment.fog, onObjectClick: onObjectClick, animationSequences: animationSequences }) }) }));
|
|
104
104
|
};
|
|
105
105
|
export default SceneBuilder;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntalmagor/3drize-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"pub": "npm run build && npm publish --access public"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@ntalmagor/3drize-core": "*",
|
|
26
25
|
"@react-three/drei": "^10",
|
|
27
26
|
"@react-three/fiber": "^9",
|
|
28
27
|
"@react-three/rapier": "^2",
|
|
@@ -30,13 +29,15 @@
|
|
|
30
29
|
"three": "^0.170"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@
|
|
32
|
+
"@gsap/react": "^2.1.2",
|
|
34
33
|
"@react-three/drei": "^10.0.0",
|
|
35
34
|
"@react-three/fiber": "^9.0.0",
|
|
36
|
-
"@gsap/react": "^2.1.2",
|
|
37
|
-
"react": "^19.0.0",
|
|
38
35
|
"@types/react": "^19.0.0",
|
|
36
|
+
"react": "^19.0.0",
|
|
39
37
|
"three": "^0.170.0",
|
|
40
38
|
"typescript": "^5.7.2"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@ntalmagor/3drize-core": "^0.1.9"
|
|
41
42
|
}
|
|
42
43
|
}
|