@3driseai/3drise-viewer 0.1.3 → 0.1.4
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/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +0 -3
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +0 -4
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +1 -6
- package/dist/components/cursor/CursorController.d.ts +2 -0
- package/dist/components/cursor/CursorController.d.ts.map +1 -1
- package/dist/components/cursor/CursorController.js +1 -1
- package/dist/components/cursor/CursorEffects.d.ts +1 -0
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -1
- package/dist/components/cursor/CursorEffects.js +4 -2
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2LjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -113,10 +113,7 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings, onObjectReady, o
|
|
|
113
113
|
const animatedOverrideRef = useRef({});
|
|
114
114
|
const mouseOverrideRef = useRef({});
|
|
115
115
|
// Keyframe-animation start-value caches (one per domain that uses them)
|
|
116
|
-
const transformAnimCacheRef = useRef({});
|
|
117
|
-
const materialAnimCacheRef = useRef({});
|
|
118
116
|
const cloudsAnimCacheRef = useRef({});
|
|
119
|
-
// useMaterialApplication(visible ? (meshRef.current as any) : null, materialSettings, true);
|
|
120
117
|
const handleTimeUpdate = useCallback((state) => {
|
|
121
118
|
const { normalizedTime, isDaytime, delta } = state;
|
|
122
119
|
if (isDaytime) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAUnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAmB,SAAQ,gBAAgB;IACjD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAUnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAmB,SAAQ,gBAAgB;IACjD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmF9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -56,10 +56,6 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
56
56
|
});
|
|
57
57
|
}, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
|
|
58
58
|
// const [noiseTexture, setNoiseTexture] = useState<Texture | null>(null);
|
|
59
|
-
const isTransforming = useRef(false);
|
|
60
|
-
// useMaterialApplication(obj.object, createdObject.materialSettings);
|
|
61
|
-
// Check if this should use the new MaterialLibrary system for Drei materials
|
|
62
|
-
// console.log(object)
|
|
63
59
|
const handleObjectEnter = (e) => {
|
|
64
60
|
// console.log(e)
|
|
65
61
|
// Only handle if this is the actual mesh group, not a child
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,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":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AA0BF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4GzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -13,16 +13,11 @@ import LightObject from "./LightObject.js";
|
|
|
13
13
|
import EnvironmentObject from "./EnvironmentObject.js";
|
|
14
14
|
import Galaxy from "./Galaxy.js";
|
|
15
15
|
import GridGenerator from "./GridsGenerator.js";
|
|
16
|
-
// Types whose React component instantiates and drives its own ShaderMaterial.
|
|
17
|
-
// useMaterialApplication would otherwise traverse the mesh tree and replace
|
|
18
|
-
// that material with a registry-default instance, breaking config-driven
|
|
19
|
-
// uniform updates (e.g. only ringRadius worked on glyphs because that drives
|
|
20
|
-
// geometry, not the material).
|
|
21
16
|
const SELF_MANAGED_MATERIAL = new Set([
|
|
22
17
|
'effect',
|
|
23
18
|
// 'gallery',
|
|
24
19
|
'earth',
|
|
25
|
-
'
|
|
20
|
+
'space',
|
|
26
21
|
'shootingStars',
|
|
27
22
|
'grid',
|
|
28
23
|
// 'moon'
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
2
2
|
import React from "react";
|
|
3
|
+
import type { Vector3 } from 'three';
|
|
3
4
|
import type { CursorConfig, ClickActionConfig } from "@3driseai/3drise-core";
|
|
4
5
|
export type { CursorTypeProps } from './CursorEffects';
|
|
5
6
|
export interface CursorControllerProps extends ObjectReadyProps {
|
|
6
7
|
effects?: CursorConfig[];
|
|
7
8
|
clickActions?: ClickActionConfig[];
|
|
9
|
+
previewPositionRef?: React.RefObject<Vector3>;
|
|
8
10
|
}
|
|
9
11
|
declare const CursorController: React.FC<CursorControllerProps>;
|
|
10
12
|
export default CursorController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorController.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CursorController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"CursorController.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CursorController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;CACjD;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAAiW,CAAC;AACxZ,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import CursorEffects from './CursorEffects.js';
|
|
3
3
|
import CursorActions from './CursorActions.js';
|
|
4
|
-
const CursorController = ({ effects = [], clickActions = [], onObjectReady, onObjectDispose, }) => (_jsxs(_Fragment, { children: [_jsx(CursorEffects, { effects: effects, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(CursorActions, { clickActions: clickActions, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
|
|
4
|
+
const CursorController = ({ effects = [], clickActions = [], previewPositionRef, onObjectReady, onObjectDispose, }) => (_jsxs(_Fragment, { children: [_jsx(CursorEffects, { effects: effects, previewPositionRef: previewPositionRef, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(CursorActions, { clickActions: clickActions, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
|
|
5
5
|
export default CursorController;
|
|
@@ -11,6 +11,7 @@ export interface CursorTypeProps<C extends CursorConfig = CursorConfig> extends
|
|
|
11
11
|
}
|
|
12
12
|
export interface CursorEffectsProps extends ObjectReadyProps {
|
|
13
13
|
effects?: CursorConfig[];
|
|
14
|
+
previewPositionRef?: React.RefObject<THREE.Vector3>;
|
|
14
15
|
}
|
|
15
16
|
declare const CursorEffects: React.FC<CursorEffectsProps>;
|
|
16
17
|
export default CursorEffects;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorEffects.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CursorEffects.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,gBAAgB;IAC5F,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,KAAK,CAAC,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QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsF/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -24,7 +24,7 @@ const createTickState = () => ({
|
|
|
24
24
|
idleMsRef: { current: 0 },
|
|
25
25
|
firstFrameRef: { current: true },
|
|
26
26
|
});
|
|
27
|
-
const CursorEffects = ({ effects = [], onObjectReady, onObjectDispose }) => {
|
|
27
|
+
const CursorEffects = ({ effects = [], previewPositionRef, onObjectReady, onObjectDispose }) => {
|
|
28
28
|
const { camera, gl, scene, raycaster, pointer } = useThree();
|
|
29
29
|
// Per-effect ref bundles. Indexed by effect position. Grows/shrinks as the
|
|
30
30
|
// effects array length changes, but individual entries are stable so the
|
|
@@ -55,7 +55,9 @@ const CursorEffects = ({ effects = [], onObjectReady, onObjectDispose }) => {
|
|
|
55
55
|
if (!eff.enabled)
|
|
56
56
|
continue;
|
|
57
57
|
const s = tickStatesRef.current[i];
|
|
58
|
-
const result =
|
|
58
|
+
const result = previewPositionRef
|
|
59
|
+
? { worldPos: previewPositionRef.current, hover: null }
|
|
60
|
+
: pickCursorWorldPos(eff.pickMode, raycaster, scene, camera, pointer, eff.planeDistance, tmpPos);
|
|
59
61
|
if (s.firstFrameRef.current) {
|
|
60
62
|
s.lastPosRef.current.copy(result.worldPos);
|
|
61
63
|
s.firstFrameRef.current = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3driseai/3drise-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@react-three/fiber": "^9",
|
|
27
27
|
"@react-three/rapier": "^2",
|
|
28
28
|
"react": "^18 || ^19",
|
|
29
|
-
"three": "^0.170"
|
|
29
|
+
"three": "^0.170",
|
|
30
|
+
"@gsap/react": "^2.1.2"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@gsap/react": "^2.1.2",
|
|
33
33
|
"@react-three/drei": "^10.0.0",
|
|
34
34
|
"@react-three/fiber": "^9.0.0",
|
|
35
35
|
"@types/react": "^19.0.0",
|