translateYPos.vwf.yaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 an editable node3 behavior
  14. ##
  15. ## @name node3edit.vwf
  16. ## @namespace
  17. ---
  18. extends: http://vwf.example.com/node3.vwf
  19. implements:
  20. - http://vwf.example.com/planarDrag.vwf
  21. methods:
  22. createGeometry:
  23. deleteGeometry:
  24. scripts:
  25. - |
  26. this.initialize = function() {
  27. //console.info( "initialize translateYPos.vwf id = " + this.id );
  28. }
  29. this.createGeometry = function() {
  30. if ( this.parent.ttPoints ) {
  31. var pos = [];
  32. pos.push( this.parent.ttPositions[48][0] );
  33. pos.push( this.parent.ttPositions[48][1] ); // 0
  34. pos.push( this.parent.ttPositions[48][2] );
  35. pos.push( this.parent.ttPositions[49][0] );
  36. pos.push( this.parent.ttPositions[49][1] ); // 1
  37. pos.push( this.parent.ttPositions[49][2] );
  38. pos.push( this.parent.ttPositions[50][0] );
  39. pos.push( this.parent.ttPositions[50][1] ); // 2
  40. pos.push( this.parent.ttPositions[50][2] );
  41. pos.push( this.parent.ttPositions[51][0] );
  42. pos.push( this.parent.ttPositions[51][1] ); // 3
  43. pos.push( this.parent.ttPositions[51][2] );
  44. var surface = {
  45. "extends": "http://vwf.example.com/node3.vwf",
  46. "type": "mesh/definition",
  47. "children": {
  48. "material": {
  49. "extends": "http://vwf.example.com/material.vwf",
  50. "properties": {
  51. "transparent": true,
  52. "opacity": 0.25,
  53. },
  54. },
  55. },
  56. "properties": {
  57. "meshDefinition": { "positions": pos, "faces": [ 0, 3, 1, 1, 3, 2 ], "color": [ 255, 255, 255 ], },
  58. },
  59. };
  60. this.children.create( "translateYPositive", surface );
  61. }
  62. }
  63. this.deleteGeometry = function() {
  64. if ( this.translateYPositive ) {
  65. this.children.delete( this.translateYPositive );
  66. }
  67. } //@ sourceURL=translateYPos.vwf