# Copyright 2012 United States Government, as represented by the Secretary of Defense, Under # Secretary of Defense (Personnel & Readiness). # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed under the License # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. See the License for the specific language governing permissions and limitations under # the License. ## The component representation of an editable node3 behavior ## ## @name node3edit.vwf ## @namespace --- extends: http://vwf.example.com/node3.vwf implements: - http://vwf.example.com/planarDrag.vwf methods: createGeometry: deleteGeometry: scripts: - | this.initialize = function() { //console.info( "initialize translateZPos.vwf id = " + this.id ); } this.createGeometry = function() { if ( this.parent.ttPoints ) { var pos = []; pos.push( this.parent.ttPositions[32][0] ); pos.push( this.parent.ttPositions[32][1] ); // 0 pos.push( this.parent.ttPositions[32][2] ); pos.push( this.parent.ttPositions[34][0] ); pos.push( this.parent.ttPositions[34][1] ); // 1 pos.push( this.parent.ttPositions[34][2] ); pos.push( this.parent.ttPositions[36][0] ); pos.push( this.parent.ttPositions[36][1] ); // 2 pos.push( this.parent.ttPositions[36][2] ); pos.push( this.parent.ttPositions[38][0] ); pos.push( this.parent.ttPositions[38][1] ); // 3 pos.push( this.parent.ttPositions[38][2] ); var surface = { "extends": "http://vwf.example.com/node3.vwf", "type": "mesh/definition", "children": { "material": { "extends": "http://vwf.example.com/material.vwf", "properties": { "transparent": true, "opacity": 0.25, }, }, }, "properties": { "meshDefinition": { "positions": pos, "faces": [ 0, 3, 1, 1, 3, 2 ], "color": [ 255, 255, 255 ], }, }, }; this.children.create( "translateZPositive", surface ); } } this.deleteGeometry = function() { if ( this.translateZPositive ) { this.children.delete( this.translateZPositive ); } } //@ sourceURL=translateZPos.vwf