Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a91ea0e
add background updating options and remove copy position from the cam…
AdaRoseCannon Jul 19, 2021
bd0f3b3
add ar-hit-test
AdaRoseCannon Jul 27, 2021
3ac2007
tweak events
AdaRoseCannon Jul 28, 2021
72e39cd
add new events to docs
AdaRoseCannon Jul 28, 2021
22665f3
remove ar-hit-test script from example because this includes it in AF…
AdaRoseCannon Jul 29, 2021
75c65ee
add shadow shader and select-start event
AdaRoseCannon Jul 30, 2021
6c3504a
correct the lighting direction
AdaRoseCannon Jul 30, 2021
5321189
demonstrate AR shadows in example
AdaRoseCannon Jul 30, 2021
9ba5f58
fix offset reticle
AdaRoseCannon Aug 4, 2021
fcf70dc
add support for anchors
AdaRoseCannon Aug 5, 2021
af0fb7d
fix camera rotation issue
AdaRoseCannon Aug 10, 2021
498df40
update docs
AdaRoseCannon Aug 10, 2021
1be4dc0
Use ar-hit-test instead of bringing it's own
AdaRoseCannon Aug 10, 2021
a2823cd
Merge branch 'master' of https://github.com/aframevr/aframe into ar-h…
AdaRoseCannon Aug 11, 2021
c40f4d2
remove git mistake
AdaRoseCannon Aug 11, 2021
aa8905b
Merge branch 'master' of https://github.com/aframevr/aframe into ar-h…
AdaRoseCannon Aug 11, 2021
d9badf7
PR Feedback
AdaRoseCannon Aug 16, 2021
fb16806
add some comments
AdaRoseCannon Aug 16, 2021
08588f9
update webxr to automatically include optional features
AdaRoseCannon Aug 17, 2021
9c90934
remove unnesacary removeEventListener since duplicate event listeners…
AdaRoseCannon Aug 20, 2021
cd290ff
make more robust for targets without meshes
AdaRoseCannon Aug 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add shadow shader and select-start event
  • Loading branch information
AdaRoseCannon committed Aug 11, 2021
commit 75c65ee0cb697643c0b3b12826d0d7866b15ec12
6 changes: 6 additions & 0 deletions src/components/scene/ar-hit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ module.exports.Component = register('ar-hit-test', {
this.bboxMesh.visible = true;

if (this.hasPosedOnce === true) {
this.el.emit('ar-hit-test-select-start', {
inputSource: inputSource,
position: this.bboxMesh.position,
orientation: this.bboxMesh.quaternion
});

if (inputSource.profiles[0] === profileToSupport) {
this.hitTest = transientHitTest;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/shaders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ require('./standard');
require('./sdf');
require('./msdf');
require('./ios10hls');
require('./shadow');
29 changes: 29 additions & 0 deletions src/shaders/shadow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var registerShader = require('../core/shader').registerShader;
var THREE = require('../lib/three');

/**
* Flat shader using THREE.ShadowMaterial.
*/
module.exports.Shader = registerShader('shadow', {
schema: {
opacity: {default: 0.5},
transparent: {default: true},
alphaToCoverage: {default: true}
},

/**
* Initializes the shader.
* Adds a reference from the scene to this entity as the camera.
*/
init: function (data) {
this.rendererSystem = this.el.sceneEl.systems.renderer;
this.material = new THREE.ShadowMaterial();
},

update: function (data) {
this.material.opacity = data.opacity;
this.material.alphaToCoverage = data.alphaToCoverage;
this.material.transparent = data.transparent;
}
});