offsetcamera.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. this.initialize = function () {
  2. }
  3. this.createCamera = function () {
  4. var fullHeight = this.parent.fullHeight;
  5. if (!fullHeight) {
  6. fullHeight = this.fullHeight;
  7. }
  8. var fullWidth = this.parent.fullWidth;
  9. if (!fullWidth) {
  10. fullWidth = this.fullWidth;
  11. }
  12. var newNode = {
  13. "extends": "http://vwf.example.com/aframe/abox.vwf",
  14. "properties": {
  15. "position": [0, 0, 0],
  16. "depth": 0.2,
  17. "height": 0.2,
  18. "width": 0.2,
  19. "color": "red"
  20. },
  21. children: {
  22. cam: {
  23. "extends": "http://vwf.example.com/aframe/acamera.vwf",
  24. "properties": {
  25. "look-controls-enabled": false,
  26. "wasd-controls-enabled": false,
  27. "user-height": 0
  28. },
  29. children: {
  30. viewoffset: {
  31. extends: "http://vwf.example.com/aframe/viewOffsetCamera-component.vwf",
  32. properties: {
  33. fullWidth: fullWidth,
  34. fullHeight: fullHeight,
  35. xoffset: this.xoffset,
  36. yoffset: this.yoffset,
  37. subcamWidth: this. subcamWidth,
  38. subcamHeight: this. subcamHeight
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. this.children.create("cameraNode", newNode);
  46. }