Skip to content
Merged
Changes from 1 commit
Commits
File filter

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
Decouple look-controls and scene camera
  • Loading branch information
olga-microsoft committed Aug 29, 2017
commit cd29160ac6280f9ec2a18fe361ebfc717bcb429f
6 changes: 3 additions & 3 deletions src/components/look-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ module.exports.Component = registerComponent('look-controls', {
* Return user height to use for standing poses, where a device doesn't provide an offset.
*/
getUserHeight: function () {
var headEl = this.el.sceneEl.camera.el;
var headCamera = headEl.components.camera;
return (headCamera ? headCamera.data.userHeight : 0) || DEFAULT_CAMERA_HEIGHT;
var el = this.el;
var userHeight = el.hasAttribute('camera') && el.getAttribute('camera').userHeight || DEFAULT_CAMERA_HEIGHT;
return userHeight;
},

play: function () {
Expand Down