fix issue elipsis
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { type GuideNode, useRegistry } from '@pascal-app/core'
|
||||
import { useLoader } from '@react-three/fiber'
|
||||
import { Suspense, useMemo, useRef } from 'react'
|
||||
import { DoubleSide, type Group, type Texture, TextureLoader } from 'three'
|
||||
import { float, texture } from 'three/tsl'
|
||||
import { MeshBasicNodeMaterial } from 'three/webgpu'
|
||||
import { useLoader } from '@react-three/fiber'
|
||||
import { useAssetUrl } from '../../../hooks/use-asset-url'
|
||||
|
||||
export const GuideRenderer = ({ node }: { node: GuideNode }) => {
|
||||
@@ -13,11 +13,7 @@ export const GuideRenderer = ({ node }: { node: GuideNode }) => {
|
||||
const resolvedUrl = useAssetUrl(node.url)
|
||||
|
||||
return (
|
||||
<group
|
||||
ref={ref}
|
||||
position={node.position}
|
||||
rotation={[0, node.rotation[1], 0]}
|
||||
>
|
||||
<group ref={ref} position={node.position} rotation={[0, node.rotation[1], 0]}>
|
||||
{resolvedUrl && (
|
||||
<Suspense>
|
||||
<GuidePlane url={resolvedUrl} scale={node.scale} opacity={node.opacity} />
|
||||
@@ -54,8 +50,13 @@ const GuidePlane = ({ url, scale, opacity }: { url: string; scale: number; opaci
|
||||
}, [tex, scale, opacity])
|
||||
|
||||
return (
|
||||
<mesh rotation={[-Math.PI / 2, 0, 0]} material={material}>
|
||||
<planeGeometry args={[width, height]} />
|
||||
<mesh
|
||||
rotation={[-Math.PI / 2, 0, 0]}
|
||||
material={material}
|
||||
raycast={() => {}}
|
||||
frustumCulled={false}
|
||||
>
|
||||
<planeGeometry args={[width, height]} boundingBox={null} boundingSphere={null} />
|
||||
</mesh>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { type ScanNode, useRegistry } from '@pascal-app/core'
|
||||
import { Clone } from '@react-three/drei/core/Clone'
|
||||
import { Suspense, useMemo, useRef } from 'react'
|
||||
import type { Group, Material, Mesh } from 'three'
|
||||
import { useAssetUrl } from '../../../hooks/use-asset-url'
|
||||
@@ -49,6 +48,14 @@ const ScanModel = ({ url, opacity }: { url: string; opacity: number }) => {
|
||||
if ((child as Mesh).isMesh) {
|
||||
const mesh = child as Mesh
|
||||
|
||||
// Disable raycasting
|
||||
mesh.raycast = () => {}
|
||||
|
||||
// Exclude from bounding box calculations
|
||||
mesh.geometry.boundingBox = null
|
||||
mesh.geometry.boundingSphere = null
|
||||
mesh.frustumCulled = false
|
||||
|
||||
if (Array.isArray(mesh.material)) {
|
||||
mesh.material.forEach((material) => {
|
||||
updateMaterial(material)
|
||||
@@ -60,5 +67,5 @@ const ScanModel = ({ url, opacity }: { url: string; opacity: number }) => {
|
||||
})
|
||||
}, [scene, opacity])
|
||||
|
||||
return <Clone object={scene} />
|
||||
return <primitive object={scene} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user