bx-1379-redesign #15
Binary file not shown.
Binary file not shown.
|
@ -59,9 +59,7 @@ const itemStore = useItem();
|
||||||
const { controls, camera, scene, raycaster, renderer } = useTresContext()
|
const { controls, camera, scene, raycaster, renderer } = useTresContext()
|
||||||
const { seekByName, seekAllByName } = useSeek()
|
const { seekByName, seekAllByName } = useSeek()
|
||||||
|
|
||||||
const pointerTexture = await useTexture({
|
const { scene: point_mesh_obj } = await useGLTF((await import('../../assets/pointer/point-v1.glb')).default)
|
||||||
map: '/pointer_texture.png'
|
|
||||||
})
|
|
||||||
|
|
||||||
const set_moveto = (obj: smooth, value: Vector3 | Quaternion | undefined) => {
|
const set_moveto = (obj: smooth, value: Vector3 | Quaternion | undefined) => {
|
||||||
obj.value = value
|
obj.value = value
|
||||||
|
@ -179,27 +177,11 @@ const loadModels = async () => {
|
||||||
(find_element as Mesh).localToWorld(world_position);
|
(find_element as Mesh).localToWorld(world_position);
|
||||||
|
|
||||||
const p = raw_dataStore.data.min_distance * 0.05;
|
const p = raw_dataStore.data.min_distance * 0.05;
|
||||||
const name = index % 5
|
const point = point_mesh_obj.clone()
|
||||||
const fileTexture = await import(`../../assets/pointer/${name}.png`);
|
|
||||||
const pointerTexture = await useTexture({
|
|
||||||
map: fileTexture.default
|
|
||||||
})
|
|
||||||
|
|
||||||
const point_mesh = new Mesh(
|
|
||||||
new CircleGeometry(0.5, 32),
|
|
||||||
new MeshBasicMaterial({
|
|
||||||
color: new Color('#fff'),
|
|
||||||
map: pointerTexture.map,
|
|
||||||
transparent: true,
|
|
||||||
blending: AdditiveBlending
|
|
||||||
})
|
|
||||||
)
|
|
||||||
point_mesh.rotateX(-0.5 * Math.PI)
|
|
||||||
|
|
||||||
const point = new Group()
|
|
||||||
point.add(point_mesh)
|
|
||||||
|
|
||||||
point.position.set(world_position.x, p * 3, world_position.z * 2)
|
point.position.set(world_position.x, p * 3, world_position.z * 2)
|
||||||
|
|
||||||
|
point.updateMatrixWorld()
|
||||||
point.name = `${element.id}_clickable`
|
point.name = `${element.id}_clickable`
|
||||||
|
|
||||||
if (clickable_items.value.find(el => el.name == point.name)) continue
|
if (clickable_items.value.find(el => el.name == point.name)) continue
|
||||||
|
@ -314,7 +296,9 @@ const { onAfterRender } = useLoop()
|
||||||
onAfterRender(() => {
|
onAfterRender(() => {
|
||||||
clickable_refs.value.map(el => {
|
clickable_refs.value.map(el => {
|
||||||
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].rotateZ(15 * (Math.PI / 180));
|
||||||
|
|
||||||
const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position);
|
const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position);
|
||||||
if (dis_to_cam) {
|
if (dis_to_cam) {
|
||||||
|
|
Loading…
Reference in New Issue