controller.vwf.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. ## The component representation of a scale behavior (on move)
  14. ##
  15. ## @name blockly/controller.vwf
  16. ## @namespace
  17. ---
  18. extends:
  19. http://vwf.example.com/node3/animation.vwf
  20. properties:
  21. blockly_executing: false
  22. blockly_xml: "<xml></xml>"
  23. blockly_code:
  24. set: |
  25. if ( this.blockly_code != value ) {
  26. this.blockly_code = value;
  27. this.blocklyCodeChanged( value );
  28. }
  29. value: 0
  30. blockly_topBlockCount:
  31. set: |
  32. if ( this.blockly_topBlockCount != value ) {
  33. this.blockly_topBlockCount = value;
  34. this.topBlockCountChanged( value );
  35. }
  36. value: 0
  37. blockly_blockCount:
  38. set: |
  39. if ( this.blockly_blockCount != value ) {
  40. this.blockly_blockCount = value;
  41. this.blockCountChanged( value );
  42. }
  43. value: 0
  44. blockly_allowedBlocks:
  45. set: |
  46. if ( this.blockly_allowedBlocks != value ) {
  47. this.blockly_allowedBlocks = value;
  48. this.allowedBlocksChanged( value );
  49. }
  50. value: 20
  51. blockly_toolbox:
  52. blockly_defaultXml:
  53. methods:
  54. getWorldXYVector:
  55. blocklyClear:
  56. events:
  57. blocklyStarted:
  58. blocklyExecuted:
  59. blocklyErrored:
  60. blocklyStopped:
  61. blocklyBlockAdded:
  62. blocklyBlockRemoved:
  63. blocklyCodeChanged:
  64. topBlockCountChanged:
  65. blockCountChanged:
  66. allowedBlocksChanged:
  67. blocklyVisibleChanged:
  68. scripts:
  69. - |
  70. this.getWorldXYVector = function( x, y ) {
  71. var dir = goog.vec.Vec3.create();
  72. var moveVectorInCameraFrame = goog.vec.Vec4.createFromValues( x, y, 0, 1 );
  73. var camWorldRotMat = goog.vec.Mat4.createFromArray( this.worldTransform );
  74. camWorldRotMat[ 12 ] = 0;
  75. camWorldRotMat[ 13 ] = 0;
  76. camWorldRotMat[ 14 ] = 0;
  77. dir = goog.vec.Mat4.multVec4( camWorldRotMat, moveVectorInCameraFrame, dir );
  78. dir[ 2 ] = 0;
  79. goog.vec.Vec3.normalize( dir, dir );
  80. return dir;
  81. } //@ sourceURL=blockly-controller.vwf