From 342fb451bd251358068a0dcb10e9dc218b79a176 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 6 Mar 2012 11:38:39 -0800 Subject: Squashed commit of the following: commit 1cd89d4d06e3a8f2c221628b19cf26a2c69f5d3f Author: Jose Antonio Marquez Date: Tue Mar 6 11:24:25 2012 -0800 Fixing WebGL not available bug commit 84332ab81c1b445195f1d9be8bbeae0725c8e758 Author: Valerio Virgillito Date: Tue Mar 6 10:58:25 2012 -0800 Squashed commit of preload-fix into Master - Requiring all the previously pre-loaded files - RDGE, Codemirror and gl-matrix are not included via a script tag. Signed-off-by: Valerio Virgillito commit 13f52cf0c74f53a919fa864f86669e8155f82961 Merge: dced508 abc04f3 Author: Valerio Virgillito Date: Fri Mar 2 15:46:11 2012 -0800 Merge pull request #93 from imix23ways/Timeline Timeline: Critical bug fixes commit dced508bb19a7bcd467ff1b86b5df5bbec4be794 Merge: 0aeb400 cc772ef Author: Valerio Virgillito Date: Fri Mar 2 15:45:35 2012 -0800 Merge pull request #92 from mqg734/WebGLFixes Selection Tool Fixes for elements flying off into space when they overlap commit 0aeb400070762cf01d83cf9f9ee25a5595098b7f Merge: ff0a956 aabb48a Author: Valerio Virgillito Date: Fri Mar 2 14:05:21 2012 -0800 Merge pull request #94 from ericguzman/PresetsPanel Presets Panel - Fix single-click activation, and transition cut-off bug. commit cc772ef3333ed419d269a2bda7aea5b0150a7bd9 Author: Nivesh Rajbhandari Date: Fri Mar 2 11:34:58 2012 -0800 Fixing flying off into space bug for translate tool too. Signed-off-by: Nivesh Rajbhandari commit abc04f3d50311ed1c21067344bc7e448686f8c5c Author: Jonathan Duran Date: Fri Mar 2 11:26:25 2012 -0800 Timeline Fix timing function Signed-off-by: Jonathan Duran commit aabb48a1c8d34bc968f4c6b0ffee4e31c1d5d286 Author: Eric Guzman Date: Fri Mar 2 11:22:44 2012 -0800 Presets Panel - Fix single-click activation, and transition cut-off bug. Use double-click as the activation event for transition presets. Also fixed the bug when applying a style preset before the transition preset, which disabled transitions after the first one. commit f3207f39ea9d8c1c34246217a23d3a689671903d Author: Nivesh Rajbhandari Date: Fri Mar 2 11:21:29 2012 -0800 Don't draw transform handles if the stage is the target element. Signed-off-by: Nivesh Rajbhandari commit 5425be91e7125c22955b4459a62412ff574e49a8 Author: Jonathan Duran Date: Fri Mar 2 11:11:48 2012 -0800 Timeline: Fix for animation iteration count Add default webkit css properties to allow animations with integer iteration counts. Signed-off-by: Jonathan Duran commit 1760bac1da9218315ad1bacdcf3a157495a049e8 Author: Nivesh Rajbhandari Date: Fri Mar 2 10:48:41 2012 -0800 Fix for jumping issue when moving items that have any 3d on them. We can't translate 3d moves into 2d space due to perspective, so we must update the matrix3d values instead of the top-left values if items have 3d. Signed-off-by: Nivesh Rajbhandari commit 2c04935f0ccb1cb7c98371fc10b43155f2d956c4 Author: Nivesh Rajbhandari Date: Thu Mar 1 22:20:06 2012 -0800 Fix for elements flying off into space when moving elements that overlap. This was happening because our hit record's element and the browser's element from point did not match. Signed-off-by: Nivesh Rajbhandari commit 50058746779f714ed9b0287f49e56c9f0d35593e Merge: 500426d ff0a956 Author: Nivesh Rajbhandari Date: Thu Mar 1 21:49:44 2012 -0800 Merge branch 'refs/heads/ninja-internal' into WebGLFixes commit 500426dea0ca95a6b45be8ea8d132cfdb4d2c940 Author: Nivesh Rajbhandari Date: Thu Mar 1 10:11:39 2012 -0800 Fixed logic error when resizing with the top-left transform handles. Signed-off-by: Nivesh Rajbhandari commit 7980d9bde2b43aa5a494ddf6f1db5c4959a57b91 Author: Nivesh Rajbhandari Date: Thu Mar 1 10:04:15 2012 -0800 Re-fixing IKNinja-940 - Can't select objects when in side/top view. Signed-off-by: Nivesh Rajbhandari commit f04cc0146d8f7573628678613a99c270116768e4 Author: Nivesh Rajbhandari Date: Wed Feb 29 16:45:40 2012 -0800 Last-used material (instead of FlatMaterial) is applied to shape when turning on use WebGL checkbox in the PI. Signed-off-by: Nivesh Rajbhandari Signed-off-by: Jonathan Duran --- js/helper-classes/RDGE/GLLine.js | 507 --------------------------------------- 1 file changed, 507 deletions(-) delete mode 100755 js/helper-classes/RDGE/GLLine.js (limited to 'js/helper-classes/RDGE/GLLine.js') diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js deleted file mode 100755 index 65e6ab1c..00000000 --- a/js/helper-classes/RDGE/GLLine.js +++ /dev/null @@ -1,507 +0,0 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -/////////////////////////////////////////////////////////////////////// -// Class GLLine -// GL representation of a line. -// Derived from class GLGeomObj -/////////////////////////////////////////////////////////////////////// -function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj) -{ - // initialize the inherited members - this.inheritedFrom = GLGeomObj; - this.inheritedFrom(); - - /////////////////////////////////////////////////////////////////////// - // Instance variables - /////////////////////////////////////////////////////////////////////// - this._width = 2.0; - this._height = 2.0; - this._xOffset = 0; - this._yOffset = 0; - - // If line doesn't fit in canvas world, we had to grow the canvas by this much on either side - this._xAdj = 0; - this._yAdj = 0; - - this._slope = 0; - - this._strokeWidth = 0.25; - - this._strokeStyle = "Solid"; - this._scaleX = 1.0; - this._scaleY = 1.0; - - if (arguments.length > 0) - { - this._width = width; - this._height = height; - this._xOffset = xOffset; - this._yOffset = yOffset; - - this._xAdj = xAdj; - this._yAdj = yAdj; - - this._slope = slope; - this._strokeWidth = strokeSize; - if (strokeColor) this._strokeColor = strokeColor.slice(); - - this._strokeStyle = strokeStyle; - this._scaleX = (world.getViewportWidth())/(world.getViewportHeight()); - } - - this._strokeVerticesLen = 0; - - this.m_world = world; - - this._materialAmbient = [0.2, 0.2, 0.2, 1.0]; - this._materialDiffuse = [0.4, 0.4, 0.4, 1.0]; - this._materialSpecular = [0.4, 0.4, 0.4, 1.0]; - - if(strokeMaterial) - { - this._strokeMaterial = strokeMaterial; - } - - /////////////////////////////////////////////////////////////////////// - // Property Accessors - /////////////////////////////////////////////////////////////////////// - this.getStrokeWidth = function() { return this._strokeWidth; } - this.setStrokeWidth = function(w) { this._strokeWidth = w; } - - this.getStrokeMaterial = function() { return this._strokeMaterial; } - this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } - - this.getStrokeColor = function() { return this._strokeColor; } - //this.setStrokeColor = function(c) { this._strokeColor = c; } - - this.getStrokeStyle = function() { return this._strokeStyle; } - this.setStrokeStyle = function(s) { this._strokeStyle = s; } - - this.getFillMaterial = function() { return null; } - - this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } - this.getStrokeMaterial = function() { return this._strokeMaterial; } - - this.getWidth = function() { return this._width; } - this.setWidth = function(w) { this._width = w; } - - this.getHeight = function() { return this._height; } - this.setHeight = function(h) { this._height = h; } - - this.getXAdj = function() { return this._xAdj; } - this.setXAdj = function(x) { this._xAdj = x; } - - this.getYAdj = function() { return this._yAdj; } - this.setYAdj = function(y) { this._yAdj = y; } - - this.getSlope = function() { return this._slope; } - this.setSlope = function(m) { this._slope = m; } - - this.geomType = function() { return this.GEOM_TYPE_LINE; } - - /////////////////////////////////////////////////////////////////////// - // Methods - /////////////////////////////////////////////////////////////////////// - this.export = function() - { - var rtnStr = "type: " + this.geomType() + "\n"; - - rtnStr += "xoff: " + this._xOffset + "\n"; - rtnStr += "yoff: " + this._yOffset + "\n"; - rtnStr += "width: " + this._width + "\n"; - rtnStr += "height: " + this._height + "\n"; - rtnStr += "xAdj: " + this._xAdj + "\n"; - rtnStr += "yAdj: " + this._yAdj + "\n"; - rtnStr += "strokeWidth: " + this._strokeWidth + "\n"; - rtnStr += "strokeColor: " + String(this._strokeColor) + "\n"; - rtnStr += "strokeStyle: " + this._strokeStyle + "\n"; - rtnStr += "slope: " + String(this._slope) + "\n"; - - rtnStr += "strokeMat: "; - if (this._strokeMaterial) - rtnStr += this._strokeMaterial.getName(); - else - rtnStr += "flatMaterial"; - rtnStr += "\n"; - - return rtnStr; - } - - this.import = function( importStr ) - { - this._xOffset = Number( this.getPropertyFromString( "xoff: ", importStr ) ); - this._yOffset = Number( this.getPropertyFromString( "yoff: ", importStr ) ); - this._width = Number( this.getPropertyFromString( "width: ", importStr ) ); - this._height = Number( this.getPropertyFromString( "height: ", importStr ) ); - this._xAdj = Number( this.getPropertyFromString( "xAdj: ", importStr ) ); - this._yAdj = Number( this.getPropertyFromString( "yAdj: ", importStr ) ); - this._strokeWidth = Number( this.getPropertyFromString( "strokeWidth: ", importStr ) ); - var slope = this.getPropertyFromString( "slope: ", importStr ); - if(isNaN(Number(slope))) - this._slope = slope; - else - this._slope = Number(slope); - - var strokeMaterialName = this.getPropertyFromString( "strokeMat: ", importStr ); - this._strokeStyle = this.getPropertyFromString( "strokeStyle: ", importStr ); - this._strokeColor = eval( "[" + this.getPropertyFromString( "strokeColor: ", importStr ) + "]" ); - - var strokeMat = MaterialsLibrary.getMaterial( strokeMaterialName ); - if (!strokeMat) - { - console.log( "object material not found in library: " + strokeMaterialName ); - strokeMat = new FlatMaterial(); - } - this._strokeMaterial = strokeMat; - - } - - /////////////////////////////////////////////////////////////////////// - // Methods - /////////////////////////////////////////////////////////////////////// - this.buildBuffers = function() - { - // get the world - var world = this.getWorld(); - if (!world) throw( "null world in buildBuffers" ); - if (!world._useWebGL) return; - - // make sure RDGE has the correct context - g_Engine.setContext( world.getCanvas().rdgeid ); - - // create the gl buffer - var gl = world.getGLContext(); - - this._strokeVerticesLen = 0; - - var strokeVertices = []; - var strokeTextures = []; - var strokeNormals = []; - var strokeColors = []; - -// var scaleMat = Matrix.I(3); -// scaleMat.elements[0][0] = this._scaleX; -// scaleMat.elements[1][1] = this._scaleY; - - -// get the normalized device coordinates (NDC) for - // all position and dimensions. - var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); - var xNDC = 2*this._xOffset/vpw, yNDC = 2*this._yOffset/vph, - xFillNDC = this._width/vpw, yFillNDC = this._height/vph, - xAdjNDC = this._xAdj/vpw, yAdjNDC = this._yAdj/vph, - xStrokeNDC = this._strokeWidth/vpw, yStrokeNDC = this._strokeWidth/vph; - - var aspect = world.getAspect(); - var zn = world.getZNear(), zf = world.getZFar(); - var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), - b = -t, - r = aspect*t, - l = -r; - - // calculate the object coordinates from their NDC coordinates - var z = -world.getViewDistance(); - - // get the position of the origin - var x = -z*(r-l)/(2.0*zn)*xNDC, - y = -z*(t-b)/(2.0*zn)*yNDC; - - // get the x and y fill - var xFill = -z*(r-l)/(2.0*zn)*xFillNDC, - yFill = -z*(t-b)/(2.0*zn)*yFillNDC; - - // get the x & y stroke size - var xStroke = -z*(r-l)/(2.0*zn)*xStrokeNDC, - yStroke = -z*(t-b)/(2.0*zn)*yStrokeNDC; - - // get the x & y adjustments size - var xAdj = -z*(r-l)/(2.0*zn)*xAdjNDC*2, - yAdj = -z*(t-b)/(2.0*zn)*yAdjNDC*2; - - - this._primArray = []; - this._materialArray = []; - this._materialTypeArray = []; - this._materialNodeArray = []; - - this._scaleX = (world._viewportWidth)/(world._viewportHeight); - - var innerX = xFill-xStroke; - var innerY = yFill-yStroke; - - if(this._slope === "vertical") - { - strokeVertices = [ - -xFill+x, yFill+y, 0.0, - xFill+x, yFill+y, 0.0, - -xFill+x, -yFill+y, 0.0, - - xFill+x, -yFill+y, 0.0, - -xFill+x, -yFill+y, 0.0, - xFill+x, yFill+y, 0.0 - ]; - - strokeTextures = [ - 0, 1, - 1, 1, - 0, 0, - - 1, 0, - 0, 0, - 1, 1 - ]; - } - else if(this._slope === "horizontal") - { - // right now, this is the same as vertical line because, - // our canvas is the same size as us. - // But, we will need to use this when drawing in an existing GLWorld with other shapes - strokeVertices = [ - -xFill+x, yFill+y, 0.0, - xFill+x, yFill+y, 0.0, - -xFill+x, -yFill+y, 0.0, - - xFill+x, -yFill+y, 0.0, - -xFill+x, -yFill+y, 0.0, - xFill+x, yFill+y, 0.0 - ]; - - strokeTextures = [ - 0, 1, - 1, 1, - 0, 0, - - 1, 0, - 0, 0, - 1, 1 - ]; - } - else if(this._slope > 0) - { - // if slope is positive, draw a line from top-left to bottom-right - strokeVertices = [ - -xFill+x, yFill-2*yAdj+y, 0.0, - -xFill+2*xAdj+x, yFill+y, 0.0, - xFill-2*xAdj+x, -yFill+y, 0.0, - - xFill+x, -yFill+2*yAdj+y, 0.0, - xFill-2*xAdj+x, -yFill+y, 0.0, - -xFill+2*xAdj+x, yFill+y, 0.0 - ]; - - strokeTextures = [ - 0, 0, - 0, 1, - 1, 0, - - 1, 1, - 1, 0, - 0, 1 - ]; - } - else - { - // else slope is negative, draw a line from bottom-left to top-right - strokeVertices = [ - xFill-2*xAdj+x, yFill+y, 0.0, - -xFill+2*xAdj+x, -yFill+y, 0.0, - -xFill+x, -yFill+2*yAdj+y, 0.0, - - -xFill+2*xAdj+x, -yFill+y, 0.0, - xFill-2*xAdj+x, yFill+y, 0.0, - xFill+x, yFill-2*yAdj+y, 0.0 - ]; - - strokeTextures = [ - 1, 1, - 0, 0, - 0, 1, - - 0, 0, - 1, 1, - 1, 0 - ]; - } - - var z = 0; - var indices = []; - var nVerts = strokeVertices.length/3; - - // stroke normals - var index = 0; - for (var i=0; i 0) - { - p0 = [this._xAdj, this._yAdj]; - p1 = [w - this._xAdj, h - this._yAdj]; - } - else - { - p0 = [this._xAdj, h - this._yAdj]; - p1 = [w - this._xAdj, this._yAdj]; - } - - // draw the line - ctx.moveTo( p0[0], p0[1] ); - ctx.lineTo( p1[0], p1[1] ); - ctx.stroke(); - } - } - - - /* - // type is Dotted or Dashed - this.createStippledStrokes = function(strokeVertices, strokeSize, slope, type, innerX, innerY) - { - var stippleLength = strokeSize; - - if (type === "Dotted") - { - stippleLength = this.DOT_LENGTH; - } - else if(type === "Dashed") - { - stippleLength = this.DASH_LENGTH; - } - - var numStrokes = 0; - var startPos = -innerX; - var endPos = innerX; - - var gap = this.GAP_LENGTH; - if(slope === "horizontal") - { - gap *= this._scaleX; - stippleLength *= this._scaleX; - } - else if(slope === "vertical") - { - startPos = -innerY; - endPos = innerY; - } - else - { - if(this._scaleX < 1) - { - startPos = -innerY; - endPos = innerY; - strokeSize = (strokeSize*this._scaleX)/2; -// strokeSize *= this._scaleX; - stippleLength *= this._scaleX; - } - else - { - strokeSize = strokeSize/2; - gap *= this._scaleX; - stippleLength *= this._scaleX; - } - - } - - while(startPos + stippleLength < endPos) - { - if(slope === "horizontal") - { - strokeVertices.push(startPos); strokeVertices.push(-strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos); strokeVertices.push(strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push(-strokeSize); strokeVertices.push(0); - - strokeVertices.push(startPos); strokeVertices.push(strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push(-strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push(strokeSize); strokeVertices.push(0); - } - else if(slope === "vertical") - { - strokeVertices.push(-strokeSize); strokeVertices.push(startPos); strokeVertices.push(0); - strokeVertices.push(strokeSize); strokeVertices.push(startPos); strokeVertices.push(0); - strokeVertices.push(-strokeSize); strokeVertices.push(startPos+stippleLength); strokeVertices.push(0); - - strokeVertices.push(strokeSize); strokeVertices.push(startPos); strokeVertices.push(0); - strokeVertices.push(-strokeSize); strokeVertices.push(startPos+stippleLength); strokeVertices.push(0); - strokeVertices.push(strokeSize); strokeVertices.push(startPos+stippleLength); strokeVertices.push(0); - } - else - { - strokeVertices.push(startPos); strokeVertices.push(startPos*-slope-strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos); strokeVertices.push(startPos*-slope+strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push((startPos+stippleLength)*-slope-strokeSize); strokeVertices.push(0); - - strokeVertices.push(startPos); strokeVertices.push(startPos*-slope+strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push((startPos+stippleLength)*-slope-strokeSize); strokeVertices.push(0); - strokeVertices.push(startPos+stippleLength); strokeVertices.push((startPos+stippleLength)*-slope+strokeSize); strokeVertices.push(0); - } - - numStrokes += 6; - - startPos += (stippleLength+gap); - } -// - return numStrokes; - } - */ - - this.collidesWithPoint = function( x, y ) - { - if(x < this._xOffset) return false; - if(x > (this._xOffset + this._width)) return false; - if(y < this._yOffset) return false; - if(y > (this._yOffset + this._height)) return false; - - return true; - } - - } - - -- cgit v1.2.3