From 54ddef0e2a18d6856fbd54eca3e7406de5feb5ad Mon Sep 17 00:00:00 2001 From: jonathanharford Date: Sun, 5 Nov 2023 13:29:08 -0800 Subject: [PATCH 1/4] Aincraft: Finish aframe-blink-controls conversion --- docs/guides/building-a-minecraft-demo.md | 41 +++++++++++------------- examples/docs/aincraft/index.html | 27 ++++++++-------- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/guides/building-a-minecraft-demo.md b/docs/guides/building-a-minecraft-demo.md index 221e4c6a189..f8f00414355 100644 --- a/docs/guides/building-a-minecraft-demo.md +++ b/docs/guides/building-a-minecraft-demo.md @@ -382,26 +382,28 @@ teleport to the end of the arc. Before, we wrote our own A-Frame components. But we can also use open source components already made from the community and just use them straight from HTML! -[blink-controls]: https://github.com/fernandojsg/aframe-teleport-controls/ -For teleportation, there's a component called [blink-controls][blink-controls]. -Following the README, we add the component via a ` - - - - - - + + + + + ``` -Then we'll configure the `blink-controls` component to use an arc `type` of -teleportation. By default, `blink-controls` will only teleport on the -ground, but we can specify with `collisionEntities` to teleport on the blocks -*and* the ground using selectors. These properties are part of the API that the -`blink-controls` component was created with: +[blink-controls]: https://github.com/jure/aframe-blink-controls +For teleportation, there's a component called [blink-controls][blink-controls]. +Following the README, we add the component via a ` - - - - - ``` - Now when we pull the trigger button on the tracked controllers, `laser-controls` will emit a `click` event on both the controller and the entity it is intersecting at the time. Events such as `mouseenter`, diff --git a/examples/docs/aincraft/index.html b/examples/docs/aincraft/index.html index 24807874c4e..d295ded1f2a 100644 --- a/examples/docs/aincraft/index.html +++ b/examples/docs/aincraft/index.html @@ -27,19 +27,20 @@ - - - - - - - - + + + + + + + + + From 2c7f916821a16c6122ebe9517bd90fff2b6af4e3 Mon Sep 17 00:00:00 2001 From: jonathanharford Date: Sun, 5 Nov 2023 13:34:03 -0800 Subject: [PATCH 2/4] Aincraft: add buffer to block-spawning raycaster I can't tell if this is reasonably necessary or a workaround for a bug, but these changes got the scene to work for me. --- docs/guides/building-a-minecraft-demo.md | 8 ++++---- examples/docs/aincraft/index.html | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/guides/building-a-minecraft-demo.md b/docs/guides/building-a-minecraft-demo.md index f8f00414355..502a0beca83 100644 --- a/docs/guides/building-a-minecraft-demo.md +++ b/docs/guides/building-a-minecraft-demo.md @@ -472,10 +472,11 @@ To generalize creating entities from an intersection event, we've created an of properties. We won't go into the detail of the implementation, but you can [check out the simple `intersection-spawn` component source code on GitHub][intersection-spawn]. We attach `intersection-spawn` capabilities to the -right hand: +right hand, and it's also a good idea to give the raycaster a half-meter buffer +to prevent voxels from spawning right at the controller: ```html - + ``` Now when we click, we spawn voxels! @@ -490,8 +491,7 @@ component with the gaze-based `cursor` component so that we can also spawn blocks on mobile and desktop, without changing a thing about the component! ```html - - + diff --git a/examples/docs/aincraft/index.html b/examples/docs/aincraft/index.html index d295ded1f2a..11248fc60eb 100644 --- a/examples/docs/aincraft/index.html +++ b/examples/docs/aincraft/index.html @@ -35,11 +35,13 @@ - + + From b73fe8c520cba48540327461fd6b67714339c1a1 Mon Sep 17 00:00:00 2001 From: jonathanharford Date: Mon, 6 Nov 2023 14:01:23 -0800 Subject: [PATCH 3/4] Aincraft tutorial: tighten up player entity desc --- docs/guides/building-a-minecraft-demo.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/guides/building-a-minecraft-demo.md b/docs/guides/building-a-minecraft-demo.md index 502a0beca83..f2770af5d0e 100644 --- a/docs/guides/building-a-minecraft-demo.md +++ b/docs/guides/building-a-minecraft-demo.md @@ -376,18 +376,20 @@ and placing blocks. ### Adding Teleportation to the Left Hand -We'll plug in teleportation capabilities to the left hand such that we hold a -button to show an arc coming out of the controller, and let go of the button to -teleport to the end of the arc. Before, we wrote our own A-Frame components. -But we can also use open source components already made from the community -and just use them straight from HTML! +We'll plug in teleportation capabilities to the left hand such that we push a +thumbstick to show an arc coming out of the controller, and let go of the +thumbstick to teleport to the end of the arc. Before, we wrote our own A-Frame +components. But we can also use open source components already made from the +community and just use them straight from HTML! + +To enable this, let's first define a `player` entity that wraps the controllers +and the camera: + +```html + -Even though we haven't explicity defined one, our scene has an implicit camera -component from which the user views the scene. Since teleporting is going to be -moving this camera along with the player, we'll need to make it explicit and -part of the player: + -```html From 0b4089548041516afe2e84a70b0e8f1e2641f27f Mon Sep 17 00:00:00 2001 From: jonathanharford Date: Mon, 6 Nov 2023 16:09:58 -0800 Subject: [PATCH 4/4] Aincraft tutorial: Readd aframe tag & context to examples --- docs/guides/building-a-minecraft-demo.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/guides/building-a-minecraft-demo.md b/docs/guides/building-a-minecraft-demo.md index f2770af5d0e..9e4ec8d384a 100644 --- a/docs/guides/building-a-minecraft-demo.md +++ b/docs/guides/building-a-minecraft-demo.md @@ -400,7 +400,20 @@ and the camera: [blink-controls]: https://github.com/jure/aframe-blink-controls For teleportation, there's a component called [blink-controls][blink-controls]. Following the README, we add the component via a ` + + + + + + + + + +``` By default, `blink-controls` will only teleport on the ground, but we can specify with `collisionEntities` to teleport on the blocks *and* the ground @@ -429,9 +442,16 @@ that attaches the clicking laser to VR tracked controllers. Like the `laser-controls` component. This time to the right hand: ```html + + + + + + ``` + Now when we pull the trigger button on the tracked controllers, `laser-controls` will emit a `click` event on both the controller and the entity it is intersecting at the time. Events such as `mouseenter`,