offsetcamera.js 827 B

123456789101112131415161718192021222324252627282930
  1. this.initialize = function () {
  2. }
  3. this.createCamera = function (fw, fh, xoffset, yoffset, subcamWidth, subcamHeight) {
  4. let cameraNode = {
  5. "extends": "proxy/aframe/acamera.vwf",
  6. "properties": {
  7. "look-controls-enabled": false,
  8. "wasd-controls-enabled": false,
  9. "user-height": 0
  10. },
  11. children: {
  12. viewoffset: {
  13. extends: "proxy/aframe/viewOffsetCamera-component.vwf",
  14. properties: {
  15. fullWidth: fw,
  16. fullHeight: fh,
  17. xoffset: xoffset,
  18. yoffset: yoffset,
  19. subcamWidth: subcamWidth,
  20. subcamHeight: subcamHeight
  21. }
  22. }
  23. }
  24. }
  25. this.children.create("cam", cameraNode);
  26. }