-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update A-frame version and add Oculus Go controller support to A-blast #131
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
<meta name="description" content="A WebVR wave shooter game using A-Frame by Mozilla VR."> | ||
<meta name="theme-color" content="#3d4d55"> | ||
<!--<script src="vendor/aframe-master.min.js"></script>--> | ||
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script> | ||
<script src="https://rawgit.com/aframevr/aframe/3e7a4b3/dist/aframe-master.min.js"></script> | ||
<script src="build/build.js"></script> | ||
<script src="vendor/aframe-bmfont-component.min.js"></script> | ||
<script src="assets/data/waves.js"></script> | ||
|
@@ -83,7 +83,7 @@ | |
></a-entity> | ||
|
||
<a-entity id="player" | ||
camera="userHeight: 1.6" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was taken out because the new version of A-frame warned that property |
||
camera | ||
wasd-controls | ||
look-controls | ||
restrict-position | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,7 +181,7 @@ AFRAME.registerComponent('bullet', { | |
} | ||
} else { | ||
// @hack Any better way to get the head position ? | ||
var head = this.el.sceneEl.camera.el.components['look-controls'].dolly.position; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
var head = this.el.sceneEl.camera.el.components['look-controls'].position; | ||
if (newBulletPosition.distanceTo(head) < 0.10 + bulletRadius) { | ||
this.hitObject('player'); | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,9 @@ AFRAME.registerComponent('weapon', { | |
|
||
updateWeapon: function () { | ||
console.log(this.controllerModel); | ||
if (this.controllerModel === 'oculus-touch-controller') { | ||
if (this.controllerModel === 'oculus-touch-controller' || | ||
this.controllerModel === 'oculus-go-controls' || | ||
this.controllerModel === 'gearvr-controls') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addresses #126 |
||
this.model.applyMatrix(new THREE.Matrix4().makeRotationAxis(new THREE.Vector3(1, 0, 0), 0.8)); | ||
this.el.setAttribute('shoot', {direction: '0 -0.3 -1'}); | ||
} else if (this.controllerModel === 'daydream-controls') { | ||
|
@@ -44,6 +46,7 @@ AFRAME.registerComponent('weapon', { | |
this.weapon = WEAPONS[ this.data.type ]; | ||
|
||
el.setAttribute('json-model', {src: this.weapon.model.url}); | ||
el.setAttribute('visible', false); | ||
|
||
el.setAttribute('sound', { | ||
src: this.weapon.shootSound, | ||
|
@@ -57,6 +60,7 @@ AFRAME.registerComponent('weapon', { | |
|
||
el.addEventListener('controllerconnected', function (evt) { | ||
console.log(evt); | ||
el.setAttribute('visible', true); | ||
self.controllerModel = evt.detail.name; | ||
if (self.model == null) { | ||
self.isGamepadConnected = true; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update to A-frame and THREE.js has some severe side-effects, including an audio problem
DOMException: Cannot decode detached ArrayBuffer
and graphical glitches.Attached is a screenshot of what it looks like for me. Strangely enough, once you go into VR, the graphical glitches disappear, but the high scores screen still is missing.