diff --git a/src/components/InteractiveObjects/CharacterObject.vue b/src/components/InteractiveObjects/CharacterObject.vue index 17f7ee2..22df998 100644 --- a/src/components/InteractiveObjects/CharacterObject.vue +++ b/src/components/InteractiveObjects/CharacterObject.vue @@ -28,6 +28,7 @@ export default { assignCharacter(e){ this.modelValue.go = e.id; this.modelValue.title = e.name + this.modelValue.exclude = true } } } diff --git a/src/components/InteractiveObjects/GenenricObject.js b/src/components/InteractiveObjects/GenenricObject.js index 719caac..e059fc6 100644 --- a/src/components/InteractiveObjects/GenenricObject.js +++ b/src/components/InteractiveObjects/GenenricObject.js @@ -1,5 +1,5 @@ import { getBoundingBox, getBoundingBoxCenterPoint, getBoundingBoxMaxLength, centerOrigin } from "@/lib/MeshUtils"; -import { EventDispatcher } from "three"; +import { EventDispatcher, SphereGeometry, Mesh, MeshStandardMaterial, BackSide } from "three"; class GenericObject extends EventDispatcher{ constructor(engine, data){ @@ -9,6 +9,20 @@ class GenericObject extends EventDispatcher{ this.object = centerOrigin(this.source.scene) if (!data.exclude){ + const bckGeometry = new SphereGeometry(getBoundingBoxMaxLength(this.object.userData.bbox)/2,8,8) + const bckMesh = new Mesh(bckGeometry, new MeshStandardMaterial({ + transparent: true, + opacity:1, color: 0xaaaaaa, + alphaMap: await engine.loadTexture('locked.webp', '/static/textures/'), + })) + this.object.add(bckMesh) + engine.motionQueue.add( + { o: bckMesh, a:{ + material: { opacity: k=>0.11 + 0.52*Math.sin(k*Math.PI)}, + rotation: { y: k=>k*Math.PI*2}, + scale: (k,s)=>s.setScalar(1+0.11*Math.sin(2*k*Math.PI)) + }, r: true, t: 3 }, + ) engine.clickable.add(this.object, async e=>{ this.object._active = !this.object._active; if (engine.dashboard){ diff --git a/src/components/InteractiveObjects/Particles.vue b/src/components/InteractiveObjects/Particles.vue index 3112fd5..8286cdd 100644 --- a/src/components/InteractiveObjects/Particles.vue +++ b/src/components/InteractiveObjects/Particles.vue @@ -1,18 +1,16 @@