@ntalmagor/3drize-viewer 0.1.11 → 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.
- package/dist/components/AnimatedObject.js +5 -5
- package/dist/components/CameraController.js +4 -4
- package/dist/components/Clouds.js +2 -2
- package/dist/components/CreatedObject.js +6 -6
- package/dist/components/CustomPrimitive.js +4 -4
- package/dist/components/EffectsGenerator.js +19 -19
- package/dist/components/EffectsGroup.js +1 -1
- package/dist/components/EnvironmentManager.js +2 -2
- package/dist/components/Frame.js +5 -5
- package/dist/components/FrameImage.js +1 -1
- package/dist/components/Galaxy.js +2 -2
- package/dist/components/GalleryLayout.js +3 -3
- package/dist/components/Lensflare.js +1 -1
- package/dist/components/Letter.js +2 -2
- package/dist/components/Letters.js +1 -1
- package/dist/components/LightsManager.js +2 -2
- package/dist/components/Lines.js +1 -1
- package/dist/components/ObjectNode.js +7 -7
- package/dist/components/ObjectsRenderer.js +1 -1
- package/dist/components/ObjectsRendererApi.js +2 -2
- package/dist/components/Ocean.js +5 -5
- package/dist/components/ParticlesR3f.js +4 -4
- package/dist/components/PathRenderer.js +1 -1
- package/dist/components/ProductionScene.d.ts +1 -29
- package/dist/components/ProductionScene.d.ts.map +1 -1
- package/dist/components/ProductionScene.js +8 -12
- package/dist/components/ProjectLoader.js +4 -4
- package/dist/components/Rain.js +1 -1
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +3 -3
- package/dist/components/ShootingStar.js +1 -1
- package/dist/components/ShootingStars.js +1 -1
- package/dist/components/SkyController.js +6 -6
- package/dist/components/SkySystem.js +8 -8
- package/dist/components/Skybox.js +2 -2
- package/dist/components/Stars.js +3 -3
- package/dist/components/SunLight.js +1 -1
- package/dist/components/Text2D.js +1 -1
- package/dist/components/Text3D.js +1 -1
- package/dist/components/effects/AuraEffect.js +1 -1
- package/dist/components/effects/AuroraEffect.js +1 -1
- package/dist/components/effects/BlackHoleEffect.js +1 -1
- package/dist/components/effects/ConstellationEffect.js +1 -1
- package/dist/components/effects/DataStreamEffect.js +1 -1
- package/dist/components/effects/DnaHelixEffect.js +1 -1
- package/dist/components/effects/FireEffect.js +1 -1
- package/dist/components/effects/ForcefieldEffect.js +1 -1
- package/dist/components/effects/HologramEffect.js +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +1 -1
- package/dist/components/effects/LightningEffect.js +1 -1
- package/dist/components/effects/MoleculesEffect.js +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +1 -1
- package/dist/components/effects/OrbEffect.js +1 -1
- package/dist/components/effects/PortalEffect.js +1 -1
- package/dist/components/effects/ShockwaveEffect.js +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +1 -1
- package/dist/components/effects/SmokeRingEffect.js +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +1 -1
- package/dist/hooks/useCameraAnimation.js +3 -3
- package/dist/hooks/useContinuousEffects.js +1 -1
- package/dist/hooks/useFrameAnimations.js +3 -3
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +4 -4
- package/dist/hooks/useObjectAnimation.js +2 -2
- package/dist/hooks/useObjectEdges.js +1 -1
- package/dist/hooks/useSkyUniforms.js +1 -1
- package/dist/hooks/useTransformControls.js +1 -1
- package/dist/index.js +102 -102
- package/dist/shaders/ShaderEffectsMaterial.js +1 -1
- package/dist/utils/anchorUtils.js +1 -1
- package/dist/utils/utils3d.js +1 -1
- package/package.json +7 -5
|
@@ -4,7 +4,7 @@ import { useFrame } from '@react-three/fiber';
|
|
|
4
4
|
import { Text, useCursor } from '@react-three/drei';
|
|
5
5
|
import { createDefaultEffectState, applyTransformEffects } from '@ntalmagor/3drize-core';
|
|
6
6
|
import { fontManager } from '@ntalmagor/3drize-core';
|
|
7
|
-
import { getTextEffectProps } from '../utils/textEffects';
|
|
7
|
+
import { getTextEffectProps } from '../utils/textEffects.js';
|
|
8
8
|
const Text2D = ({ textSettings, onTextClick }) => {
|
|
9
9
|
const groupRef = useRef(null);
|
|
10
10
|
const textRef = useRef(null);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
const vertexShader = /* glsl */ `
|
|
7
7
|
varying vec3 vNormal;
|
|
8
8
|
varying vec3 vViewDir;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
const ribbonVert = /* glsl */ `
|
|
7
7
|
uniform float u_time;
|
|
8
8
|
uniform float uPhase;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Accretion disk shader ─────────────────────────────────────────────────────
|
|
7
7
|
const diskVert = /* glsl */ `
|
|
8
8
|
varying vec2 vUv;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Stars: per-particle twinkle + size variation
|
|
7
7
|
const starVertShader = /* glsl */ `
|
|
8
8
|
attribute float aPhase;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Dual counter-rotating helices with cold→hot color gradient.
|
|
7
7
|
// All animation is GPU-side — only u_time updates per frame.
|
|
8
8
|
const vertexShader = /* glsl */ `
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Pulsing junction-dot shader ───────────────────────────────────────────────
|
|
7
7
|
const dotVert = /* glsl */ `
|
|
8
8
|
attribute float aPhase;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo, useRef } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Flame particle vertex shader ──────────────────────────────────────────────
|
|
7
7
|
const flameVert = /* glsl */ `
|
|
8
8
|
attribute float aT; // lifetime position 0..1 (base→tip)
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
const shieldVert = /* glsl */ `
|
|
7
7
|
varying vec3 vNormal;
|
|
8
8
|
varying vec3 vWorldPos;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Single rich shader handles scanlines, grid, RGB aberration, interference fringes, flicker
|
|
7
7
|
const vertexShader = /* glsl */ `
|
|
8
8
|
varying vec2 vUv;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Crystal spike shader ──────────────────────────────────────────────────────
|
|
7
7
|
const spikeVert = /* glsl */ `
|
|
8
8
|
varying vec3 vNormal;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Seeded LCG RNG — deterministic, no Math.random ───────────────────────────
|
|
7
7
|
function makeRng(seed) {
|
|
8
8
|
let s = (seed * 1664525 + 1013904223) >>> 0;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Glowing node points at each atom position
|
|
7
7
|
const nodeVertShader = /* glsl */ `
|
|
8
8
|
attribute float aPhase;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Glow sprite for pulse signals and node flashes
|
|
7
7
|
const pulseVert = /* glsl */ `
|
|
8
8
|
attribute float aBright;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Shared vert (normal + viewDir) ────────────────────────────────────────────
|
|
7
7
|
const sharedVert = /* glsl */ `
|
|
8
8
|
varying vec3 vNormal;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Multi-layer vortex disc
|
|
7
7
|
const discVertShader = /* glsl */ `
|
|
8
8
|
varying vec2 vUv;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo, useEffect } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// Ring vertex — organic warp + vertical ripple
|
|
7
7
|
const vertexShader = /* glsl */ `
|
|
8
8
|
uniform float uProgress;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Fully GPU-animated smoke puff vertex shader ───────────────────────────────
|
|
7
7
|
// Each particle has a lifetime t ∈ [0,1). It rises, expands, and billows.
|
|
8
8
|
// All motion driven by u_time — zero CPU writes per frame.
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Per-ring puff shader (one Points per ring — GPU computes torus positions) ──
|
|
7
7
|
const ringVert = /* glsl */ `
|
|
8
8
|
attribute float aAngle; // 0..TAU position around torus
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
6
|
// ── Billboard fog puff — drifts slowly, never rises far ───────────────────────
|
|
7
7
|
const fogVert = /* glsl */ `
|
|
8
8
|
attribute float aT; // stagger offset 0..1
|
|
@@ -2,9 +2,9 @@ import { useRef, useEffect } from 'react';
|
|
|
2
2
|
import { Quaternion } from 'three';
|
|
3
3
|
import gsap from 'gsap';
|
|
4
4
|
import { getType } from '@ntalmagor/3drize-core';
|
|
5
|
-
import { useMouseHandlers } from './useMouseHandlers';
|
|
6
|
-
import { useOrbitControls } from './useOrbitControls';
|
|
7
|
-
import cameraManager from '../utils/CameraSingleton';
|
|
5
|
+
import { useMouseHandlers } from './useMouseHandlers.js';
|
|
6
|
+
import { useOrbitControls } from './useOrbitControls.js';
|
|
7
|
+
import cameraManager from '../utils/CameraSingleton.js';
|
|
8
8
|
export const useCameraAnimation = (options = {}, cameraState = {}) => {
|
|
9
9
|
const { autoAnimate = true, defaultDuration = 2, defaultEase = "power2.out", onAnimationStart, onAnimationComplete, onAnimationUpdate } = options;
|
|
10
10
|
// const cameraState = useAppSelector(selectCamera);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef, useEffect } from "react";
|
|
2
2
|
import { useFrame } from "@react-three/fiber";
|
|
3
3
|
import { animateUniforms, cacheChildrenWithMaterials, handleEdgesAnimations, handleMaterialAnimations, handleMaterialEffects, handleTransformAnimations, handleTransformEffect } from "@ntalmagor/3drize-core";
|
|
4
|
-
import usePathAnimation from "./usePathAnimation";
|
|
4
|
+
import usePathAnimation from "./usePathAnimation.js";
|
|
5
5
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
6
6
|
// DEBUG LOGGING
|
|
7
7
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { useRef } from "react";
|
|
3
|
-
import cameraManager from "../utils/CameraSingleton";
|
|
4
|
-
import { useGsapAnimation } from "../hooks/useGsapAnimation";
|
|
5
|
-
import useCameraAnimation from "./useCameraAnimation";
|
|
3
|
+
import cameraManager from "../utils/CameraSingleton.js";
|
|
4
|
+
import { useGsapAnimation } from "../hooks/useGsapAnimation.js";
|
|
5
|
+
import useCameraAnimation from "./useCameraAnimation.js";
|
|
6
6
|
const DEFAULT_OPTIONS = {
|
|
7
7
|
distance: 5,
|
|
8
8
|
scale: [2, 2],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAyB,wBAAwB,EAA8B,MAAM,wBAAwB,CAAC;AAkB1J,wBAAgB,cAAc,CAAC,EAE7B,cAAc,EACd,SAAS,GACV,EAAE;IACD,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;iCA8OW,wBAAwB,KAC/B,IAAI;;;;EAwCR;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { useCallback, useRef } from 'react';
|
|
11
11
|
import { AnimationsManager } from '@ntalmagor/3drize-core';
|
|
12
|
-
import useCameraAnimation from '../hooks/useCameraAnimation';
|
|
13
|
-
import { useFrameAnimations } from '../hooks/useFrameAnimations';
|
|
14
|
-
import { useObjectEffects } from '../hooks/useObjectEffects';
|
|
12
|
+
import useCameraAnimation from '../hooks/useCameraAnimation.js';
|
|
13
|
+
import { useFrameAnimations } from '../hooks/useFrameAnimations.js';
|
|
14
|
+
import { useObjectEffects } from '../hooks/useObjectEffects.js';
|
|
15
15
|
// import AnimationsManager from '../utils/AnimationsManager';
|
|
16
|
-
import { findById } from '../utils/sceneQuery';
|
|
16
|
+
import { findById } from '../utils/sceneQuery.js';
|
|
17
17
|
// =============================================================================
|
|
18
18
|
// TYPES
|
|
19
19
|
// =============================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findById } from '@ntalmagor/3drize-core';
|
|
2
|
-
import { useContinuousEffects } from "./useContinuousEffects";
|
|
3
|
-
import { useInteractionEffects } from "./useInteractionEffects";
|
|
2
|
+
import { useContinuousEffects } from "./useContinuousEffects.js";
|
|
3
|
+
import { useInteractionEffects } from "./useInteractionEffects.js";
|
|
4
4
|
export const useObjectAnimation = (objectSettings, animateMaterial, options = {}, ref) => {
|
|
5
5
|
const { enabled = true, hovered = false } = options;
|
|
6
6
|
const objectRef = ref || findById(objectSettings?.id);
|
|
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef } from 'react';
|
|
|
2
2
|
import { BoxGeometry, BufferGeometry, CylinderGeometry, EdgesGeometry, Group, LineSegments, Mesh, MeshBasicMaterial, Points, PointsMaterial, Quaternion, Vector3, Float32BufferAttribute, } from 'three';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import { collectMeshes, computeThreshold, buildSubdividedEdgeGeometry, EDGES_GROUP_KEY, animateUniforms, cacheChildrenWithMaterials } from '@ntalmagor/3drize-core';
|
|
5
|
-
import { useMaterialApplication } from './useMaterialApplication';
|
|
5
|
+
import { useMaterialApplication } from './useMaterialApplication.js';
|
|
6
6
|
;
|
|
7
7
|
// import { animateUniforms, cacheChildrenWithMaterials } from "~/utils/materialUtils";
|
|
8
8
|
const DEFAULT_TUBE_RADIUS = 0.01;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef, useCallback } from 'react';
|
|
2
2
|
import { useThree } from '@react-three/fiber';
|
|
3
|
-
import { createSunPosition } from '../utils/utils3d';
|
|
3
|
+
import { createSunPosition } from '../utils/utils3d.js';
|
|
4
4
|
export function useSkyUniforms() {
|
|
5
5
|
const { scene } = useThree();
|
|
6
6
|
const skyMeshRef = useRef(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useRef } from "react";
|
|
2
2
|
import { MathUtils } from "three";
|
|
3
|
-
import { useKeyUpDown } from "./useKey";
|
|
3
|
+
import { useKeyUpDown } from "./useKey.js";
|
|
4
4
|
export const useTransformControls = () => {
|
|
5
5
|
const controllersRef = useRef(new Map());
|
|
6
6
|
// Helper function to get all controllers
|
package/dist/index.js
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
1
|
// Core services (re-exported from @ntalmagor/3drize-core for convenience)
|
|
2
2
|
export { AnimationsManager as animationsManager, fontManager } from '@ntalmagor/3drize-core';
|
|
3
3
|
// Components
|
|
4
|
-
export { AnimatedObject, default as AnimatedObjectDefault } from './components/AnimatedObject';
|
|
5
|
-
export { CameraController, default as CameraControllerDefault } from './components/CameraController';
|
|
6
|
-
export { default as CreatedObject } from './components/CreatedObject';
|
|
7
|
-
export { default as CustomPrimitive } from './components/CustomPrimitive';
|
|
8
|
-
export { default as EffectsGenerator } from './components/EffectsGenerator';
|
|
9
|
-
export { default as EffectsGroup } from './components/EffectsGroup';
|
|
10
|
-
export { default as Frame } from './components/Frame';
|
|
11
|
-
export { FrameGeometry } from './components/FrameGeometry';
|
|
12
|
-
export { FrameImage } from './components/FrameImage';
|
|
13
|
-
export { default as GalleryLayout } from './components/GalleryLayout';
|
|
14
|
-
export { default as GridHelper } from './components/GridHelper';
|
|
15
|
-
export { ImageGeometry } from './components/ImageGeometry';
|
|
16
|
-
export { default as Letter } from './components/Letter';
|
|
17
|
-
export { default as Letters } from './components/Letters';
|
|
18
|
-
export { default as LightsManager } from './components/LightsManager';
|
|
19
|
-
export { default as Lines } from './components/Lines';
|
|
20
|
-
export { default as MaterialLibrary } from './components/MaterialLibrary';
|
|
21
|
-
export { default as ObjectNode } from './components/ObjectNode';
|
|
22
|
-
export { default as ObjectsRenderer } from './components/ObjectsRenderer';
|
|
23
|
-
export { default as ParticlesR3f } from './components/ParticlesR3f';
|
|
24
|
-
export { default as Skybox } from './components/Skybox';
|
|
25
|
-
export { default as SkyMesh } from './components/SkyMesh';
|
|
26
|
-
export { default as Moon } from './components/Moon';
|
|
27
|
-
export { default as SkyController } from './components/SkyController';
|
|
28
|
-
export { default as Lensflare, createFlareTexture } from './components/Lensflare';
|
|
29
|
-
export { default as SunLight } from './components/SunLight';
|
|
30
|
-
export { default as Clouds } from './components/Clouds';
|
|
31
|
-
export { default as Stars, generateStarsGeometry } from './components/Stars';
|
|
32
|
-
export { default as ShootingStar } from './components/ShootingStar';
|
|
33
|
-
export { default as ShootingStars } from './components/ShootingStars';
|
|
34
|
-
export { default as Galaxy } from './components/Galaxy';
|
|
35
|
-
export { default as SkySystem } from './components/SkySystem';
|
|
36
|
-
export { default as Rain } from './components/Rain';
|
|
37
|
-
export { default as SceneFog } from './components/SceneFog';
|
|
38
|
-
export { default as EnvironmentManager } from './components/EnvironmentManager';
|
|
39
|
-
export { default as Ocean } from './components/Ocean';
|
|
40
|
-
export { LoadingIndicator } from './components/LoadingIndicator';
|
|
41
|
-
export { default as Path } from './components/Path';
|
|
42
|
-
export { default as PathGeometry } from './components/PathGeometry';
|
|
43
|
-
export { default as PathRenderer } from './components/PathRenderer';
|
|
44
|
-
export { default as Text2D } from './components/Text2D';
|
|
45
|
-
export { default as Text3D } from './components/Text3D';
|
|
46
|
-
export { default as SceneBuilder } from './components/SceneBuilder';
|
|
47
|
-
export { default as ProjectLoader } from './components/ProjectLoader';
|
|
48
|
-
export { default as ProductionScene } from './components/ProductionScene';
|
|
4
|
+
export { AnimatedObject, default as AnimatedObjectDefault } from './components/AnimatedObject.js';
|
|
5
|
+
export { CameraController, default as CameraControllerDefault } from './components/CameraController.js';
|
|
6
|
+
export { default as CreatedObject } from './components/CreatedObject.js';
|
|
7
|
+
export { default as CustomPrimitive } from './components/CustomPrimitive.js';
|
|
8
|
+
export { default as EffectsGenerator } from './components/EffectsGenerator.js';
|
|
9
|
+
export { default as EffectsGroup } from './components/EffectsGroup.js';
|
|
10
|
+
export { default as Frame } from './components/Frame.js';
|
|
11
|
+
export { FrameGeometry } from './components/FrameGeometry.js';
|
|
12
|
+
export { FrameImage } from './components/FrameImage.js';
|
|
13
|
+
export { default as GalleryLayout } from './components/GalleryLayout.js';
|
|
14
|
+
export { default as GridHelper } from './components/GridHelper.js';
|
|
15
|
+
export { ImageGeometry } from './components/ImageGeometry.js';
|
|
16
|
+
export { default as Letter } from './components/Letter.js';
|
|
17
|
+
export { default as Letters } from './components/Letters.js';
|
|
18
|
+
export { default as LightsManager } from './components/LightsManager.js';
|
|
19
|
+
export { default as Lines } from './components/Lines.js';
|
|
20
|
+
export { default as MaterialLibrary } from './components/MaterialLibrary.js';
|
|
21
|
+
export { default as ObjectNode } from './components/ObjectNode.js';
|
|
22
|
+
export { default as ObjectsRenderer } from './components/ObjectsRenderer.js';
|
|
23
|
+
export { default as ParticlesR3f } from './components/ParticlesR3f.js';
|
|
24
|
+
export { default as Skybox } from './components/Skybox.js';
|
|
25
|
+
export { default as SkyMesh } from './components/SkyMesh.js';
|
|
26
|
+
export { default as Moon } from './components/Moon.js';
|
|
27
|
+
export { default as SkyController } from './components/SkyController.js';
|
|
28
|
+
export { default as Lensflare, createFlareTexture } from './components/Lensflare.js';
|
|
29
|
+
export { default as SunLight } from './components/SunLight.js';
|
|
30
|
+
export { default as Clouds } from './components/Clouds.js';
|
|
31
|
+
export { default as Stars, generateStarsGeometry } from './components/Stars.js';
|
|
32
|
+
export { default as ShootingStar } from './components/ShootingStar.js';
|
|
33
|
+
export { default as ShootingStars } from './components/ShootingStars.js';
|
|
34
|
+
export { default as Galaxy } from './components/Galaxy.js';
|
|
35
|
+
export { default as SkySystem } from './components/SkySystem.js';
|
|
36
|
+
export { default as Rain } from './components/Rain.js';
|
|
37
|
+
export { default as SceneFog } from './components/SceneFog.js';
|
|
38
|
+
export { default as EnvironmentManager } from './components/EnvironmentManager.js';
|
|
39
|
+
export { default as Ocean } from './components/Ocean.js';
|
|
40
|
+
export { LoadingIndicator } from './components/LoadingIndicator.js';
|
|
41
|
+
export { default as Path } from './components/Path.js';
|
|
42
|
+
export { default as PathGeometry } from './components/PathGeometry.js';
|
|
43
|
+
export { default as PathRenderer } from './components/PathRenderer.js';
|
|
44
|
+
export { default as Text2D } from './components/Text2D.js';
|
|
45
|
+
export { default as Text3D } from './components/Text3D.js';
|
|
46
|
+
export { default as SceneBuilder } from './components/SceneBuilder.js';
|
|
47
|
+
export { default as ProjectLoader } from './components/ProjectLoader.js';
|
|
48
|
+
export { default as ProductionScene } from './components/ProductionScene.js';
|
|
49
49
|
// Generative effect components
|
|
50
|
-
export { default as AuraEffect } from './components/effects/AuraEffect';
|
|
51
|
-
export { default as AuroraEffect } from './components/effects/AuroraEffect';
|
|
52
|
-
export { default as BlackHoleEffect } from './components/effects/BlackHoleEffect';
|
|
53
|
-
export { default as ConstellationEffect } from './components/effects/ConstellationEffect';
|
|
54
|
-
export { default as DataStreamEffect } from './components/effects/DataStreamEffect';
|
|
55
|
-
export { default as DnaHelixEffect } from './components/effects/DnaHelixEffect';
|
|
56
|
-
export { default as FireEffect } from './components/effects/FireEffect';
|
|
57
|
-
export { default as ForcefieldEffect } from './components/effects/ForcefieldEffect';
|
|
58
|
-
export { default as HologramEffect } from './components/effects/HologramEffect';
|
|
59
|
-
export { default as IceCrystalsEffect } from './components/effects/IceCrystalsEffect';
|
|
60
|
-
export { default as LightningEffect } from './components/effects/LightningEffect';
|
|
61
|
-
export { default as MoleculesEffect } from './components/effects/MoleculesEffect';
|
|
62
|
-
export { default as NeuralNetworkEffect } from './components/effects/NeuralNetworkEffect';
|
|
63
|
-
export { default as OrbEffect } from './components/effects/OrbEffect';
|
|
64
|
-
export { default as PortalEffect } from './components/effects/PortalEffect';
|
|
65
|
-
export { default as ShockwaveEffect } from './components/effects/ShockwaveEffect';
|
|
66
|
-
export { default as SmokePlumeEffect } from './components/effects/SmokePlumeEffect';
|
|
67
|
-
export { default as SmokeRingEffect } from './components/effects/SmokeRingEffect';
|
|
68
|
-
export { default as VolumetricFogEffect } from './components/effects/VolumetricFogEffect';
|
|
50
|
+
export { default as AuraEffect } from './components/effects/AuraEffect.js';
|
|
51
|
+
export { default as AuroraEffect } from './components/effects/AuroraEffect.js';
|
|
52
|
+
export { default as BlackHoleEffect } from './components/effects/BlackHoleEffect.js';
|
|
53
|
+
export { default as ConstellationEffect } from './components/effects/ConstellationEffect.js';
|
|
54
|
+
export { default as DataStreamEffect } from './components/effects/DataStreamEffect.js';
|
|
55
|
+
export { default as DnaHelixEffect } from './components/effects/DnaHelixEffect.js';
|
|
56
|
+
export { default as FireEffect } from './components/effects/FireEffect.js';
|
|
57
|
+
export { default as ForcefieldEffect } from './components/effects/ForcefieldEffect.js';
|
|
58
|
+
export { default as HologramEffect } from './components/effects/HologramEffect.js';
|
|
59
|
+
export { default as IceCrystalsEffect } from './components/effects/IceCrystalsEffect.js';
|
|
60
|
+
export { default as LightningEffect } from './components/effects/LightningEffect.js';
|
|
61
|
+
export { default as MoleculesEffect } from './components/effects/MoleculesEffect.js';
|
|
62
|
+
export { default as NeuralNetworkEffect } from './components/effects/NeuralNetworkEffect.js';
|
|
63
|
+
export { default as OrbEffect } from './components/effects/OrbEffect.js';
|
|
64
|
+
export { default as PortalEffect } from './components/effects/PortalEffect.js';
|
|
65
|
+
export { default as ShockwaveEffect } from './components/effects/ShockwaveEffect.js';
|
|
66
|
+
export { default as SmokePlumeEffect } from './components/effects/SmokePlumeEffect.js';
|
|
67
|
+
export { default as SmokeRingEffect } from './components/effects/SmokeRingEffect.js';
|
|
68
|
+
export { default as VolumetricFogEffect } from './components/effects/VolumetricFogEffect.js';
|
|
69
69
|
// Hooks
|
|
70
|
-
export * from './hooks/useAnimationEvents';
|
|
71
|
-
export * from './hooks/useCameraAnimation';
|
|
72
|
-
export * from './hooks/useContinuousEffects';
|
|
73
|
-
export * from './hooks/useFrameEffects';
|
|
74
|
-
export * from './hooks/useInteractionEffects';
|
|
75
|
-
export * from './hooks/useKey';
|
|
76
|
-
export * from './hooks/useLightHandlers';
|
|
77
|
-
export * from './hooks/useMaterialApplication';
|
|
78
|
-
export * from './hooks/useMaterialOptions';
|
|
79
|
-
export * from './hooks/useMaterialUniforms';
|
|
80
|
-
export * from './hooks/useMouseHandlers';
|
|
81
|
-
export * from './hooks/useObjectAnimation';
|
|
82
|
-
export * from './hooks/useObjectEdges';
|
|
83
|
-
export * from './hooks/useParticlePositions';
|
|
84
|
-
export * from './hooks/useParticlesColors';
|
|
85
|
-
export * from './hooks/useParticlesTextures';
|
|
86
|
-
export * from './hooks/usePathAnimation';
|
|
87
|
-
export * from './hooks/useTransformControls';
|
|
88
|
-
export * from './hooks/useSkySystem';
|
|
89
|
-
export * from './hooks/useCubeCamera';
|
|
90
|
-
export * from './hooks/useEnvironmentEffects';
|
|
91
|
-
export * from './hooks/useSkyUniforms';
|
|
92
|
-
export * from './hooks/useSkyAnimation';
|
|
93
|
-
export * from './hooks/useMeshController';
|
|
94
|
-
export { useWaterEnvironment } from './hooks/useWaterEnvironment';
|
|
95
|
-
export { useWaterReflections } from './hooks/useWaterReflections';
|
|
70
|
+
export * from './hooks/useAnimationEvents.js';
|
|
71
|
+
export * from './hooks/useCameraAnimation.js';
|
|
72
|
+
export * from './hooks/useContinuousEffects.js';
|
|
73
|
+
export * from './hooks/useFrameEffects.js';
|
|
74
|
+
export * from './hooks/useInteractionEffects.js';
|
|
75
|
+
export * from './hooks/useKey.js';
|
|
76
|
+
export * from './hooks/useLightHandlers.js';
|
|
77
|
+
export * from './hooks/useMaterialApplication.js';
|
|
78
|
+
export * from './hooks/useMaterialOptions.js';
|
|
79
|
+
export * from './hooks/useMaterialUniforms.js';
|
|
80
|
+
export * from './hooks/useMouseHandlers.js';
|
|
81
|
+
export * from './hooks/useObjectAnimation.js';
|
|
82
|
+
export * from './hooks/useObjectEdges.js';
|
|
83
|
+
export * from './hooks/useParticlePositions.js';
|
|
84
|
+
export * from './hooks/useParticlesColors.js';
|
|
85
|
+
export * from './hooks/useParticlesTextures.js';
|
|
86
|
+
export * from './hooks/usePathAnimation.js';
|
|
87
|
+
export * from './hooks/useTransformControls.js';
|
|
88
|
+
export * from './hooks/useSkySystem.js';
|
|
89
|
+
export * from './hooks/useCubeCamera.js';
|
|
90
|
+
export * from './hooks/useEnvironmentEffects.js';
|
|
91
|
+
export * from './hooks/useSkyUniforms.js';
|
|
92
|
+
export * from './hooks/useSkyAnimation.js';
|
|
93
|
+
export * from './hooks/useMeshController.js';
|
|
94
|
+
export { useWaterEnvironment } from './hooks/useWaterEnvironment.js';
|
|
95
|
+
export { useWaterReflections } from './hooks/useWaterReflections.js';
|
|
96
96
|
// Utils
|
|
97
|
-
export { cameraManager } from './utils/CameraSingleton';
|
|
98
|
-
export { update3driseShaderUniforms } from './utils/shaderUtils';
|
|
99
|
-
export { applyAnchorSettings, createCurves, createSunPosition, randomRange, } from './utils/utils3d';
|
|
100
|
-
export { applyAnchorSettings as applyAnchorSettingsLegacy } from './utils/anchorUtils';
|
|
101
|
-
export { DEBUG_GENERATIVE_EFFECTS, applyGenerativeAnimations, } from './utils/handleGenerativeEffectsAnimations';
|
|
102
|
-
export { hasHoverAnimation } from './utils/hasHoverAnimation';
|
|
103
|
-
export { findById } from './utils/sceneQuery';
|
|
104
|
-
export * from './utils/textEffects';
|
|
97
|
+
export { cameraManager } from './utils/CameraSingleton.js';
|
|
98
|
+
export { update3driseShaderUniforms } from './utils/shaderUtils.js';
|
|
99
|
+
export { applyAnchorSettings, createCurves, createSunPosition, randomRange, } from './utils/utils3d.js';
|
|
100
|
+
export { applyAnchorSettings as applyAnchorSettingsLegacy } from './utils/anchorUtils.js';
|
|
101
|
+
export { DEBUG_GENERATIVE_EFFECTS, applyGenerativeAnimations, } from './utils/handleGenerativeEffectsAnimations.js';
|
|
102
|
+
export { hasHoverAnimation } from './utils/hasHoverAnimation.js';
|
|
103
|
+
export { findById } from './utils/sceneQuery.js';
|
|
104
|
+
export * from './utils/textEffects.js';
|
|
105
105
|
// Shaders
|
|
106
|
-
export { ShaderEffectsMaterial } from './shaders/ShaderEffectsMaterial';
|
|
107
|
-
export { SkyboxMaterial } from './shaders/SkyboxMaterial';
|
|
108
|
-
export { ShootingStarMaterial } from './shaders/ShootingStarMaterial';
|
|
109
|
-
export { RainMaterial } from './shaders/RainMaterial';
|
|
106
|
+
export { ShaderEffectsMaterial } from './shaders/ShaderEffectsMaterial.js';
|
|
107
|
+
export { SkyboxMaterial } from './shaders/SkyboxMaterial.js';
|
|
108
|
+
export { ShootingStarMaterial } from './shaders/ShootingStarMaterial.js';
|
|
109
|
+
export { RainMaterial } from './shaders/RainMaterial.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector2, Color } from 'three';
|
|
2
2
|
import { extend } from '@react-three/fiber';
|
|
3
3
|
import { shaderMaterial } from '@react-three/drei';
|
|
4
|
-
import { effectsVertexGLSL } from './effects/EffectsVertexFunctions.glsl';
|
|
4
|
+
import { effectsVertexGLSL } from './effects/EffectsVertexFunctions.glsl.js';
|
|
5
5
|
const vertexShader = /*glsl*/ `
|
|
6
6
|
${effectsVertexGLSL}
|
|
7
7
|
|
package/dist/utils/utils3d.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CatmullRomCurve3, Vector3 } from 'three';
|
|
2
|
-
import { cameraManager } from './CameraSingleton';
|
|
2
|
+
import { cameraManager } from './CameraSingleton.js';
|
|
3
3
|
export { createSunPosition } from '@ntalmagor/3drize-core';
|
|
4
4
|
export const applyAnchorSettings = (anchor, object, initialRotation = [0, 0, 0]) => {
|
|
5
5
|
if (!anchor || !anchor.enabled)
|
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",
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "tsc --build",
|
|
18
|
+
"build": "tsc --build --force && node add-js-extensions.mjs",
|
|
19
19
|
"dev": "tsc --build --watch",
|
|
20
20
|
"clean": "rimraf dist",
|
|
21
21
|
"bump": "npm version patch",
|
|
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,12 +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
|
-
"react": "^19.0.0",
|
|
37
35
|
"@types/react": "^19.0.0",
|
|
36
|
+
"react": "^19.0.0",
|
|
38
37
|
"three": "^0.170.0",
|
|
39
38
|
"typescript": "^5.7.2"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@ntalmagor/3drize-core": "^0.1.9"
|
|
40
42
|
}
|
|
41
43
|
}
|