camera.vwf.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  2. # Secretary of Defense (Personnel & Readiness).
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. # in compliance with the License. You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software distributed under the License
  10. # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. # or implied. See the License for the specific language governing permissions and limitations under
  12. # the License.
  13. ## Cesium sun component
  14. ##
  15. ## @name sun.vwf
  16. ## @namespace
  17. ---
  18. extends: http://vwf.example.com/cesium/node3.vwf
  19. properties:
  20. direction: [ 0, 0.8944271909999159, -0.4472135954999579 ]
  21. fovy:
  22. near: 1.0
  23. far: 500000000.0
  24. position: [ 0, -14261947.901806576, 7130973.950903288 ]
  25. right: [ 0.9999999999999999, 0, 0 ]
  26. transform: [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]
  27. up: [ 0, 0.4472135954999579, 0.8944271909999159 ]
  28. methods:
  29. resetCamera:
  30. scripts:
  31. - |
  32. this.initialize = function() {
  33. this.originalLocation = {
  34. "direction": this.direction,
  35. "position": this.position,
  36. "up": this.up,
  37. "right": this.right
  38. }
  39. }
  40. this.findScene = function( node ) {
  41. var scene = node.parent;
  42. while ( scene.parent && scene.parent.parent ) {
  43. scene = scene.parent;
  44. }
  45. return scene;
  46. }
  47. this.resetCamera = function() {
  48. if ( this.originalLocation ) {
  49. this.position = this.originalLocation.position;
  50. this.direction = this.originalLocation.direction;
  51. this.up = this.originalLocation.up;
  52. this.right = this.originalLocation.right;
  53. }
  54. this
  55. //var scene = this.findScene( this );
  56. //if ( scene && this.originalLocation ) {
  57. // scene.cameraViewData = this.originalLocation;
  58. //}
  59. } //@ sourceURL=cesium.camera.vwf