diff --git a/src/assets/interactables/duck/DuckyMesh.glb b/src/assets/interactables/duck/DuckyMesh.glb deleted file mode 100644 index f50dc37942d519c36e16a5e41bb8a44a18c4c7f1..0000000000000000000000000000000000000000 Binary files a/src/assets/interactables/duck/DuckyMesh.glb and /dev/null differ diff --git a/src/assets/interactables/duck/gltf/DuckyMesh.fbm/Ducky.jpg b/src/assets/interactables/duck/gltf/DuckyMesh.fbm/Ducky.jpg deleted file mode 100644 index 6c27845f40d1e4b91ddb5534c413f408580ed51e..0000000000000000000000000000000000000000 Binary files a/src/assets/interactables/duck/gltf/DuckyMesh.fbm/Ducky.jpg and /dev/null differ diff --git a/src/assets/interactables/duck/gltf/DuckyMesh.gltf b/src/assets/interactables/duck/gltf/DuckyMesh.gltf deleted file mode 100644 index 83cc03646480c7cec3849fda0a8fd3580cec3abc..0000000000000000000000000000000000000000 --- a/src/assets/interactables/duck/gltf/DuckyMesh.gltf +++ /dev/null @@ -1,248 +0,0 @@ -{ - "asset": { - "generator": "FBX2glTF", - "version": "2.0" - }, - "scene": 0, - "buffers": [ - { - "byteLength": 18600, - "uri": "buffer.bin" - } - ], - "bufferViews": [ - { - "buffer": 0, - "byteLength": 3336, - "byteOffset": 0, - "target": 34963 - }, - { - "buffer": 0, - "byteLength": 5724, - "byteOffset": 3336, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 5724, - "byteOffset": 9060, - "target": 34962 - }, - { - "buffer": 0, - "byteLength": 3816, - "byteOffset": 14784, - "target": 34962 - } - ], - "scenes": [ - { - "name": "Root Scene", - "nodes": [ - 0 - ], - "extras": { - "components": { - "shape": [ - { - "shape": "box", - "halfExtents": { - "x": 0.06, - "y": 0.04, - "z": 0.08 - }, - "offset": { - "x": 0, - "y": 0.052671334114334445, - "z": 0.01001389278835843 - }, - "orientation": { - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "shape": "sphere", - "radius": 0.05, - "offset": { - "x": 0, - "y": 0.1287570519589527, - "z": 0.033095376412929145 - }, - "orientation": { - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "shape": "cylinder", - "radiusTop": 0.02, - "radiusBottom": 0.02, - "height": 0.030000000000000013, - "numSegments": 8, - "offset": { - "x": 0, - "y": 0.12657048237702667, - "z": 0.09010837508332667 - }, - "orientation": { - "x": 0.7071067811865476, - "y": 0, - "z": 0, - "w": 0.7071067811865475 - } - } - ] - } - } - } - ], - "accessors": [ - { - "componentType": 5123, - "type": "SCALAR", - "count": 1668, - "bufferView": 0, - "byteOffset": 0 - }, - { - "componentType": 5126, - "type": "VEC3", - "count": 477, - "bufferView": 1, - "byteOffset": 0, - "min": [ - -0.0587991699576378, - 0.0129461474716663, - -0.0740185976028442 - ], - "max": [ - 0.0618169121444225, - 0.173104390501976, - 0.104356855154037 - ] - }, - { - "componentType": 5126, - "type": "VEC3", - "count": 477, - "bufferView": 2, - "byteOffset": 0 - }, - { - "componentType": 5126, - "type": "VEC2", - "count": 477, - "bufferView": 3, - "byteOffset": 0 - } - ], - "images": [ - { - "name": "DuckyMesh.fbm/Ducky.jpg", - "uri": "DuckyMesh.fbm/Ducky.jpg" - } - ], - "samplers": [ - {} - ], - "textures": [ - { - "name": "file4", - "sampler": 0, - "source": 0 - } - ], - "materials": [ - { - "name": "lambert2", - "alphaMode": "OPAQUE", - "extras": { - "fromFBX": { - "shadingModel": "Lambert", - "isTruePBR": false - } - }, - "pbrMetallicRoughness": { - "baseColorTexture": { - "index": 0, - "texCoord": 0 - }, - "baseColorFactor": [ - 0.800000011920929, - 0.800000011920929, - 0.800000011920929, - 1 - ], - "metallicFactor": 0.200000002980232, - "roughnessFactor": 0.800000011920929 - } - } - ], - "meshes": [ - { - "name": "Ducky", - "primitives": [ - { - "material": 0, - "mode": 4, - "attributes": { - "NORMAL": 2, - "POSITION": 1, - "TEXCOORD_0": 3 - }, - "indices": 0 - } - ] - } - ], - "nodes": [ - { - "name": "RootNode", - "translation": [ - 0, - 0, - 0 - ], - "rotation": [ - 0, - 0, - 0, - 1 - ], - "scale": [ - 1, - 1, - 1 - ], - "children": [ - 1 - ] - }, - { - "name": "Ducky", - "translation": [ - 0, - 0, - 0 - ], - "rotation": [ - 0, - 0, - 0, - 1 - ], - "scale": [ - 1, - 1, - 1 - ], - "mesh": 0 - } - ] -} \ No newline at end of file diff --git a/src/assets/interactables/duck/gltf/DuckyMesh.json b/src/assets/interactables/duck/gltf/DuckyMesh.json deleted file mode 100644 index 97b41944a2ca7e12e5e12cf4892d2534ef73e5b4..0000000000000000000000000000000000000000 --- a/src/assets/interactables/duck/gltf/DuckyMesh.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "scenes": { - "Root Scene": { - "shape": [ - { - "shape": "box", - "halfExtents": { - "x": 0.06, - "y": 0.04, - "z": 0.08 - }, - "offset": { - "x": 0, - "y": 0.052671334114334445, - "z": 0.01001389278835843 - }, - "orientation": { - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "shape": "sphere", - "radius": 0.05, - "offset": { - "x": 0, - "y": 0.1287570519589527, - "z": 0.033095376412929145 - }, - "orientation": { - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "shape": "cylinder", - "radiusTop": 0.02, - "radiusBottom": 0.02, - "height": 0.030000000000000013, - "numSegments": 8, - "offset": { - "x": 0, - "y": 0.12657048237702667, - "z": 0.09010837508332667 - }, - "orientation": { - "x": 0.7071067811865476, - "y": 0, - "z": 0, - "w": 0.7071067811865475 - } - } - ] - } - } -} diff --git a/src/assets/interactables/duck/gltf/buffer.bin b/src/assets/interactables/duck/gltf/buffer.bin deleted file mode 100644 index d7ed323e11aef0c4b2045dd8f2ddd34154244b84..0000000000000000000000000000000000000000 Binary files a/src/assets/interactables/duck/gltf/buffer.bin and /dev/null differ diff --git a/src/components/super-spawner.js b/src/components/super-spawner.js index 41e2d7aeabbe77f2dc0ba9b3821170fab9724db5..7bd554f5a5ae07026896c45f0a837f5fb7467be3 100644 --- a/src/components/super-spawner.js +++ b/src/components/super-spawner.js @@ -3,6 +3,8 @@ AFRAME.registerComponent("super-spawner", { template: { default: "" }, useCustomSpawnPosition: { default: false }, spawnPosition: { type: "vec3" }, + useCustomSpawnRotation: { default: false }, + spawnRotation: { type: "vec4" }, events: { default: ["cursor-grab", "action_grab"] }, spawnCooldown: { default: 1 } }, @@ -10,7 +12,6 @@ AFRAME.registerComponent("super-spawner", { init: function() { this.entities = new Map(); this.timeout = null; - this.defaultScale = this.el.getAttribute("scale").clone(); }, play: function() { @@ -21,10 +22,12 @@ AFRAME.registerComponent("super-spawner", { pause: function() { this.el.removeEventListener("grab-start", this.handleGrabStart); - clearTimeout(this.timeout); - this.timeout = null; - this.el.setAttribute("visible", true); - this.el.setAttribute("scale", this.defaultScale); + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + this.el.setAttribute("visible", true); + this.el.classList.add("interactable"); + } }, remove: function() { @@ -61,14 +64,16 @@ AFRAME.registerComponent("super-spawner", { const pos = this.data.useCustomSpawnPosition ? this.data.spawnPosition : this.el.getAttribute("position"); entity.setAttribute("position", pos); + const rot = this.data.useCustomSpawnRotation ? this.data.spawnRotation : this.el.getAttribute("rotation"); + entity.setAttribute("rotation", rot); this.el.sceneEl.appendChild(entity); if (this.data.spawnCooldown > 0) { this.el.setAttribute("visible", false); - this.el.setAttribute("scale", { x: 0.0001, y: 0.0001, z: 0.0001 }); + this.el.classList.remove("interactable"); this.timeout = setTimeout(() => { this.el.setAttribute("visible", true); - this.el.setAttribute("scale", this.defaultScale); + this.el.classList.add("interactable"); this.timeout = null; }, this.data.spawnCooldown * 1000); } diff --git a/src/hub.html b/src/hub.html index bfdf831d5d7e7d5221b2d8d13afcf15e8032c601..f3cf9e74cafbe3534906c63ab4480b08135088bd 100644 --- a/src/hub.html +++ b/src/hub.html @@ -62,7 +62,7 @@ <a-asset-item id="botwoody" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/bots/BotWoody_Avatar-0140485a23.gltf"></a-asset-item> <a-asset-item id="watch-model" response-type="arraybuffer" src="./assets/hud/watch.glb"></a-asset-item> - <a-asset-item id="interactable-duck" response-type="arraybuffer" src="./assets/interactables/duck/DuckyMesh.glb"></a-asset-item> + <a-asset-item id="interactable-duck" response-type="arraybuffer" src="https://asset-bundles-prod.reticulum.io/interactables/Ducky/DuckyMesh-438ff8e022.gltf"></a-asset-item> <a-asset-item id="quack" src="./assets/sfx/quack.mp3" response-type="arraybuffer" preload="auto"></a-asset-item> <a-asset-item id="specialquack" src="./assets/sfx/specialquack.mp3" response-type="arraybuffer" preload="auto"></a-asset-item> @@ -164,7 +164,6 @@ <template id="interactable-template"> <a-entity gltf-model-plus="src: #interactable-duck; inflate: true;" - scale="2 2 2" class="interactable" super-networked-interactable="counter: #counter; mass: 1;" body="type: dynamic; shape: none; mass: 1;"