pointer visible
This commit is contained in:
parent
3049634e2a
commit
d4d205ab46
|
@ -8,7 +8,7 @@
|
|||
body {
|
||||
font-family: 'Montserrat';
|
||||
user-select: none;
|
||||
cursor: none;
|
||||
// cursor: none;
|
||||
}
|
||||
|
||||
a[href] {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
Quaternion, Euler, SRGBColorSpace
|
||||
} from 'three';
|
||||
|
||||
import { useTresContext, useSeek, useLoop } from '@tresjs/core';
|
||||
import { useTresContext, useSeek, useLoop, TresControl } from '@tresjs/core';
|
||||
// @ts-ignore
|
||||
import { useGLTF, useGLTFExporter } from '@tresjs/cientos'
|
||||
|
||||
|
@ -311,6 +311,7 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
const { onBeforeRender } = useLoop()
|
||||
onBeforeRender(() => {
|
||||
clickable_refs.value.map(el => {
|
||||
el.value[0].visible = (camera.value?.position?.y as number) < raw_dataStore.data.min_distance ? false : true;
|
||||
if (el.value[0] && el.value[0].children) {
|
||||
el.value[0].children[0].lookAt(camera.value?.position);
|
||||
el.value[0].children[0].rotateX(90 * (Math.PI / 180));
|
||||
|
@ -411,6 +412,7 @@ const clickEvent = (event: MouseEvent) => {
|
|||
const clickable_objects = seekAllByName(scene.value, '_clickable');
|
||||
const intersects = raycaster.value.intersectObjects(clickable_objects);
|
||||
const names = intersects
|
||||
.filter(el => (el.object.parent ? el.object.parent.visible : el.object.visible))
|
||||
.map(el => (el.object.parent ? el.object.parent.name : el.object.name) ?? false)
|
||||
.filter(Boolean)
|
||||
if (names.length) {
|
||||
|
@ -418,7 +420,7 @@ const clickEvent = (event: MouseEvent) => {
|
|||
sidebar.toggleAccordion('clickable')
|
||||
}
|
||||
}
|
||||
const timerEvent = ['click', 'contextmenu', 'mousedown', 'mouseup', 'touchstart', 'touchend', 'touchmove']
|
||||
const timerEvent = ['click', 'contextmenu', 'mousedown', 'mouseup', 'touchstart', 'touchend', 'touchmove', 'scroll']
|
||||
onMounted(() => {
|
||||
console.log('mount')
|
||||
clearValues()
|
||||
|
|
Loading…
Reference in New Issue