@ntalmagor/3drize-viewer 0.1.17 → 0.1.18
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.
- package/dist/components/AnimatedObject.js +1 -1
- package/dist/components/CameraController.js +3 -3
- package/dist/components/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +41 -29
- package/dist/components/CreatedObject.js +1 -1
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +1 -39
- package/dist/components/EnvironmentManager.d.ts +2 -2
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +36 -5
- package/dist/components/Galaxy.js +1 -2
- package/dist/components/LoadingIndicator.d.ts.map +1 -1
- package/dist/components/LoadingIndicator.js +3 -140
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +3 -5
- package/dist/components/ParticlesR3f.d.ts.map +1 -1
- package/dist/components/ParticlesR3f.js +1 -1
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +5 -19
- package/dist/components/RiseLogo.d.ts +19 -0
- package/dist/components/RiseLogo.d.ts.map +1 -0
- package/dist/components/RiseLogo.js +75 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +73 -47
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +37 -11
- package/dist/components/SkyMesh.js +3 -3
- package/dist/components/Stars.d.ts +1 -1
- package/dist/components/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +86 -48
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -3
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +1 -0
- package/dist/hooks/useMeshController.d.ts.map +1 -1
- package/dist/hooks/useMeshController.js +0 -38
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.js +16 -8
- package/dist/hooks/usePathAnimation.d.ts.map +1 -1
- package/dist/hooks/usePathAnimation.js +10 -0
- package/dist/hooks/useSequenceAnimation.d.ts.map +1 -1
- package/dist/hooks/useSequenceAnimation.js +57 -49
- package/dist/hooks/useSkySystem.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +2 -2
|
@@ -47,8 +47,8 @@ visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointe
|
|
|
47
47
|
}, [position, scale, rotation, targetPosition, targetScale, targetRotation]);
|
|
48
48
|
useEffect(() => { syncTransform(); }, [position, scale, rotation, targetPosition, targetScale, targetRotation]);
|
|
49
49
|
const onClick = (e) => {
|
|
50
|
-
e.stopPropagation();
|
|
51
50
|
if (handleObjectClick && groupRef.current) {
|
|
51
|
+
e.stopPropagation();
|
|
52
52
|
handleObjectClick(createdObject, groupRef.current, e);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -93,13 +93,13 @@ export const CameraController = ({ enableAutoAnimation = true, animationDuration
|
|
|
93
93
|
// Handle animation events (step-based animations)
|
|
94
94
|
useAnimationEvents({
|
|
95
95
|
onStepStart: (event) => {
|
|
96
|
-
console.log('Camera controller - Step started:', event.step);
|
|
96
|
+
// console.log('Camera controller - Step started:', event.step);
|
|
97
97
|
if (event.step?.transitions) {
|
|
98
98
|
const stepDuration = event.step.duration || 1;
|
|
99
99
|
event.step.transitions.forEach((transition) => {
|
|
100
100
|
const { state, properties, pathId } = transition;
|
|
101
101
|
if (state === 'camera') {
|
|
102
|
-
console.log('Camera transition detected. Starting animation to new camera state:', properties);
|
|
102
|
+
// console.log('Camera transition detected. Starting animation to new camera state:', properties);
|
|
103
103
|
isInAnimatedTransition.current = true;
|
|
104
104
|
if (pathId) {
|
|
105
105
|
const offset = camera
|
|
@@ -122,7 +122,7 @@ export const CameraController = ({ enableAutoAnimation = true, animationDuration
|
|
|
122
122
|
// orientation: camera.rotation,
|
|
123
123
|
};
|
|
124
124
|
const targetSettings = properties.to;
|
|
125
|
-
console.log("Starting camera animation from:", startSettings);
|
|
125
|
+
// console.log("Starting camera animation from:", startSettings);
|
|
126
126
|
// startSettings.position && camera.position.set(startSettings.position[0], startSettings.position[1], startSettings.position[2]);
|
|
127
127
|
// camera.rotation.set(startSettings.orientation[0], startSettings.orientation[1], startSettings.orientation[2]);
|
|
128
128
|
animateCamera(targetSettings, stepDuration, event.step?.ease, properties.to.target)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,KAAK,EAAE,cAAc,EAAoB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAoB7F,MAAM,WAAW,WAAW;IAE1B,QAAQ,EAAE,cAAc,CAAA;IACxB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmLjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef,
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useThree, useFrame } from '@react-three/fiber';
|
|
5
5
|
import { useMaterialApplication } from '../hooks/useMaterialApplication.js';
|
|
@@ -25,19 +25,17 @@ const DEFAULT_MATERIAL = {
|
|
|
25
25
|
const Clouds = ({ settings, timeSettings, }) => {
|
|
26
26
|
const { visible = true, position = [0, 400, 0], scale = 15000, speed = 1, materialSettings = DEFAULT_MATERIAL, handlers } = settings;
|
|
27
27
|
const height = position?.[1] ?? 400;
|
|
28
|
-
const
|
|
28
|
+
const meshRef = useRef(null);
|
|
29
29
|
const cloudAnimTime = useRef(0);
|
|
30
30
|
const { camera } = useThree();
|
|
31
31
|
const { interpolateProperty } = useMouseHandlers();
|
|
32
32
|
const cloudColorRef = useRef(new THREE.Color(1, 1, 1));
|
|
33
33
|
const targetCloudColorRef = useRef(new THREE.Color(1, 1, 1));
|
|
34
34
|
const numericOverrideRef = useRef(null);
|
|
35
|
+
const mouseOverrideRef = useRef({});
|
|
35
36
|
const { animateNumeric } = useNumericAnimation();
|
|
36
|
-
const meshRefCallback = useCallback((node) => {
|
|
37
|
-
setMeshNode(node);
|
|
38
|
-
}, []);
|
|
39
37
|
const effectiveMaterialSettings = materialSettings ?? DEFAULT_MATERIAL;
|
|
40
|
-
useMaterialApplication(
|
|
38
|
+
useMaterialApplication(meshRef.current, effectiveMaterialSettings, true);
|
|
41
39
|
const handleTimeUpdate = useCallback((state) => {
|
|
42
40
|
const { normalizedTime, isDaytime, delta } = state;
|
|
43
41
|
if (isDaytime) {
|
|
@@ -73,13 +71,13 @@ const Clouds = ({ settings, timeSettings, }) => {
|
|
|
73
71
|
if (!event.step?.transitions)
|
|
74
72
|
return;
|
|
75
73
|
for (const transition of event.step.transitions) {
|
|
76
|
-
if (transition.state !== 'clouds' || !
|
|
74
|
+
if (transition.state !== 'clouds' || !meshRef.current)
|
|
77
75
|
continue;
|
|
78
76
|
const toProps = transition.properties.to || {};
|
|
79
77
|
const fromProps = transition.properties.from || {};
|
|
80
78
|
// visible — immediate boolean switch on the Three.js mesh
|
|
81
79
|
if (toProps.visible !== undefined) {
|
|
82
|
-
|
|
80
|
+
meshRef.current.visible = toProps.visible;
|
|
83
81
|
}
|
|
84
82
|
// numeric: speed, scale
|
|
85
83
|
const CLOUDS_NUMERIC_KEYS = ['speed', 'scale'];
|
|
@@ -103,29 +101,42 @@ const Clouds = ({ settings, timeSettings, }) => {
|
|
|
103
101
|
},
|
|
104
102
|
});
|
|
105
103
|
const handleMouseMove = (mouse) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
if (!handlers?.onMouseMove?.enabled)
|
|
105
|
+
return;
|
|
106
|
+
if (!handlers.onMouseMove.properties.length)
|
|
107
|
+
return;
|
|
108
|
+
if (!meshRef.current)
|
|
109
|
+
return;
|
|
110
|
+
handlers.onMouseMove.properties.forEach((cfg) => {
|
|
111
|
+
const { property, propertySettings } = cfg;
|
|
112
|
+
const { min: minValue, max: maxValue, axis, sensitivity = 1, inverted = false } = propertySettings;
|
|
113
|
+
if (property === 'speed' || property === 'scale') {
|
|
114
|
+
const key = property;
|
|
115
|
+
const baseValue = settings[key];
|
|
116
|
+
if (baseValue === undefined)
|
|
113
117
|
return;
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
const interpolated = interpolateProperty(baseValue, minValue, maxValue, mouse, axis, sensitivity, inverted);
|
|
119
|
+
mouseOverrideRef.current[key] = interpolated;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const baseValue = settings.materialSettings?.[property];
|
|
123
|
+
if (baseValue === undefined)
|
|
124
|
+
return;
|
|
125
|
+
const interpolated = interpolateProperty(baseValue, minValue, maxValue, mouse, axis, sensitivity, inverted);
|
|
126
|
+
applySingleProperty(meshRef.current.material, property, interpolated);
|
|
127
|
+
});
|
|
120
128
|
};
|
|
121
129
|
useFrame((state) => {
|
|
122
|
-
if (!visible || !
|
|
130
|
+
if ((meshRef.current && !meshRef.current.visible) || !meshRef.current?.material)
|
|
123
131
|
return;
|
|
124
|
-
const material =
|
|
132
|
+
const material = meshRef.current.material;
|
|
125
133
|
const uniforms = material?.uniforms;
|
|
126
134
|
if (!uniforms)
|
|
127
135
|
return;
|
|
128
|
-
|
|
136
|
+
const effectiveSpeed = numericOverrideRef.current?.speed
|
|
137
|
+
?? mouseOverrideRef.current.speed
|
|
138
|
+
?? speed;
|
|
139
|
+
cloudAnimTime.current += 0.02 * effectiveSpeed;
|
|
129
140
|
const mouse = state.pointer;
|
|
130
141
|
if (uniforms.u_time)
|
|
131
142
|
uniforms.u_time.value = cloudAnimTime.current;
|
|
@@ -150,12 +161,13 @@ const Clouds = ({ settings, timeSettings, }) => {
|
|
|
150
161
|
: (uniforms.u_sunPosition.value = sunDirection.clone());
|
|
151
162
|
}
|
|
152
163
|
handleMouseMove(mouse);
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
const effectiveScale = numericOverrideRef.current?.scale
|
|
165
|
+
?? mouseOverrideRef.current.scale;
|
|
166
|
+
if (effectiveScale !== undefined) {
|
|
167
|
+
meshRef.current.scale.setScalar(effectiveScale);
|
|
155
168
|
}
|
|
156
169
|
});
|
|
157
|
-
if (!visible)
|
|
158
|
-
|
|
159
|
-
return (_jsx("mesh", { ref: meshRefCallback, name: "SkyClouds", userData: { id: '3drise-clouds' }, position: [0, height, 0], rotation: [Math.PI / 2, 0, 0], scale: scale, renderOrder: -1, frustumCulled: false, children: _jsx("planeGeometry", { args: [2, 2] }) }));
|
|
170
|
+
// if (!visible) return null;
|
|
171
|
+
return (_jsx("mesh", { ref: meshRef, name: "SkyClouds", userData: { id: '3drise-clouds' }, position: [0, height, 0], rotation: [Math.PI / 2, 0, 0], scale: scale, renderOrder: -1, frustumCulled: false, visible: visible, children: _jsx("planeGeometry", { args: [2, 2] }) }));
|
|
160
172
|
};
|
|
161
173
|
export default Clouds;
|
|
@@ -60,7 +60,7 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
60
60
|
// Check if this should use the new MaterialLibrary system for Drei materials
|
|
61
61
|
// console.log(object)
|
|
62
62
|
const handleObjectEnter = (e) => {
|
|
63
|
-
console.log(e)
|
|
63
|
+
// console.log(e)
|
|
64
64
|
// Only handle if this is the actual mesh group, not a child
|
|
65
65
|
if (e.eventObject !== meshRef.current)
|
|
66
66
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAoB,KAAK,qBAAqB,EAI5B,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAoB,KAAK,qBAAqB,EAI5B,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA6ElD,CAAC;AAIH,eAAe,eAAe,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { useMaterialApplication } from "../hooks/useMaterialApplication.js";
|
|
|
6
6
|
import MaterialLibrary from "./MaterialLibrary.js";
|
|
7
7
|
// import type { AnimatedTransform } from "~/types/mesh";
|
|
8
8
|
import CreatedObject from "./CreatedObject.js";
|
|
9
|
-
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
10
9
|
const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick, }) => {
|
|
11
10
|
// const { handleObjectClick } = useSceneClick();
|
|
12
11
|
// console.log("Rendering CustomPrimitive with settings:", createdObject.name, createdObject);
|
|
@@ -18,7 +17,7 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick,
|
|
|
18
17
|
scale: createdObject.meshSettings.scale,
|
|
19
18
|
});
|
|
20
19
|
// Initialize transform controls
|
|
21
|
-
const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(true);
|
|
20
|
+
// const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(true);
|
|
22
21
|
useEffect(() => {
|
|
23
22
|
setAnimatedTransform({
|
|
24
23
|
position: createdObject.meshSettings.position,
|
|
@@ -26,53 +25,16 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick,
|
|
|
26
25
|
scale: createdObject.meshSettings.scale,
|
|
27
26
|
});
|
|
28
27
|
}, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
|
|
29
|
-
// Derive material flags before any early return so hooks are always called in the same order
|
|
30
28
|
const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
|
|
31
29
|
const apply3driseMaterials = !useDreiMaterials;
|
|
32
|
-
// Hide the model until the 3drise material is applied to prevent a flash of original GLTF materials.
|
|
33
|
-
// If no 3drise material variant is set, or Drei materials are used, show immediately.
|
|
34
30
|
const willApplyMaterial = apply3driseMaterials && !!createdObject.materialSettings.materialVariant;
|
|
35
31
|
const [materialReady, setMaterialReady] = useState(!willApplyMaterial);
|
|
36
|
-
// Get the actual Three.js object from ObjectManager
|
|
37
|
-
// console.log("CustomPrimitive - ID:", createdObject.id, createdObject.meshSettings.name);
|
|
38
32
|
const obj = ObjectManager.getObject(createdObject.id);
|
|
39
|
-
// console.log("CustomPrimitive - Retrieved object from ObjectManager:", obj);
|
|
40
|
-
// Apply material directly to obj.object (always non-null when obj exists, available before the
|
|
41
|
-
// outer group ref is committed) so the material is ready on the first visible frame.
|
|
42
33
|
useMaterialApplication(obj?.object ?? null, createdObject.materialSettings, apply3driseMaterials, () => setMaterialReady(true));
|
|
43
34
|
if (!obj) {
|
|
44
35
|
// console.warn(`CustomPrimitive - Object with ID ${createdObject.id} not found.`);
|
|
45
36
|
return null;
|
|
46
37
|
}
|
|
47
|
-
// const { sensitivity = 0.5, applyToChildren = false } = createdObject.interactions. || {};
|
|
48
|
-
const sensitivity = 0.5;
|
|
49
|
-
const applyToChildren = false;
|
|
50
|
-
const clicked = false;
|
|
51
|
-
const transformEffects = createdObject.animations?.transform?.effects || []; // Array of effects from transform domain
|
|
52
|
-
const enabledTransformEffects = transformEffects.filter(e => e.enabled);
|
|
53
|
-
// console.log(isSelected)
|
|
54
|
-
// useFrame((state, dt) => {
|
|
55
|
-
// if (!meshRef.current || !applyToChildren) return;
|
|
56
|
-
// const time = state.clock.elapsedTime;
|
|
57
|
-
// // Initialize effect state if needed
|
|
58
|
-
// if (!effectStateRef.current && meshRef.current) {
|
|
59
|
-
// effectStateRef.current = createDefaultEffectState(meshRef.current);
|
|
60
|
-
// }
|
|
61
|
-
// // Apply transform effects from new continuous structure (multiple effects)
|
|
62
|
-
// if (enabledTransformEffects.length > 0 && effectStateRef.current) {
|
|
63
|
-
// applyTransformEffects(
|
|
64
|
-
// meshRef.current,
|
|
65
|
-
// enabledTransformEffects, // Pass array of enabled effects
|
|
66
|
-
// time,
|
|
67
|
-
// dt,
|
|
68
|
-
// effectStateRef.current,
|
|
69
|
-
// hovered,
|
|
70
|
-
// clicked,
|
|
71
|
-
// sensitivity
|
|
72
|
-
// );
|
|
73
|
-
// }
|
|
74
|
-
// });
|
|
75
|
-
const geometry = obj.object.geometry;
|
|
76
38
|
return (
|
|
77
39
|
// <Select enabled={isSelected}>
|
|
78
40
|
_jsx(CreatedObject, { createdObject: createdObject, shouldApply3driseMaterial: false, handleObjectClick: handleObjectClick, onObjectReady: (object, ref) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SkySystemRef, type SkySystemProps } from './SkySystem';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EnvironmentConfig } from '@ntalmagor/3drize-core';
|
|
3
3
|
export interface EnvironmentManagerProps extends SkySystemProps {
|
|
4
|
-
|
|
4
|
+
environment?: EnvironmentConfig;
|
|
5
5
|
cubeCameraResolution?: number;
|
|
6
6
|
}
|
|
7
7
|
declare const EnvironmentManager: import("react").ForwardRefExoticComponent<EnvironmentManagerProps & import("react").RefAttributes<SkySystemRef>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAIA,OAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,wBAAwB,CAAC;AAG7E,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,kHAkHtB,CAAC;AAIH,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,11 +2,27 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useMemo, forwardRef } from 'react';
|
|
3
3
|
import { Environment } from '@react-three/drei';
|
|
4
4
|
import { useThree } from '@react-three/fiber';
|
|
5
|
+
import { Vector3 } from 'three';
|
|
5
6
|
import SkySystem from './SkySystem.js';
|
|
6
7
|
import { useCubeCamera } from '../hooks/useCubeCamera.js';
|
|
7
|
-
const EnvironmentManager = forwardRef(({
|
|
8
|
+
const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512,
|
|
8
9
|
// SkySystemProps — all forwarded to SkySystem
|
|
9
|
-
timeSettings,
|
|
10
|
+
timeSettings,
|
|
11
|
+
// sunSystemVisible = false,
|
|
12
|
+
// sunSize,
|
|
13
|
+
// moonSize,
|
|
14
|
+
// skyboxScale,
|
|
15
|
+
// sunIntensity,
|
|
16
|
+
// castShadow,
|
|
17
|
+
// shadowMapSize,
|
|
18
|
+
// playerPosition,
|
|
19
|
+
// starsSettings,
|
|
20
|
+
// cloudsSettings,
|
|
21
|
+
// cloudsMaterialSettings,
|
|
22
|
+
// skyControllerSettings,
|
|
23
|
+
// rainSettings,
|
|
24
|
+
// fogSettings,
|
|
25
|
+
onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
10
26
|
const { scene } = useThree();
|
|
11
27
|
const defaultHdr = {
|
|
12
28
|
visible: false,
|
|
@@ -23,11 +39,26 @@ timeSettings, visible = true, sunSystemVisible = false, sunSize, moonSize, skybo
|
|
|
23
39
|
environmentRotation: 0,
|
|
24
40
|
},
|
|
25
41
|
};
|
|
26
|
-
const hdr =
|
|
42
|
+
const hdr = environment?.hdr ?? defaultHdr;
|
|
27
43
|
const backgroundName = hdr.visible ? hdr.name : null;
|
|
44
|
+
const sky = environment?.sky;
|
|
45
|
+
const sunSystemVisible = sky?.sunSystem?.visible;
|
|
46
|
+
const sunSize = sky?.sunSystem?.sunSize;
|
|
47
|
+
const moonSize = sky?.sunSystem?.moonSize;
|
|
48
|
+
const skyboxScale = 100000;
|
|
49
|
+
const sunIntensity = sky?.sunSystem?.intensity;
|
|
50
|
+
const castShadow = sky?.sunSystem?.castShadow;
|
|
51
|
+
const shadowMapSize = sky?.sunSystem?.shadowMapSize;
|
|
52
|
+
const playerPosition = new Vector3(0, 0, 0);
|
|
53
|
+
const starsSettings = environment?.stars;
|
|
54
|
+
const cloudsSettings = environment?.clouds;
|
|
55
|
+
const cloudsMaterialSettings = environment?.clouds?.materialSettings;
|
|
56
|
+
const skyControllerSettings = sky && !sky.sunSystem.visible ? sky : undefined;
|
|
57
|
+
const rainSettings = environment?.rain;
|
|
58
|
+
const fogSettings = environment?.fog;
|
|
28
59
|
useCubeCamera({
|
|
29
60
|
hdrSettings: hdr,
|
|
30
|
-
skyVisible:
|
|
61
|
+
skyVisible: true,
|
|
31
62
|
sunSystemVisible: sunSystemVisible ?? false,
|
|
32
63
|
timeSettings,
|
|
33
64
|
resolution: cubeCameraResolution,
|
|
@@ -41,7 +72,7 @@ timeSettings, visible = true, sunSystemVisible = false, sunSize, moonSize, skybo
|
|
|
41
72
|
scale: hdr.settings.groundScale,
|
|
42
73
|
} }));
|
|
43
74
|
}, [backgroundName, hdr.settings, scene]);
|
|
44
|
-
return (_jsxs(_Fragment, { children: [environmentComponent, _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible:
|
|
75
|
+
return (_jsxs(_Fragment, { children: [environmentComponent, _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate })] }));
|
|
45
76
|
});
|
|
46
77
|
EnvironmentManager.displayName = 'EnvironmentManager';
|
|
47
78
|
export default EnvironmentManager;
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import Stars from './Stars.js';
|
|
3
3
|
import ShootingStars from './ShootingStars.js';
|
|
4
4
|
const Galaxy = ({ settings }) => {
|
|
5
|
-
if (!settings.visible)
|
|
6
|
-
return null;
|
|
5
|
+
// if (!settings.visible) return null;
|
|
7
6
|
return (_jsxs(_Fragment, { children: [_jsx(Stars, { settings: settings }), _jsx(ShootingStars, { settings: settings.shootingStars })] }));
|
|
8
7
|
};
|
|
9
8
|
export default Galaxy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/LoadingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAqBrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,143 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import
|
|
3
|
-
const STYLE_ID = '3drise-loading-indicator-styles';
|
|
4
|
-
const CSS = `
|
|
5
|
-
.loading-indicator {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
position: relative;
|
|
11
|
-
}
|
|
12
|
-
.loading-indicator-fullscreen {
|
|
13
|
-
position: fixed;
|
|
14
|
-
top: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
width: 100vw;
|
|
17
|
-
height: 100vh;
|
|
18
|
-
background-color: rgba(0, 0, 0, 0.75);
|
|
19
|
-
backdrop-filter: blur(4px);
|
|
20
|
-
z-index: 9999;
|
|
21
|
-
margin: 0;
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
|
-
.loading-indicator.animate .loading-spinner {
|
|
25
|
-
animation: _3drise-spin 2s linear infinite;
|
|
26
|
-
}
|
|
27
|
-
.loading-indicator.animate .spinner-ring {
|
|
28
|
-
animation: _3drise-spinY 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
|
|
29
|
-
}
|
|
30
|
-
.loading-indicator.animate .spinner-ring:nth-child(1) {
|
|
31
|
-
animation-duration: 2s;
|
|
32
|
-
}
|
|
33
|
-
.loading-indicator.animate .spinner-ring:nth-child(2) {
|
|
34
|
-
animation-duration: 2.5s;
|
|
35
|
-
animation-direction: reverse;
|
|
36
|
-
}
|
|
37
|
-
.loading-indicator.animate .spinner-ring:nth-child(3) {
|
|
38
|
-
animation-duration: 3s;
|
|
39
|
-
}
|
|
40
|
-
.loading-indicator.animate .loading-text {
|
|
41
|
-
animation: _3drise-shimmer 3s linear infinite;
|
|
42
|
-
}
|
|
43
|
-
.loading-spinner {
|
|
44
|
-
position: relative;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
perspective: 1000px;
|
|
49
|
-
transform-style: preserve-3d;
|
|
50
|
-
}
|
|
51
|
-
.spinner-ring {
|
|
52
|
-
position: absolute;
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: 100%;
|
|
55
|
-
border: 3px solid transparent;
|
|
56
|
-
transform-style: preserve-3d;
|
|
57
|
-
}
|
|
58
|
-
.spinner-ring:nth-child(1) {
|
|
59
|
-
border-top-color: #007bff;
|
|
60
|
-
border-right-color: #007bff;
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 100%;
|
|
63
|
-
}
|
|
64
|
-
.spinner-ring:nth-child(2) {
|
|
65
|
-
border-bottom-color: #17a2b8;
|
|
66
|
-
border-left-color: #17a2b8;
|
|
67
|
-
width: 70%;
|
|
68
|
-
height: 70%;
|
|
69
|
-
}
|
|
70
|
-
.spinner-ring:nth-child(3) {
|
|
71
|
-
border-top-color: #6f42c1;
|
|
72
|
-
border-right-color: #6f42c1;
|
|
73
|
-
width: 40%;
|
|
74
|
-
height: 40%;
|
|
75
|
-
}
|
|
76
|
-
@keyframes _3drise-spinY {
|
|
77
|
-
0% { transform: rotateY(0deg); }
|
|
78
|
-
100% { transform: rotateY(360deg); }
|
|
79
|
-
}
|
|
80
|
-
@keyframes _3drise-spin {
|
|
81
|
-
0% { transform: rotate(0deg); }
|
|
82
|
-
100% { transform: rotate(360deg); }
|
|
83
|
-
}
|
|
84
|
-
.loading-text {
|
|
85
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
86
|
-
font-size: 1rem;
|
|
87
|
-
font-weight: 500;
|
|
88
|
-
letter-spacing: 0.5px;
|
|
89
|
-
text-transform: uppercase;
|
|
90
|
-
background: linear-gradient(90deg, #007bff, #17a2b8, #6f42c1, #007bff);
|
|
91
|
-
background-size: 200% auto;
|
|
92
|
-
-webkit-background-clip: text;
|
|
93
|
-
-webkit-text-fill-color: transparent;
|
|
94
|
-
background-clip: text;
|
|
95
|
-
}
|
|
96
|
-
@keyframes _3drise-shimmer {
|
|
97
|
-
0% { background-position: 0% center; }
|
|
98
|
-
100% { background-position: 200% center; }
|
|
99
|
-
}
|
|
100
|
-
@media (prefers-color-scheme: dark) {
|
|
101
|
-
.loading-text {
|
|
102
|
-
background: linear-gradient(90deg, #4dabf7, #22b8cf, #9775fa, #4dabf7);
|
|
103
|
-
background-size: 200% auto;
|
|
104
|
-
-webkit-background-clip: text;
|
|
105
|
-
-webkit-text-fill-color: transparent;
|
|
106
|
-
background-clip: text;
|
|
107
|
-
}
|
|
108
|
-
.spinner-ring:nth-child(1) {
|
|
109
|
-
border-top-color: #4dabf7;
|
|
110
|
-
border-right-color: #4dabf7;
|
|
111
|
-
}
|
|
112
|
-
.spinner-ring:nth-child(2) {
|
|
113
|
-
border-bottom-color: #22b8cf;
|
|
114
|
-
border-left-color: #22b8cf;
|
|
115
|
-
}
|
|
116
|
-
.spinner-ring:nth-child(3) {
|
|
117
|
-
border-top-color: #9775fa;
|
|
118
|
-
border-right-color: #9775fa;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
@media (max-width: 576px) {
|
|
122
|
-
.loading-spinner {
|
|
123
|
-
width: 60px;
|
|
124
|
-
height: 60px;
|
|
125
|
-
}
|
|
126
|
-
.loading-text {
|
|
127
|
-
font-size: 0.875rem;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`;
|
|
131
|
-
function injectStyles() {
|
|
132
|
-
if (typeof document === 'undefined' || document.getElementById(STYLE_ID))
|
|
133
|
-
return;
|
|
134
|
-
const style = document.createElement('style');
|
|
135
|
-
style.id = STYLE_ID;
|
|
136
|
-
style.textContent = CSS;
|
|
137
|
-
document.head.appendChild(style);
|
|
138
|
-
}
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import RiseLogo from './RiseLogo.js';
|
|
139
3
|
const LoadingIndicator = ({ text, fullScreen = false, animate = true, size = 80, }) => {
|
|
140
|
-
|
|
141
|
-
return (_jsxs("div", { className: `loading-indicator${animate ? ' animate' : ''}${fullScreen ? ' loading-indicator-fullscreen' : ''}`, children: [_jsxs("div", { className: "loading-spinner", style: { width: `${size}px`, height: `${size}px` }, children: [_jsx("div", { className: "spinner-ring" }), _jsx("div", { className: "spinner-ring" }), _jsx("div", { className: "spinner-ring" })] }), text && _jsx("div", { className: "loading-text", children: text })] }));
|
|
4
|
+
return (_jsx("div", { children: _jsx(RiseLogo, { size: size, animated: animate, loop: true }) }));
|
|
142
5
|
};
|
|
143
6
|
export default LoadingIndicator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAA6D,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAEpL,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAWrD,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAA6D,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAEpL,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAWrD,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AA+CF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsJzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -12,14 +12,12 @@ import Lines from "./Lines.js";
|
|
|
12
12
|
import GridHelper from "./GridHelper.js";
|
|
13
13
|
const EffectsLayer = ({ effects }) => effects?.length ? (_jsx(_Fragment, { children: effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect }, index))) })) : null;
|
|
14
14
|
const GroupWithChildren = ({ createdObject, children, cameraSettings, onObjectReady, handleObjectClick, renderObject }) => {
|
|
15
|
-
const meshSettings = createdObject.meshSettings;
|
|
16
15
|
const isGroup = createdObject.type === 'group';
|
|
17
|
-
|
|
18
|
-
return (_jsxs("group", { position: meshSettings.position, rotation: meshSettings.rotation, scale: meshSettings.scale, visible: meshSettings.visible, name: createdObject.name, userData: { id: createdObject.id, type: createdObject.type }, children: [!isGroup && renderObject(createdObject, handleObjectClick), children.map(childNode => (_jsx(ObjectNode, { node: childNode, cameraSettings: cameraSettings, handleObjectClick: handleObjectClick, onObjectReady: onObjectReady }, childNode.objectId))), _jsx(EffectsLayer, { effects: createdObject.effects })] }, createdObject.id));
|
|
16
|
+
return (_jsxs(CreatedObject, { createdObject: createdObject, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, shouldApply3driseMaterial: !isGroup, children: [!isGroup && renderObject(createdObject, handleObjectClick), children.map(childNode => (_jsx(ObjectNode, { node: childNode, cameraSettings: cameraSettings, handleObjectClick: handleObjectClick, onObjectReady: onObjectReady }, childNode.objectId))), _jsx(EffectsLayer, { effects: createdObject.effects })] }, createdObject.id));
|
|
19
17
|
};
|
|
20
18
|
const ObjectNode = ({ node, cameraSettings, onObjectReady, handleObjectClick }) => {
|
|
21
|
-
// console.log(node)
|
|
22
19
|
const { children, createdObject } = node;
|
|
20
|
+
// console.log(createdObject.meshSettings.name, createdObject.interactions)
|
|
23
21
|
// Specialized renderers for each object type
|
|
24
22
|
const renderers = useMemo(() => ({
|
|
25
23
|
group: () => null,
|
|
@@ -34,7 +32,7 @@ const ObjectNode = ({ node, cameraSettings, onObjectReady, handleObjectClick })
|
|
|
34
32
|
},
|
|
35
33
|
particles: (obj, cameraSettings, onObjectReady) => {
|
|
36
34
|
const particlesSettings = obj;
|
|
37
|
-
return (_jsxs(CreatedObject, { createdObject: obj, onObjectReady: onObjectReady,
|
|
35
|
+
return (_jsxs(CreatedObject, { createdObject: obj, onObjectReady: onObjectReady, children: [particlesSettings.config?.particles && (_jsx(ParticlesR3f, { particlesSettings: particlesSettings, cameraFov: cameraSettings.fov, duration: 1, transitionSettings: particlesSettings.meshSettings })), particlesSettings.config?.paths && (_jsx(Lines, { createdObject: particlesSettings }))] }, obj.id));
|
|
38
36
|
},
|
|
39
37
|
path: (obj, cameraSettings, onObjectReady) => (_jsx(CreatedObject, { createdObject: obj, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, children: _jsx(PathRenderer, { pathSettings: obj.config, showCurve: false, showLine: false, showPoints: false }, obj.id) }, obj.id)),
|
|
40
38
|
grid: (obj, cameraSettings, onObjectReady) => (_jsx(CreatedObject, { createdObject: obj, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, children: _jsx(GridHelper, { ...obj.config }) }, obj.id)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParticlesR3f.d.ts","sourceRoot":"","sources":["../../src/components/ParticlesR3f.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAA+B,MAAM,wBAAwB,CAAC;AAQ7F,UAAU,iBAAiB;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAMD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ParticlesR3f.d.ts","sourceRoot":"","sources":["../../src/components/ParticlesR3f.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAA+B,MAAM,wBAAwB,CAAC;AAQ7F,UAAU,iBAAiB;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAMD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4I7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -90,6 +90,6 @@ const ParticlesR3f = ({ particlesSettings, duration = 1, transitionSettings, })
|
|
|
90
90
|
});
|
|
91
91
|
if (!basePositions.current)
|
|
92
92
|
return null;
|
|
93
|
-
return (_jsxs("points", { name: name, ref: pointsRef, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: [_jsxs("bufferGeometry", { children: [_jsx("bufferAttribute", { attach: "attributes-position", count: basePositions.current.length / 3, array: basePositions.current, itemSize: 3, args: [basePositions.current, 3] }), uvs && (_jsx("bufferAttribute", { attach: "attributes-aUV", count: uvs.length / 2, array: uvs, itemSize: 2, args: [uvs, 2] }))] }), _jsx("primitive", { object: material, attach: "material" })] }));
|
|
93
|
+
return (_jsxs("points", { name: name, ref: pointsRef, raycast: () => null, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: [_jsxs("bufferGeometry", { children: [_jsx("bufferAttribute", { attach: "attributes-position", count: basePositions.current.length / 3, array: basePositions.current, itemSize: 3, args: [basePositions.current, 3] }), uvs && (_jsx("bufferAttribute", { attach: "attributes-aUV", count: uvs.length / 2, array: uvs, itemSize: 2, args: [uvs, 2] }))] }), _jsx("primitive", { object: material, attach: "material" })] }));
|
|
94
94
|
};
|
|
95
95
|
export default ParticlesR3f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectLoader.d.ts","sourceRoot":"","sources":["../../src/components/ProjectLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectLoader.d.ts","sourceRoot":"","sources":["../../src/components/ProjectLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAQ,EAAE,KAAK,qBAAqB,EAAkB,KAAK,WAAW,EAAwB,MAAM,wBAAwB,CAAC;AAG7H,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,KAAK,YAAY,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAuGzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
// import type { GetProjectPayload, Project } from '~/types/users';
|
|
4
3
|
import { dataCenterServer } from '../constants.js';
|
|
5
|
-
// import { buildQueryString } from "~/utils/utils";
|
|
6
4
|
import SceneBuilder from "./SceneBuilder.js";
|
|
7
5
|
import { loadAssets } from "@ntalmagor/3drize-core";
|
|
8
|
-
import {
|
|
9
|
-
import useMeshController from '../hooks/useMeshController.js';
|
|
6
|
+
import { useMeshController } from '@ntalmagor/3drize-viewer';
|
|
10
7
|
import LoadingIndicator from "./LoadingIndicator.js";
|
|
11
|
-
// import type { HtmlElement } from "~/types/uiController";
|
|
12
|
-
const PROJECT_LOADER_SOURCE = 'projectLoader';
|
|
13
8
|
const PROJECT_LOADER_DEBUG_PREFIX = '[ProjectLoaderDebug]';
|
|
14
9
|
const ProjectLoader = ({ projectId, onObjectClick, onObjectHover, onElementClick, onElementHover, onSceneInitialized }) => {
|
|
15
10
|
const [project, setProject] = useState(null);
|
|
16
11
|
const meshController = useMeshController();
|
|
17
12
|
useEffect(() => {
|
|
18
13
|
if (projectId) {
|
|
19
|
-
|
|
20
|
-
id: projectId,
|
|
21
|
-
includeOwner: false,
|
|
22
|
-
includeDependencies: false,
|
|
23
|
-
includeTransactions: false,
|
|
24
|
-
};
|
|
25
|
-
loadProject(projectId, queryParams);
|
|
14
|
+
loadProject(projectId);
|
|
26
15
|
}
|
|
27
16
|
}, [projectId]);
|
|
28
|
-
const loadProject = async (projectId
|
|
17
|
+
const loadProject = async (projectId) => {
|
|
29
18
|
try {
|
|
30
|
-
const
|
|
31
|
-
const searchParams = new URLSearchParams(queryString);
|
|
32
|
-
searchParams.set('source', PROJECT_LOADER_SOURCE);
|
|
33
|
-
const url = `${dataCenterServer}projects/${projectId}?${searchParams.toString()}`;
|
|
19
|
+
const url = `${dataCenterServer}projects/${projectId}/view`;
|
|
34
20
|
console.log(PROJECT_LOADER_DEBUG_PREFIX, 'Fetching project', {
|
|
35
21
|
projectId,
|
|
36
|
-
queryParams,
|
|
37
22
|
url,
|
|
38
23
|
});
|
|
39
24
|
const response = await fetch(url, {
|
|
@@ -83,6 +68,7 @@ const ProjectLoader = ({ projectId, onObjectClick, onObjectHover, onElementClick
|
|
|
83
68
|
};
|
|
84
69
|
});
|
|
85
70
|
meshController.createMeshes(meshes);
|
|
71
|
+
console.log("PROJECT LOAD COMPLETE");
|
|
86
72
|
setProject(responseData);
|
|
87
73
|
}
|
|
88
74
|
catch (error) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface RiseLogoProps {
|
|
2
|
+
/** Width/height in px @default 160 */
|
|
3
|
+
size?: number;
|
|
4
|
+
/** Play the staggered build-up animation @default true */
|
|
5
|
+
animated?: boolean;
|
|
6
|
+
/** Loop the center dot pulse @default true */
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
/** Animation speed multiplier @default 1 */
|
|
9
|
+
speed?: number;
|
|
10
|
+
/** Primary accent hex color @default "#00f5ff" */
|
|
11
|
+
color?: string;
|
|
12
|
+
/** SVG background fill — use "transparent" for none @default "transparent" */
|
|
13
|
+
bgColor?: string;
|
|
14
|
+
/** Called once the build animation completes */
|
|
15
|
+
onComplete?: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const RiseLogo: ({ size, animated, loop, speed, color, bgColor, onComplete, }: RiseLogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default RiseLogo;
|
|
19
|
+
//# sourceMappingURL=RiseLogo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RiseLogo.d.ts","sourceRoot":"","sources":["../../src/components/RiseLogo.tsx"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,QAAQ,GAAI,8DAQf,aAAa,4CAuHf,CAAA;AAaD,eAAe,QAAQ,CAAC"}
|