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