From petit at petitpub.com Mon Dec 1 10:49:22 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Mon, 01 Dec 2008 19:49:22 +0100 Subject: [Sandy] Another forum Message-ID: <20081201194922.h9w2adkkoowwcs8w@webmail.datakultur.com> Hi, Regarding this http://www.flashsandy.org/forum/viewtopic.php?f=9&t=1116&start=0&st=0&sk=t&sd=a Should we have Job offers forum? ( They might pour in :) From codesite-noreply at google.com Thu Dec 4 16:56:08 2008 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 05 Dec 2008 00:56:08 +0000 Subject: [Sandy] [sandy commit] r857 - trunk/sandy/haxe/trunk/src/sandy/parser Message-ID: <00151750db307eebf3045d42244a@google.com> Author: cyanescent Date: Thu Dec 4 16:55:13 2008 New Revision: 857 Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx Log: Re-implemented XML parsing logic to avoid xpath dependency: - '-lib xpath' is no longer needed on any example, new examples zip with new build files is forthcoming. - js filesize dropped considerably. - speedup of load-time by an order of magnitude for collada files, especially on the javascript target. Unfortunately, collada parsing is prone to errors - a better parser is needed in future. Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx Thu Dec 4 16:55:13 2008 @@ -60,9 +60,7 @@ import sandy.util.LoaderQueue; import sandy.util.NumberUtil; -import xpath.XPath; -import xpath.xml.XPathHxXml; -import xpath.xml.XPathXml; +import haxe.xml.Fast; /** * Transforms a COLLADA XML document into Sandy geometries. @@ -75,9 +73,7 @@ * * * @author Dennis Ippel - ippeldv - * @since 1.0 - * @version 3.0 - * @date 26.07.2007 + * @author Niel Drummond * * @example To parse a COLLADA object at runtime: * @@ -99,7 +95,7 @@ class ColladaParser extends AParser, implements IParser { - private var m_oCollada : XPathHxXml; + private var m_oCollada : haxe.xml.Fast; private var m_oUp:UpAxis; private var m_oMaterials : Hash; @@ -134,26 +130,26 @@ super.parseData( e ); // -- read the XML - m_oCollada = XPathHxXml.wrapNode( Xml.parse( m_oFile ) ); + m_oCollada = new haxe.xml.Fast( Xml.parse( m_oFile ).firstElement() ); - switch ( (new XPath('/COLLADA/asset/up_axis')).selectNode(m_oCollada).getStringValue() ) - { + var l_sAxis = m_oCollada.node.asset.node.up_axis.innerData; + switch ( l_sAxis ) { case "Y_UP": m_oUp = Y_UP; case "Z_UP": m_oUp = Z_UP; case "X_UP": m_oUp = X_UP; default: m_oUp = NONE; } - if( Lambda.count( (new XPath('/COLLADA/library_images')).selectNodes(m_oCollada)) > 0 ) - m_oMaterials = loadImages( new XPath('/COLLADA/library_images/image').selectNodes(m_oCollada)); + if( m_oCollada.hasNode.library_images ) + m_oMaterials = loadImages( m_oCollada.node.library_images.nodes.image ); else - parseScene( new XPath('/COLLADA/library_visual_scenes/visual_scene').selectNode(m_oCollada)); + parseScene( m_oCollada.node.library_visual_scenes.node.visual_scene ); } - private function parseScene( p_oScene : XPathXml ) : Void + private function parseScene( p_oScene : haxe.xml.Fast ) : Void { // -- local variables - var l_oNodes : Iterable = (new XPath('node')).selectNodes(p_oScene); + var l_oNodes : List = p_oScene.nodes.node; for( l_oN in l_oNodes ) { @@ -169,13 +165,13 @@ dispatchEvent( l_eOnInit ); } - private function parseNode( p_oNode : XPathXml ) : Node + private function parseNode( p_oNode : haxe.xml.Fast ) : Node { // -- local variables var l_oNode:ATransformable = null; //var l_oMatrix : Matrix4 = new Matrix4(); var l_sGeometryID : String; - var l_oNodes : Iterable; + var l_oNodes : List; var l_nNodeLen : Int; var l_oVector : Vector; //var l_oPivot:Vector = new Vector(); @@ -183,31 +179,31 @@ //var l_oScale : Transform3D; var i:Int; - if( Lambda.count( new XPath('./instance_geometry').selectNodes(p_oNode) ) != 0 ) + if( p_oNode.hasNode.instance_geometry ) { var l_aGeomArray:Array; var l_oAppearance : Appearance = m_oStandardAppearance; l_oGeometry = new Geometry3D(); l_oAppearance = getAppearance( p_oNode ); - l_aGeomArray = new XPath('instance_geometry/@url').selectNode(p_oNode).getStringValue().split( "#" ); + l_aGeomArray = p_oNode.node.instance_geometry.att.url.split( "#" ); l_sGeometryID = l_aGeomArray[ 1 ]; // -- get the vertices l_oGeometry = getGeometry( l_sGeometryID, m_oMaterials ); if( l_oGeometry == null ) return null; // -- create the new shape - l_oNode = new Shape3D( new XPath('@name').selectNode(p_oNode).getStringValue(), l_oGeometry, l_oAppearance ); + l_oNode = new Shape3D( p_oNode.att.name, l_oGeometry, l_oAppearance ); } else { - l_oNode = new TransformGroup( new XPath('@name').selectNode(p_oNode).getStringValue() ); + l_oNode = new TransformGroup( p_oNode.att.name ); } // -- scale - if( Lambda.count( new XPath( './scale' ).selectNodes(p_oNode) ) > 0 ) + if( p_oNode.hasNode.scale ) { - l_oVector = stringToVector( new XPath( './scale' ).selectNode(p_oNode).getStringValue() ); + l_oVector = stringToVector( p_oNode.node.scale.innerData ); // -- formatVector( l_oVector ); // -- @@ -217,21 +213,24 @@ } // -- translation - if( Lambda.count( new XPath( './translate' ).selectNodes(p_oNode) ) >= 1 ) + if( p_oNode.hasNode.translate ) { - var l_aTransAtt:Iterable = new XPath( './translate' ).selectNodes(p_oNode); + var l_aTransAtt:List = p_oNode.nodes.translate; for( l_oT in l_aTransAtt ) { var l_sTranslationValue:String = ""; // -- - var l_oAttTranslateNode:XPathXml = new XPath('./@sid').selectNode( l_oT ); + var l_oAttTranslateNode:String = null; var l_sAttTranslateValue:String = ""; - if( l_oAttTranslateNode != null ) l_sAttTranslateValue = l_oAttTranslateNode.getStringValue().toLowerCase(); + if( l_oT.has.sid ) { + l_oAttTranslateNode = l_oT.att.sid; + l_sAttTranslateValue = l_oAttTranslateNode.toLowerCase(); + } if( l_sAttTranslateValue == "translation" || l_sAttTranslateValue == "translate" ) - l_sTranslationValue = l_oT.getStringValue(); - else if( l_sAttTranslateValue.length == 0 ) - l_sTranslationValue = l_oT.getStringValue(); + l_sTranslationValue = l_oT.innerData; + else if( l_sAttTranslateValue.length == 0 ) + l_sTranslationValue = l_oT.innerData; if( l_sTranslationValue.length > 0 ) { @@ -248,31 +247,31 @@ } } // -- rotate - if( Lambda.count( new XPath( './rotate' ).selectNodes(p_oNode) ) == 1 ) + if( Lambda.count( p_oNode.nodes.rotate ) == 1 ) { - var l_oRotations : Array = stringToArray( new XPath( './rotate' ).selectNode(p_oNode).getStringValue() ); + var l_oRotations : Array = stringToArray( p_oNode.node.rotate.innerData ); - switch (m_oUp) + switch (m_oUp) { - case X_UP: + case X_UP: // not implemented - case Y_UP: + case Y_UP: l_oNode.rotateAxis( l_oRotations[ 0 ], l_oRotations[ 1 ], l_oRotations[ 2 ], l_oRotations[ 3 ] ); - case Z_UP: + case Z_UP: // not implemented case NONE: l_oNode.rotateAxis( l_oRotations[ 0 ], l_oRotations[ 2 ], l_oRotations[ 1 ], l_oRotations[ 3 ] ); } } - else if( Lambda.count( new XPath( './rotate' ).selectNodes(p_oNode) ) == 3 ) + else if( Lambda.count( p_oNode.nodes.rotate ) == 3 ) { - var l_oRotateNodes = (new XPath( './rotate' ).selectNodes(p_oNode)); + var l_oRotateNodes : List = p_oNode.nodes.rotate; for( l_oN in l_oRotateNodes ) { - var l_oRot : Array = stringToArray( l_oN.getStringValue() ); + var l_oRot : Array = stringToArray( l_oN.innerData ); - switch( new XPath('@sid').selectNode( l_oN ).getStringValue().toLowerCase() ) + switch( l_oN.att.sid.toLowerCase() ) { case "rotatex": { @@ -318,18 +317,13 @@ } // -- baked matrix - if( Lambda.count( new XPath( './matrix' ).selectNodes(p_oNode) ) > 0 ) + if( p_oNode.hasNode.matrix ) { - stringToMatrix( new XPath( './matrix' ).selectNode(p_oNode).getStringValue() ); - //l_oShape.setPosition( l_oMatrix.n14, l_oMatrix.n34, l_oMatrix.n24 ); - //l_oNode.scaleX = l_oMatrix.n11; - //l_oNode.scaleY = l_oMatrix.n33; - //l_oNode.scaleZ = l_oMatrix.n22; + stringToMatrix( p_oNode.node.matrix.innerData ); } // -- loop through subnodes - l_oNodes = new XPath( './node' ).selectNodes(p_oNode); - //l_nNodeLen = l_oNodes.length(); + l_oNodes = p_oNode.nodes.node; for( l_oN in l_oNodes ) { @@ -340,18 +334,20 @@ } // quick hack to get url-ed nodes parsed - if( Lambda.count( new XPath( './instance_node' ).selectNodes(p_oNode) ) != 0 ) + if( p_oNode.hasNode.instance_node ) { - var l_sNodeId:String = new XPath( 'instance_node/@url' ).selectNode(p_oNode).getStringValue(); + var l_sNodeId:String = p_oNode.node.instance_node.att.url; if ((l_sNodeId != "") && (l_sNodeId.charAt(0) == "#")) { l_sNodeId = l_sNodeId.substr(1); - var l_oMatchingNodes:Iterable = new XPath( '//library_nodes/node[ @id = "' + l_sNodeId + '"' ).selectNodes(m_oCollada); + var l_oMatchingNodes:List = m_oCollada.node.library_nodes.nodes.node; for ( l_oMatchingNode in l_oMatchingNodes ) { - var l_oNode3D:Node = parseNode( l_oMatchingNode ); - // -- add the shape to the group node - if( l_oNode3D != null ) - l_oNode.addChild( l_oNode3D ); + if ( l_oMatchingNode.att.id == l_sNodeId ) { + var l_oNode3D:Node = parseNode( l_oMatchingNode ); + // -- add the shape to the group node + if( l_oNode3D != null ) + l_oNode.addChild( l_oNode3D ); + } } } } @@ -364,22 +360,68 @@ { var i : Int; var l_oOutpGeom : Geometry3D = new Geometry3D(); - var l_oGeometry : XPathXml = new XPath( '/COLLADA/library_geometries/geometry[ ./@id = "' + p_sGeometryID + '" ]' ).selectNode( m_oCollada ); + var l_oGeometries : List = m_oCollada.node.library_geometries.nodes.geometry; + var l_oGeometry : haxe.xml.Fast = null; + + // -- parse geometry node + for ( l_oNode in l_oGeometries ) { + if ( l_oNode.att.id == p_sGeometryID ) { + if ( l_oGeometry == null ) + l_oGeometry = l_oNode; + } + } + if ( l_oGeometry == null ) return null; // -- triangles - var l_oTriangles : XPathXml = new XPath( './mesh/triangles' ).selectNode(l_oGeometry); + var l_oTriangles : haxe.xml.Fast = l_oGeometry.node.mesh.node.triangles; if( l_oTriangles == null ) return null; - var l_aTriangles : Array = stringToArray( new XPath( './p' ).selectNode(l_oTriangles).getStringValue() ); - var l_sMaterial : String = new XPath( './@material' ).selectNode(l_oTriangles).getStringValue(); - var l_nCount : Int = Std.parseInt( new XPath( './@count' ).selectNode(l_oTriangles).getStringValue() ); - var l_nStep : Int = Lambda.count( new XPath( './input' ).selectNodes(l_oTriangles) ); + var l_aTriangles : Array = stringToArray( l_oTriangles.node.p.innerData ); + var l_sMaterial : String = l_oTriangles.att.material; + var l_nCount : Int = Std.parseInt( l_oTriangles.att.count ); + var l_nStep : Int = Lambda.count( l_oTriangles.nodes.input ); + + // -- parse xml semantics + var l_sVerticesID : String = null; + var l_oTexCoord : haxe.xml.Fast = null; + var l_oNormal : haxe.xml.Fast = null; + var l_aInput = l_oTriangles.nodes.input; + for ( l_oInput in l_aInput ) { + switch (l_oInput.att.semantic) { + case "VERTEX": + if ( l_sVerticesID == null ) + l_sVerticesID = l_oInput.att.source.split("#")[1]; + case "TEXCOORD": + if ( l_oTexCoord == null ) + l_oTexCoord = l_oInput; + case "NORMAL": + if ( l_oNormal == null ) + l_oNormal = l_oInput; + default: + // log warning ? + } + } // -- get vertices float array - var l_sVerticesID : String = new XPath( './input[ ./@semantic = "VERTEX" ]/@source' ).selectNode(l_oTriangles).getStringValue().split("#")[1]; - var l_sPosSourceID : String = new XPath( './mesh/vertices[ ./@id = "' + l_sVerticesID + '"]/input[ ./@semantic = "POSITION" ]/@source' ).selectNode(l_oGeometry).getStringValue().split("#")[1]; + var l_sPosSourceID : String = null; + var l_aVertices = l_oGeometry.node.mesh.nodes.vertices; + + // -- check that the VerticesID was parsed correctly + if ( l_aVertices.length > 0 && l_sVerticesID == null ) return null; + + for ( l_oNode in l_aVertices ) { + if ( l_oNode.att.id == l_sVerticesID ) { + var l_aInput = l_oNode.nodes.input; + for ( l_oInput in l_aInput ) { + if ( l_oInput.att.semantic == "POSITION" ) { + if ( l_sPosSourceID == null ) + l_sPosSourceID = l_oInput.att.source.split("#")[1]; + } + } + } + } + var l_aVertexFloats : Array = getFloatArray( l_sPosSourceID, l_oGeometry ); var l_nVertexFloat : Int = l_aVertexFloats.length; - // -- set vertices for( i in 0...l_nVertexFloat ) { @@ -394,10 +436,10 @@ l_oVertex.z ); } - if( Lambda.count( new XPath( './input[ ./@semantic = "TEXCOORD" ]' ).selectNodes(l_oTriangles) ) > 0 ) + if( l_oTexCoord != null ) { // -- get uvcoords float array - var l_sUVCoordsID : String = new XPath( './input[ @semantic = "TEXCOORD" ]/@source' ).selectNode(l_oTriangles).getStringValue().split("#")[1]; + var l_sUVCoordsID : String = l_oTexCoord.att.source.split("#")[1]; var l_aUVCoordsFloats : Array = getFloatArray( l_sUVCoordsID, l_oGeometry ); var l_nUVCoordsFloats : Int = l_aUVCoordsFloats.length; @@ -412,9 +454,9 @@ // -- get normals float array // THOMAS TODO: Why using VertexNormal? It is face normal ! - if( Lambda.count( new XPath( './input[ @semantic = "NORMAL" ]' ).selectNodes(l_oTriangles) ) > 0 ) + if( l_oNormal != null ) { - var l_sNormalsID : String = new XPath( './input[ @semantic = "NORMAL" ]/@source' ).selectNode(l_oTriangles).getStringValue().split("#")[1]; + var l_sNormalsID : String = l_oNormal.att.source.split("#")[1]; var l_aNormalFloats : Array = getFloatArray( l_sNormalsID, l_oGeometry ); var l_nNormalFloats : Int = l_aNormalFloats.length; @@ -429,7 +471,9 @@ } } - var l_aTrianglez:Array>> = convertTriangleArray( new XPath( './input' ).selectNodes(l_oTriangles), l_aTriangles, l_nCount ); + + + var l_aTrianglez:Array>> = convertTriangleArray( l_oTriangles.nodes.input, l_aTriangles, l_nCount ); var l_nTriangeLength : Int = l_aTrianglez.length; for( i in 0...l_nTriangeLength ) @@ -445,12 +489,22 @@ return l_oOutpGeom; } - private function getFloatArray( p_sSourceID : String, p_oGeometry : XPathXml ) : Array + private function getFloatArray( p_sSourceID : String, p_oGeometry : haxe.xml.Fast ) : Array { - //var l_aFloatArray : Array = new XPath( './/..source/.( @id == p_sSourceID ).float_array ).selectNode(p_oGeometry).getStringValue().split(/\s+/); - var l_aFloatArray : Array = new XPath( './/source[ @id = "' + p_sSourceID + '" ]/float_array' ).selectNode(p_oGeometry).getStringValue().split(" "); - var l_nCount:Int = Std.parseInt( new XPath( './/source[ @id = "' + p_sSourceID + '"]/technique_common/accessor/@count' ).selectNode(p_oGeometry).getStringValue() ); - var l_nOffset:Int = Std.parseInt( new XPath( './/source[ @id = "' + p_sSourceID + '"]/technique_common/accessor/@stride' ).selectNode(p_oGeometry).getStringValue() ); + var l_aSources : List = p_oGeometry.node.mesh.nodes.source; + var l_oSource : haxe.xml.Fast = null; + for ( l_oNode in l_aSources ) + { + if ( l_oNode.att.id == p_sSourceID ) { + l_oSource = l_oNode; + break; + } + } + if ( l_oSource == null ) return null; + + var l_aFloatArray : Array = l_oSource.node.float_array.innerData.split(" "); + var l_nCount:Int = Std.parseInt( l_oSource.node.technique_common.node.accessor.att.count ); + var l_nOffset:Int = Std.parseInt( l_oSource.node.technique_common.node.accessor.att.stride ); var l_nFloatArray : Int = l_aFloatArray.length; var l_aOutput : Array = new Array(); @@ -478,23 +532,21 @@ return l_aOutput; } - private function convertTriangleArray( p_oInput : Iterable, p_aTriangles : Array, p_nTriangleCount : Int ) : Array>> + private function convertTriangleArray( p_oInput : List, p_aTriangles : Array, p_nTriangleCount : Int ) : Array>> { var l_nTriangles : Int = p_aTriangles.length; var l_aOutput : Array>> = new Array(); var l_nValuesPerTriangle : Int = Std.int( l_nTriangles / p_nTriangleCount ); var l_nMaxOffset : Int = 0; - var l_aInputA:Array = Lambda.array(p_oInput); - var l_aInputB:Array = l_aInputA.copy(); + var l_aInputA:Array = Lambda.array(p_oInput); + var l_aInputB:Array = l_aInputA.copy(); for( l_oI in l_aInputA ) { - l_nMaxOffset = Std.int( Math.max( l_nMaxOffset, Std.parseFloat( new XPath( './@offset' ).selectNode(l_oI).getStringValue() ) ) ); + l_nMaxOffset = Std.int( Math.max( l_nMaxOffset, Std.parseFloat( l_oI.att.offset ) ) ); } l_nMaxOffset += 1; // -- iterate through all triangles - var l_oSemantic:XPath = new XPath( './@semantic' ); - var l_oOffset:XPath = new XPath( './@offset' ); for( i in 0...p_nTriangleCount ) { var semantic : Hash> = new Hash(); @@ -503,13 +555,15 @@ { for( l_oI in l_aInputB ) { - if( Std.parseInt( l_oOffset.selectNode( l_oI ).getStringValue() ) == j % l_nMaxOffset ) + var l_oSemantic:String = l_oI.att.semantic; + var l_oOffset:String = l_oI.att.offset; + if( Std.parseInt( l_oOffset ) == j % l_nMaxOffset ) { - if( semantic.get( l_oSemantic.selectNode(l_oI).getStringValue() ) == null ) - semantic.set( l_oSemantic.selectNode(l_oI).getStringValue(), new Array() ); + if( semantic.get( l_oSemantic ) == null ) + semantic.set( l_oSemantic, new Array() ); var index:Int = ( i * l_nValuesPerTriangle ) + j; - semantic.get( l_oSemantic.selectNode(l_oI).getStringValue() ).push( p_aTriangles[ index ] ); + semantic.get( l_oSemantic ).push( p_aTriangles[ index ] ); } } } @@ -582,46 +636,125 @@ } } - private function getAppearance( p_oNode : XPathXml ) : Appearance + private function getAppearance( p_oNode : haxe.xml.Fast ) : Appearance { // -- local variables var l_oAppearance : Appearance = null; // -- Get this node's instance materials - var l_oMaterials = (new XPath( './/instance_material' ).selectNodes(p_oNode)); + var l_aInstance : List = p_oNode.nodes.instance_geometry; + var l_aBind : List = null; + var l_aTechnique : List = null; + var l_oMaterials : Array = []; + for ( l_oInstance in l_aInstance ) { + l_aBind = l_oInstance.nodes.bind_material; + for ( l_oBind in l_aBind ) { + l_aTechnique = l_oBind.nodes.technique_common; + for ( l_oTechnique in l_aTechnique ) { + var l_aMaterials = l_oTechnique.nodes.instance_material; + for ( l_oMaterial in l_aMaterials ) + l_oMaterials.push( l_oMaterial ); + } + } + } for ( l_oInstMat in l_oMaterials ) { // -- get the corresponding material from the library - var l_oMaterial : XPathXml = new XPath( '//library_materials/material[ ./@id = "' + new XPath( '@target' ).selectNode(l_oInstMat).getStringValue().split( "#" )[ 1 ] + '" ]' ).selectNode(m_oCollada); + var l_sId :String = l_oInstMat.att.target.split( "#" )[ 1 ]; + var l_oMaterial : haxe.xml.Fast = null; + var l_aMaterials : List = m_oCollada.node.library_materials.nodes.material; + for ( l_oNode in l_aMaterials ) { + if ( l_oNode.att.id == l_sId ) { + l_oMaterial = l_oNode; + break; + } + } + if ( l_oMaterial == null ) return null; // -- get the corresponding effect - var l_sEffectID : String = new XPath( './instance_effect/@url' ).selectNode(l_oMaterial).getStringValue().split( "#" )[ 1 ]; - - //? new XPath( './library_effects/effect//' ).selectNode(m_oCollada) - var l_oEffect : XPathXml = ( l_sEffectID == "" ) - ? new XPath( '//library_effects/effect/' ).selectNode(m_oCollada) - : new XPath( '//library_effects/effect[ ./@id = "' + l_sEffectID + '" ]' ).selectNode(m_oCollada); + var l_sEffectID : String = null; + try { + // am I mistaken, is there no way of knowing whether innerData is filled ? + l_sEffectID = l_oMaterial.node.instance_effect.innerData.split( "#" )[ 1 ]; + } catch (e:Dynamic) { + l_sEffectID = ""; + } + + var l_oEffect : haxe.xml.Fast = null; + if ( l_sEffectID == "" ) + { + l_oEffect = m_oCollada.node.library_effects.node.effect; + } else { + var l_aEffect : List = m_oCollada.node.library_effects.nodes.effect; + for ( l_oNode in l_aEffect ) { + if ( l_oNode.node.effect.att.id == l_sEffectID ) { + l_oEffect = l_oNode; + break; + } + } + } + if ( l_oEffect == null ) return null; + var l_oTechnique : haxe.xml.Fast; + var l_aTexture : Array = []; + var l_aPhong : Array = []; + var l_aTechnique : Array = []; + var l_oNode : haxe.xml.Fast = l_oEffect.node.profile_COMMON.node.technique; + switch (true) { + case l_oNode.hasNode.asset: + l_aTexture.push( l_oNode.node.asset.node.diffuse.node.texture ); + case l_oNode.hasNode.annotate: + l_aTexture.push( l_oNode.node.annotate.node.diffuse.node.texture ); + case l_oNode.hasNode.blinn: + l_aTexture.push( l_oNode.node.blinn.node.diffuse.node.texture ); + case l_oNode.hasNode.constant: + l_aTexture.push( l_oNode.node.constant.node.diffuse.node.texture ); + case l_oNode.hasNode.lambert: + l_aTexture.push( l_oNode.node.lambert.node.diffuse.node.texture ); + case l_oNode.hasNode.phong: + l_aTexture.push( l_oNode.node.phong.node.diffuse.node.texture ); + case l_oNode.hasNode.extra: + l_aTexture.push( l_oNode.node.extra.node.diffuse.node.texture ); + } + + var l_oNodes : List = l_oNode.nodes.phong; + for ( l_oPhong in l_oNodes ) { + l_aPhong.push( l_oPhong ); + } // -- no textures here or colors defined - if( Lambda.count( new XPath( './/texture' ).selectNodes(l_oEffect) ) == 0 && Lambda.count( new XPath( './/phong' ).selectNodes(l_oEffect) ) == 0 ) return m_oStandardAppearance; + if( l_aTexture.length == 0 && l_aPhong.length == 0 ) return m_oStandardAppearance; - if( Lambda.count( new XPath( './/texture' ).selectNodes(l_oEffect) ) > 0 ) + if( l_aTexture.length > 0 ) { // -- get the texture ID and use it to get the surface source - var l_sTextureID : String = new XPath( './/texture/@texture' ).selectNode(l_oEffect).getStringValue(); - var l_sSurfaceID : String = new XPath( './/newparam[ ./@sid = "' + l_sTextureID + '" ]/sampler2D/source' ).selectNode(l_oEffect).getStringValue(); + var l_sTextureID : String = l_aTexture[0].att.texture; + var l_aNewParam : List = l_oEffect.node.profile_COMMON.nodes.newparam; + var l_oNewParam : haxe.xml.Fast = null; + var l_sSurfaceID : String = null; + var l_sImageID : String = null; + for ( l_oNode in l_aNewParam ) { + if ( l_oNode.att.sid == l_sTextureID ) { + l_oNewParam = l_oNode; + l_sSurfaceID = l_oNewParam.node.sampler2D.node.source.innerData; + } + } + for ( l_oNode in l_aNewParam ) { + if ( l_oNode.att.sid == l_sSurfaceID ) { + l_oNewParam = l_oNode; + l_sImageID = l_oNewParam.node.surface.node.init_from.innerData; + } + } + if ( l_sImageID == null ) return null; // -- now get the image ID - var l_sImageID : String = new XPath( './/newparam[ ./@sid = "' + l_sSurfaceID + '" ]/surface/init_from' ).selectNode(l_oEffect).getStringValue(); // -- get image's location on the hard drive if( m_oMaterials.get( l_sImageID ).bitmapData != null) l_oAppearance = new Appearance( new BitmapMaterial( m_oMaterials.get( l_sImageID ).bitmapData ) ); if( l_oAppearance == null ) l_oAppearance = m_oStandardAppearance; } - else if( Lambda.count( new XPath( './/phong' ).selectNodes(l_oEffect) ) > 0 ) + else if( l_aPhong.length > 0 ) { // -- get the ambient color - //var l_aColors : Array = stringToArray( new XPath( './//phong/ambient/color' ).selectNode(l_oEffect).getStringValue() ); - var l_aColors : Array = stringToArray( new XPath( './/phong/ambient/color' ).selectNode(l_oEffect).getStringValue() ); + var l_aColors : Array = stringToArray( l_aPhong[0].node.ambient.node.color.innerData ); var l_nColor : Int; var r : Int = Std.int( NumberUtil.constrain( l_aColors[0] * 255, 0, 255 ) ); @@ -639,23 +772,24 @@ } - private function loadImages( p_oLibImages : Iterable ) : Hash + private function loadImages( p_oLibImages : List ) : Hash { var l_oImages : Hash = new Hash(); var l_oQueue : LoaderQueue = new LoaderQueue(); for ( l_oImage in p_oLibImages ) { - var l_oInitFrom : String = new XPath('init_from').selectNode(l_oImage).getStringValue(); - l_oImages.set( new XPath('@id').selectNode(l_oImage).getStringValue() , { + var l_oInitFrom : String = l_oImage.node.init_from.innerData; + var l_sId : String = l_oImage.att.id; + l_oImages.set( l_sId, { bitmapData: null, - id : new XPath('@id').selectNode(l_oImage).getStringValue(), + id : l_sId, fileName : l_oInitFrom.substr( l_oInitFrom.lastIndexOf( "/" ) + 1, l_oInitFrom.length ) }); l_oQueue.add( - new XPath('@id').selectNode(l_oImage).getStringValue(), - new URLRequest( RELATIVE_TEXTURE_PATH + "/" + l_oImages.get( new XPath('@id').selectNode(l_oImage).getStringValue() ).fileName ) + l_sId, + new URLRequest( RELATIVE_TEXTURE_PATH + "/" + l_oImages.get( l_sId ).fileName ) ); } l_oQueue.addEventListener( QueueEvent.QUEUE_COMPLETE, imageQueueCompleteHandler ); @@ -673,7 +807,7 @@ if( l_oLoader.loader.content != null && Reflect.hasField( l_oLoader.loader.content, "bitmapData" ) ) m_oMaterials.get( l_oLoader.name ).bitmapData = Reflect.field( l_oLoader.loader.content, "bitmapData" ); } - parseScene( new XPath('/COLLADA/library_visual_scenes/visual_scene').selectNode(m_oCollada) ); + parseScene( m_oCollada.node.library_visual_scenes.node.visual_scene ); } } From info at maxpellizzaro.com Fri Dec 5 02:52:53 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Fri, 05 Dec 2008 11:52:53 +0100 Subject: [Sandy] new parsing tutorial Message-ID: <49390805.3b6.78ff.911184094@webmaildh5.aruba.it> Hell all, while playing with the Parsing class I have found out that mack has implemented a cool functionality: automatic texture loading. Enough for me to set up a new tutorial :) http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut074 have fun. Max. From petit at petitpub.com Fri Dec 5 06:29:10 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Fri, 05 Dec 2008 15:29:10 +0100 Subject: [Sandy] new parsing tutorial In-Reply-To: <49390805.3b6.78ff.911184094@webmaildh5.aruba.it> References: <49390805.3b6.78ff.911184094@webmaildh5.aruba.it> Message-ID: <20081205152910.1jtu0p2lwc0oc4og@webmail.datakultur.com> Hey Max! Really fine tut! I couldn't fire though :) /P "info at maxpellizzaro.com" : says: > Hell all, > while playing with the Parsing class I have found out that > mack has implemented a cool functionality: automatic texture > loading. > Enough for me to set up a new tutorial :) > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut074 > > have fun. > Max. > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From makc.the.great at gmail.com Fri Dec 5 07:37:03 2008 From: makc.the.great at gmail.com (Makc) Date: Fri, 5 Dec 2008 17:37:03 +0200 Subject: [Sandy] new parsing tutorial In-Reply-To: <20081205152910.1jtu0p2lwc0oc4og@webmail.datakultur.com> References: <49390805.3b6.78ff.911184094@webmaildh5.aruba.it> <20081205152910.1jtu0p2lwc0oc4og@webmail.datakultur.com> Message-ID: <7a2c69bf0812050737x6cbb9a0fnb852478347e7888a@mail.gmail.com> did you check trigger lock? On Fri, Dec 5, 2008 at 4:29 PM, wrote: > Hey Max! > > Really fine tut! I couldn't fire though :) > /P > > "info at maxpellizzaro.com" : says: > >> Hell all, >> while playing with the Parsing class I have found out that >> mack has implemented a cool functionality: automatic texture >> loading. >> Enough for me to set up a new tutorial :) >> >> http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut074 >> >> have fun. >> Max. >> >> _______________________________________________ >> Sandy mailing list >> Sandy at osflash.org >> http://osflash.org/mailman/listinfo/sandy_osflash.org >> > > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From info at maxpellizzaro.com Fri Dec 5 10:42:27 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Fri, 05 Dec 2008 19:42:27 +0100 Subject: [Sandy] new tutorial... :) Message-ID: <49397613.394.2370.1174310908@webmaildh4.aruba.it> Hello guys, I planned this tutorials months ago, but I needed a method to get it done, and now it is ready :) I let you see what it is ... (petit, you can fire with this one!!). http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut26 Have fun. Max. From petit at petitpub.com Fri Dec 5 14:02:30 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Fri, 05 Dec 2008 23:02:30 +0100 Subject: [Sandy] new parsing tutorial In-Reply-To: <7a2c69bf0812050737x6cbb9a0fnb852478347e7888a@mail.gmail.com> References: <49390805.3b6.78ff.911184094@webmaildh5.aruba.it> <20081205152910.1jtu0p2lwc0oc4og@webmail.datakultur.com> <7a2c69bf0812050737x6cbb9a0fnb852478347e7888a@mail.gmail.com> Message-ID: <20081205230230.ewe8j1jt44g0go4s@webmail.datakultur.com> :D Makc : says: > did you check trigger lock? > > On Fri, Dec 5, 2008 at 4:29 PM, wrote: >> Hey Max! >> >> Really fine tut! I couldn't fire though :) >> /P >> >> "info at maxpellizzaro.com" : says: >> >>> Hell all, >>> while playing with the Parsing class I have found out that >>> mack has implemented a cool functionality: automatic texture >>> loading. >>> Enough for me to set up a new tutorial :) >>> >>> http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut074 >>> >>> have fun. >>> Max. >>> >>> _______________________________________________ >>> Sandy mailing list >>> Sandy at osflash.org >>> http://osflash.org/mailman/listinfo/sandy_osflash.org >>> >> >> >> >> _______________________________________________ >> Sandy mailing list >> Sandy at osflash.org >> http://osflash.org/mailman/listinfo/sandy_osflash.org >> > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From petit at petitpub.com Fri Dec 5 14:08:14 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Fri, 05 Dec 2008 23:08:14 +0100 Subject: [Sandy] new tutorial... :) In-Reply-To: <49397613.394.2370.1174310908@webmaildh4.aruba.it> References: <49397613.394.2370.1174310908@webmaildh4.aruba.it> Message-ID: <20081205230814.i43m72bx9s8oooww@webmail.datakultur.com> Ah, finally I got the power 8-) They are like Fenix beasts, rising from the ashes. Do I really have a chance to get rid of all of them? Amazing how blazingly fast you get answers in this gang Thanks! /P "info at maxpellizzaro.com" : says: > Hello guys, > I planned this tutorials months ago, but I needed a method > to get it done, and now it is ready :) > I let you see what it is ... > (petit, you can fire with this one!!). > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut26 > > Have fun. > Max. > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From protopop at sympatico.ca Fri Dec 5 18:02:52 2008 From: protopop at sympatico.ca (Robert Kabwe) Date: Fri, 05 Dec 2008 21:02:52 -0500 Subject: [Sandy] new tutorial... In-Reply-To: References: Message-ID: Very Cool! Its very 'game-ready'. > > > > ------------------------------------------------------------------------ > > Subject: > [Sandy] new tutorial... :) > From: > "info at maxpellizzaro.com" > Date: > Fri, 05 Dec 2008 19:42:27 +0100 > To: > sandy at osflash.org > > To: > sandy at osflash.org > > > Hello guys, > I planned this tutorials months ago, but I needed a method > to get it done, and now it is ready :) > I let you see what it is ... > (petit, you can fire with this one!!). > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut26 > > Have fun. > Max. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From creek23grupzer0 at yahoo.com Fri Dec 5 18:18:36 2008 From: creek23grupzer0 at yahoo.com (Mj Mendoza IV) Date: Fri, 5 Dec 2008 18:18:36 -0800 (PST) Subject: [Sandy] new tutorial... In-Reply-To: Message-ID: <768089.55417.qm@web35605.mail.mud.yahoo.com> Now that is something Sandy users can start their games with! Mj > Subject: > [Sandy] new tutorial... :) > From: > "info at maxpellizzaro.com" > Date: > Fri, 05 Dec 2008 19:42:27 +0100 > To: > sandy at osflash.org > > To: > sandy at osflash.org > > > Hello guys, > I planned this tutorials months ago, but I needed a method > to get it done, and now it is ready :) > I let you see what it is ... > (petit, you can fire with this one!!). > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut26 > > Have fun. > Max. From info at maxpellizzaro.com Sat Dec 6 01:15:37 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Sat, 06 Dec 2008 10:15:37 +0100 Subject: [Sandy] new tutorial... :) Message-ID: <493a42b9.52.20c2.963929967@webmaildh6.aruba.it> No there is no chanche to get rid of all of them, and you can never loose... It was just a tutorial, but I enjoyed build it :) Max. ----- Original Message ----- Da : petit at petitpub.com A : sandy at osflash.org Oggetto : Re: [Sandy] new tutorial... :) Data : Fri, 05 Dec 2008 23:08:14 +0100 > Ah, finally I got the power 8-) > > They are like Fenix beasts, rising from the ashes. > Do I really have a chance to get rid of all of them? > > Amazing how blazingly fast you get answers in this gang > Thanks! > /P > > "info at maxpellizzaro.com" : says: > > > Hello guys, > > I planned this tutorials months ago, but I needed a > > method to get it done, and now it is ready :) > > I let you see what it is ... > > (petit, you can fire with this one!!). > > > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut26 > > > > Have fun. > > Max. > > > > _______________________________________________ > > Sandy mailing list > > Sandy at osflash.org > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From kiroukou at gmail.com Sat Dec 6 04:57:38 2008 From: kiroukou at gmail.com (kiroukou) Date: Sat, 6 Dec 2008 13:57:38 +0100 Subject: [Sandy] [sandy commit] r856 - in trunk/sandy/haxe/trunk/src/sandy: core/data math In-Reply-To: <000e0cd6aa4c61aeb7045ce9d78c@google.com> References: <000e0cd6aa4c61aeb7045ce9d78c@google.com> Message-ID: How goes that haXe port so far? Thanks a lot to continue this effort btw. Thomas Le 30 nov. 08 ? 16:35, codesite-noreply at google.com a ?crit : > Author: cyanescent > Date: Sun Nov 30 07:35:02 2008 > New Revision: 856 > > Modified: > trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx > trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx > trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx > > Log: > Removing bad commit introduced in rev 853 > > Modified: trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx > = > = > = > = > = > = > = > = > ====================================================================== > --- trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx (original) > +++ trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx Sun Nov 30 > 07:35:02 2008 > @@ -57,9 +57,6 @@ > y = p_nY; > z = p_nZ; > > -#if flash10 > - prepare(); > -#end > } > > /** > @@ -131,29 +128,6 @@ > return Math.sqrt( x*x + y*y + z*z ); > } > > -#if flash10 > - public function getNormInvSqrt():Float > - { > - return invSqrt( x*x + y*y + z*z ); > - } > - public function prepare() { > - var b = new flash.utils.ByteArray(); > - b.length = 1024; > - flash.Memory.select(b); > - } > - > - public function invSqrt( x : Float ) : Float { > - var half = 0.5 * x; > - flash.Memory.setFloat(0,x); > - var i = flash.Memory.getI32(0); > - i = 0x5f3759df - (i>>1); > - flash.Memory.setI32(0,i); > - x = flash.Memory.getFloat(0); > - x = x * (1.5 - half*x*x); > - return x; > - } > -#end > - > /** > * Compute and returns the invers of this vector. > * > @@ -265,22 +239,12 @@ > public function normalize():Void > { > // -- We get the norm of the vector > -#if flash10 > - var norm:Float = getNormInvSqrt(); > -#else > var norm:Float = getNorm(); > -#end > // -- We escape the process is norm is null or equal to 1 > if( norm == 0 || norm == 1) return; > -#if flash10 > - x = x * norm; > - y = y * norm; > - z = z * norm; > -#else > x = x / norm; > y = y / norm; > z = z / norm; > -#end > } > > /** > @@ -313,13 +277,8 @@ > */ > public function getAngle ( w:Vector ):Float > { > -#if flash10 > - var n1:Float = getNormInvSqrt(); > - var n2:Float = w.getNormInvSqrt(); > -#else > var n1:Float = getNorm(); > var n2:Float = w.getNorm(); > -#end > var denom:Float = n1 * n2; > if( denom == 0 ) > { > @@ -327,11 +286,7 @@ > } > else > { > -#if flash10 > - var ncos:Float = dot( w ) * ( denom ); > -#else > var ncos:Float = dot( w ) / ( denom ); > -#end > var sin2:Float = 1 - (ncos * ncos); > if ( sin2 < 0 ) > { > > Modified: trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx > = > = > = > = > = > = > = > = > ====================================================================== > --- trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx (original) > +++ trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx Sun Nov 30 > 07:35:02 2008 > @@ -220,29 +220,6 @@ > { > return Math.sqrt( x*x + y*y + z*z ); > } > -#if flash10 > - public function getNormInvSqrt():Float > - { > - return invSqrt( x*x + y*y + z*z ); > - } > - public function prepare() { > - var b = new flash.utils.ByteArray(); > - b.length = 1024; > - flash.Memory.select(b); > - } > - > - public function invSqrt( x : Float ) : Float { > - var half = 0.5 * x; > - flash.Memory.setFloat(0,x); > - var i = flash.Memory.getI32(0); > - i = 0x5f3759df - (i>>1); > - flash.Memory.setI32(0,i); > - x = flash.Memory.getFloat(0); > - x = x * (1.5 - half*x*x); > - return x; > - } > -#end > - > > /** > * Return the invers of this vertex. > @@ -367,22 +344,9 @@ > public function normalize():Void > { > // -- We get the norm of the vector > -#if flash10 > - var norm:Float = getNormInvSqrt(); > -#else > var norm:Float = getNorm(); > -#end > // -- We escape the process is norm is null or equal to 1 > if( norm == 0 || norm == 1) return; > -#if flash10 > - x = x * norm; > - y = y * norm; > - z = z * norm; > - > - wx *= norm; > - wy *= norm; > - wz *= norm; > -#else > x = x / norm; > y = y / norm; > z = z / norm; > @@ -390,7 +354,6 @@ > wx /= norm; > wy /= norm; > wz /= norm; > -#end > > } > > @@ -402,11 +365,7 @@ > */ > public function getAngle ( w:Vertex ):Float > { > -#if flash10 > - var ncos:Float = dot( w ) * ( getNormInvSqrt() * > w.getNormInvSqrt() ); > -#else > var ncos:Float = dot( w ) / ( getNorm() * w.getNorm() ); > -#end > var sin2:Float = 1 - ncos * ncos; > if (sin2<0) > { > > Modified: trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx > = > = > = > = > = > = > = > = > ====================================================================== > --- trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx (original) > +++ trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx Sun Nov 30 > 07:35:02 2008 > @@ -39,29 +39,6 @@ > return Math.sqrt( p_oV.x*p_oV.x + p_oV.y*p_oV.y + p_oV.z*p_oV.z ); > } > > -#if flash10 > - public static inline function getNormInvSqrt( p_oV:Vector ):Float > - { > - return invSqrt( p_oV.x*p_oV.x + p_oV.y*p_oV.y + p_oV.z*p_oV.z ); > - } > - public static inline function prepare() { > - var b = new flash.utils.ByteArray(); > - b.length = 1024; > - flash.Memory.select(b); > - } > - > - public static inline function invSqrt( x : Float ) : Float { > - var half = 0.5 * x; > - flash.Memory.setFloat(0,x); > - var i = flash.Memory.getI32(0); > - i = 0x5f3759df - (i>>1); > - flash.Memory.setI32(0,i); > - x = flash.Memory.getFloat(0); > - x = x * (1.5 - half*x*x); > - return x; > - } > -#end > - > /** > * Computes the oposite vector of a specified 3D vector. > * > @@ -171,24 +148,14 @@ > public inline static function normalize( p_oV:Vector ): Bool > { > // -- We get the norm of the vector > -#if flash10 > - var norm:Float = VectorMath.getNormInvSqrt( p_oV ); > -#else > var norm:Float = VectorMath.getNorm( p_oV ); > -#end > // -- We escape the process is norm is null or equal to 1 > if( norm == 0 || norm == 1) { > return false; > } else { > -#if flash10 > - p_oV.x *= norm; > - p_oV.y *= norm; > - p_oV.z *= norm; > -#else > p_oV.x /= norm; > p_oV.y /= norm; > p_oV.z /= norm; > -#end > > return true; > } > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From codesite-noreply at google.com Sat Dec 6 05:52:48 2008 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sat, 06 Dec 2008 13:52:48 +0000 Subject: [Sandy] [sandy commit] r858 - trunk/sandy/haxe/trunk/src/sandy/events Message-ID: <000e0cd303bce48de7045d611bbb@google.com> Author: cyanescent Date: Sat Dec 6 05:52:28 2008 New Revision: 858 Modified: trunk/sandy/haxe/trunk/src/sandy/events/EventBroadcaster.hx Log: A rewrite of the EventBroadcaster, that is more type-friendly. Modified: trunk/sandy/haxe/trunk/src/sandy/events/EventBroadcaster.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/events/EventBroadcaster.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/events/EventBroadcaster.hx Sat Dec 6 05:52:28 2008 @@ -18,221 +18,93 @@ import flash.events.Event; -import sandy.commands.Delegate; +class EventListener +{ + public var mListner : Dynamic->Void; + static var sIDs = 1; + public var mID:Int; + + public function new(inListener) + { + mListner = inListener; + mID = sIDs++; + } + + public function Is(inListener) + { + return Reflect.compareMethods(mListner,inListener); + } + + public function dispatchEvent(event : Event) + { + mListner(event); + } +} + +typedef EventListenerList = Array; -/** - * Perhaps a dev can enlighten us ;) - * - * - */ -class EventBroadcaster +typedef EventMap = Hash; + +class EventBroadcaster { - private var m_oAll:Hash; - private var m_oType:Hash>; - private var m_oEventListener:Hash>; - private var m_oDelegateDico:Hash; - private var listeners:Array; - - public function new() - { - m_oAll = new Hash(); - m_oType = new Hash(); - m_oEventListener = new Hash(); - m_oDelegateDico = new Hash(); - } - - public function isRegistered(listener:Dynamic, ?type:String):Bool - { - if (type == null) - { - return m_oAll.get(listener); - } - else - { - if (m_oType.get(type) != null) - { - for (lElt in m_oType.get(type)) - { - if (lElt == listener) - { - return true; - } - } - - return false; - } - else - { - return false; - } - } - } - - public function removeListenerCollection(type:String):Void - { - m_oType.set(type, null); - } - - public function getListenerCollection(?type:String):Hash - { - return (type != null) ? m_oType.get(type) : m_oAll; - } - - public function addEventListener(type:String, listener:Dynamic, ?rest:Array):Bool - { - - if (Reflect.isFunction(listener)) - { - var d:Delegate = new Delegate(listener); - - if (rest != null) - { - d.setArgumentsArray(rest); - } - - m_oDelegateDico.set(Std.string(listener), d); - listener = d; - - } - else if (listener.hasOwnProperty(type) && (Reflect.isFunction(listener.get(type)))) - { - // - - } - else if (listener.hasOwnProperty("handleEvent") && Reflect.isFunction(listener.handleEvent)) - { - // - - } - else - { - return false; //ERROR CASE - } - - if (!isRegistered(listener)) - { - if ((m_oType.get(type) == null)) - { - m_oType.set(type, new Hash()); - } - // -- - var lDico:Hash = getListenerCollection(type); - - if (lDico.get(listener) == null) - { - lDico.set(listener, listener); - _storeRef(type, listener); - return true; - } - } - - return false; - } - - public function hasListenerCollection(type:String):Bool - { - return (m_oType.get(type) != null); - } - - public function removeEventListener(type:String, listener:Dynamic):Bool - { - if (hasListenerCollection(type)) - { - var c:Hash = getListenerCollection(type); - if (Reflect.isFunction(listener)) - { - listener = m_oDelegateDico.get(Std.string(listener)); - } - // -- - if (c.get(listener) != null) - { - _removeRef(type, listener); - if (isDicoEmpty(c)) - { - removeListenerCollection(type); - } - - c.remove(Std.string(listener)); - - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - public function broadcastEvent(e:Event):Void - { - if (hasListenerCollection(e.type)) - { - _broadcastEvent( getListenerCollection(e.type), e ); - } - // - if (!isDicoEmpty(m_oAll)) - { - _broadcastEvent(m_oAll, e); - } - } - - public function _broadcastEvent(c:Hash, e:Event):Void - { - var type:String = e.type; - - for (listener in c) - { - var f : Dynamic = null; - if (Reflect.hasField( listener, "get" ) ) f = listener.get(type); - - if (listener.hasOwnProperty(type) && Reflect.isFunction(f)) - { - f(e); - } - else if (listener.hasOwnProperty("handleEvent") && Reflect.isFunction(listener.handleEvent)) - { - listener.handleEvent(e); - - } - else - { - //ERROR - } - } - } - - private function _removeRef(type:String, listener:Dynamic):Void - { - var m:Hash = m_oEventListener.get(Std.string(listener)); - m.remove( type ); - - if (isDicoEmpty(m)) - { - m_oEventListener.remove( Std.string(listener) ); - } - } - - private function _storeRef(type:String, listener:Dynamic):Void - { - if (m_oEventListener.get(listener) == null) - { - m_oEventListener.set(listener, new Hash()); - } - m_oEventListener.get(Std.string(listener)).set(type, listener); - } - - private function isDicoEmpty(pDico:Hash):Bool - { - var i:Int = 0; - for (lElt in pDico) - { - i++; - } - return (i == 0); - } + var mEventMap : EventMap; + + public function new() : Void + { + mEventMap = new EventMap(); + } + + public function addEventListener(type:String, listener:Dynamic->Void):Bool + { + var list = mEventMap.get(type); + if (list==null) + { + list = new EventListenerList(); + mEventMap.set(type,list); + } + + var l = new EventListener(listener); + + for ( i in 0...list.length ) + if (list[i].mID == l.mID ) return false; + list.push(l); + + return true; + } + + public function broadcastEvent(event:Event):Void + { + var list = mEventMap.get(event.type); + if (list!=null) + { + for(i in 0...list.length) + { + var listener = list[i]; + listener.dispatchEvent(event); + } + } + } + + public function hasEventListener(type : String) + { + return mEventMap.exists(type); + } + + public function removeEventListener(type:String, listener:Dynamic->Void):Bool + { + if (!mEventMap.exists(type)) return false; + + var list = mEventMap.get(type); + for(i in 0...list.length) + { + if (list[i].Is(listener)) + { + list.splice(i,1); + return true; + } + } + return false; + } } + From codesite-noreply at google.com Sat Dec 6 05:56:48 2008 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sat, 06 Dec 2008 13:56:48 +0000 Subject: [Sandy] [sandy commit] r859 - in trunk/sandy/haxe/trunk/src/sandy: bounds core/scenegraph events materials materials/att... Message-ID: <000e0cd6aa4c352b75045d612a3b@google.com> Author: cyanescent Date: Sat Dec 6 05:53:14 2008 New Revision: 859 Modified: trunk/sandy/haxe/trunk/src/sandy/bounds/BBox.hx trunk/sandy/haxe/trunk/src/sandy/bounds/BSphere.hx trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/ATransformable.hx trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/Node.hx trunk/sandy/haxe/trunk/src/sandy/events/BubbleEvent.hx trunk/sandy/haxe/trunk/src/sandy/materials/Material.hx trunk/sandy/haxe/trunk/src/sandy/materials/attributes/CelShadeAttributes.hx trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MaterialAttributes.hx trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MediumAttributes.hx trunk/sandy/haxe/trunk/src/sandy/materials/attributes/PhongAttributesLightMap.hx trunk/sandy/haxe/trunk/src/sandy/math/ColorMath.hx trunk/sandy/haxe/trunk/src/sandy/parser/ASEParser.hx trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx trunk/sandy/haxe/trunk/src/sandy/parser/Parser.hx trunk/sandy/haxe/trunk/src/sandy/parser/Parser3DS.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Box.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Cylinder.hx trunk/sandy/haxe/trunk/src/sandy/primitive/GeodesicSphere.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Hedra.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Line3D.hx trunk/sandy/haxe/trunk/src/sandy/primitive/MD2.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Plane3D.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Primitive3D.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Sphere.hx trunk/sandy/haxe/trunk/src/sandy/primitive/Torus.hx trunk/sandy/haxe/trunk/src/sandy/view/Frustum.hx Log: This revision provides more typing, which seems to improve performance of scenes with many objects. However, by typing a Node's children, this breaks some examples, which expect a Node's child to be typed as a subclass (a workaround is to use the 'untyped' keyword in these cases). In future, it may be necessary to use the syntax Node to parametise the Node's children, so as to avoid the untyped Dynamic declaration, but this requires big changes throughout the entire API and examples. Modified: trunk/sandy/haxe/trunk/src/sandy/bounds/BBox.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/bounds/BBox.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/bounds/BBox.hx Sat Dec 6 05:53:14 2008 @@ -17,6 +17,7 @@ import sandy.core.data.Matrix4; import sandy.core.data.Vector; +import sandy.core.data.Vertex; /** * The BBox object is used to clip the object faster. @@ -66,7 +67,7 @@ * @param p_aVertices The vertices of the 3D object * @return A BBox instance */ - public static function create( p_aVertices:Array ):BBox + public static function create( p_aVertices:Array ):BBox { if(p_aVertices.length == 0) return null; @@ -74,11 +75,11 @@ var l_min:Vector = new Vector(); var l_max:Vector = new Vector(); - var lTmp:Array = []; + var lTmp:Array = []; #if flash lTmp = untyped p_aVertices.sortOn (["x"], [Array.NUMERIC| Array.RETURNINDEXEDARRAY ]); #else - var t:Array = p_aVertices.copy(); + var t:Array = p_aVertices.copy(); t.sort( function(a,b) {return (a.x>b.x)?1:a.x = p_aVertices.copy(); + var t:Array = p_aVertices.copy(); t.sort( function(a,b) {return (a.y>b.y)?1:a.y = p_aVertices.copy(); + var t:Array = p_aVertices.copy(); t.sort( function(a,b) {return (a.z>b.z)?1:a.zBSphere instance */ - public static function create( p_aVertices:Array ):BSphere + public static function create( p_aVertices:Array ):BSphere { var l_sphere:BSphere = new BSphere(); /* @@ -131,7 +131,7 @@ * * @param p_aVertices The vertices of the 3D object */ - public function compute( p_aVertices:Array ):Void + public function compute( p_aVertices:Array ):Void { if(p_aVertices.length == 0) return; var x:Float, y:Float, z:Float, d:Float, i:Int = 0, j:Int = 0, l:Int = p_aVertices.length; @@ -210,7 +210,7 @@ * @param p_aPoints An array containing the sphere's points * @return The bounding sphere's radius */ - private function computeRadius(p_aPoints:Array):Float + private function computeRadius(p_aPoints:Array):Float { var x:Float, y:Float, z:Float, d:Float, dmax:Float = 0; var i:Int = 0, l:Int = p_aPoints.length; Modified: trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/ATransformable.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/ATransformable.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/ATransformable.hx Sat Dec 6 05:53:14 2008 @@ -40,6 +40,7 @@ **/ class ATransformable extends Node { + /** * Disable the local transformations applied to this Node if set to false. * They will be applied back once et back to true. Modified: trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/Node.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/Node.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/core/scenegraph/Node.hx Sat Dec 6 05:53:14 2008 @@ -16,6 +16,7 @@ package sandy.core.scenegraph; +import flash.events.Event; import sandy.bounds.BBox; import sandy.bounds.BSphere; import sandy.core.Scene3D; @@ -53,7 +54,7 @@ * The children of this node are stored inside this array. * IMPORTANT: Use this property mainly as READ ONLY. To add, delete or search a specific child, you can use the specific method to do that */ - public var children:Array; + public var children:Array; /** * Cached matrix corresponding to the transformation to the 0,0,0 frame system @@ -113,7 +114,6 @@ modelMatrix = new Matrix4(); viewMatrix = new Matrix4(); - m_oEB = new BubbleEventBroadcaster(); changed = false; p_sName = (p_sName != null)?p_sName:""; @@ -149,10 +149,10 @@ * @param p_sEvt Name of the Event. * @param p_oL Listener object. */ - public function addEventListener(p_sEvt:String, p_oL:Dynamic ) : Void + public function addEventListener(p_sEvt:String, p_oL:T->Void ) : Void { - //Reflect.callMethod(m_oEB.addEventListener, p_sEvt, [p_oL] ); - untyped( m_oEB.addEventListener.apply(p_sEvt, [p_sEvt,p_oL]) ); + Reflect.callMethod( p_sEvt, m_oEB.addEventListener, [p_sEvt,p_oL] ); + //untyped( m_oEB.addEventListener.apply(p_sEvt, [p_sEvt,p_oL]) ); } /** @@ -161,7 +161,7 @@ * @param p_sEvt Name of the Event. * @param oL Listener object. */ - public function removeEventListener(p_sEvt:String, p_oL:Dynamic) : Void + public function removeEventListener(p_sEvt:String, p_oL:Event->Void) : Void { m_oEB.removeEventListener(p_sEvt, p_oL); } @@ -419,7 +419,7 @@ // should we kill all the childs, or just make them childs of current node parent ? //var l_aTmp:Array = children.concat(); - var l_aTmp:Array = children; + var l_aTmp:Array = children; for ( lNode in l_aTmp ) { lNode.destroy(); @@ -443,7 +443,7 @@ // now we make current node children the current parent's node children //var l_aTmp:Array = children.concat(); - var l_aTmp:Array = children; + var l_aTmp:Array = children; for ( lNode in l_aTmp ) { parent.addChild( lNode ); Modified: trunk/sandy/haxe/trunk/src/sandy/events/BubbleEvent.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/events/BubbleEvent.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/events/BubbleEvent.hx Sat Dec 6 05:53:14 2008 @@ -30,7 +30,6 @@ class BubbleEvent extends Event { private var m_oTarget:Dynamic; - //private var m_sType:String; /** * Creates a new BubbleEvent instance. Modified: trunk/sandy/haxe/trunk/src/sandy/materials/Material.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/materials/Material.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/materials/Material.hx Sat Dec 6 05:53:14 2008 @@ -17,12 +17,14 @@ package sandy.materials; import flash.display.Sprite; +import flash.filters.BitmapFilter; import sandy.core.Scene3D; import sandy.core.data.Polygon; import sandy.core.scenegraph.Sprite2D; import sandy.materials.attributes.MaterialAttributes; + /** * The Material class is the base class for all materials. * @@ -180,7 +182,7 @@ *

You use this property to add an array of filters you want to apply to this material
* To remove the filters, just assign an empty array.

*/ - private function __setFilters( a:Array ):Array + private function __setFilters( a:Array ):Array { _filters = a; m_bModified = true; @@ -203,8 +205,8 @@ *

You use this property to add an array of filters you want to apply to this material
* To remove the filters, just assign an empty array.

*/ - public var filters(__getFilters,__setFilters):Array; - public function __getFilters():Array + public var filters(__getFilters,__setFilters):Array; + public function __getFilters():Array { return _filters; } @@ -238,7 +240,7 @@ private var m_bModified:Bool; private var _useLight : Bool; private var m_oType:MaterialType; - private var _filters:Array; + private var _filters:Array; private var _id:Float; private static var _ID_:Float = 0; private static var create:Bool; Modified: trunk/sandy/haxe/trunk/src/sandy/materials/attributes/CelShadeAttributes.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/materials/attributes/CelShadeAttributes.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/materials/attributes/CelShadeAttributes.hx Sat Dec 6 05:53:14 2008 @@ -89,10 +89,10 @@ 0x666666, 0x666666, 0x444444, 0x444444]; lightmap.ratios[0] = [ - 0, 40, - 40, 80, - 80, 120, - 120, 180]; + 0., 40., + 40., 80., + 80., 120., + 120., 180.]; } } Modified: trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MaterialAttributes.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MaterialAttributes.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MaterialAttributes.hx Sat Dec 6 05:53:14 2008 @@ -41,7 +41,7 @@ /** * Creates a new LightAttributes object. */ - public function new( ?args:Array ) + public function new( ?args:Array ) { if ( args == null ) args = new Array(); @@ -51,7 +51,7 @@ { if( Std.is( attr, IAttributes ) ) { - attributes.push( attr ); + attributes.push( untyped attr ); } } } Modified: trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MediumAttributes.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MediumAttributes.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/materials/attributes/MediumAttributes.hx Sat Dec 6 05:53:14 2008 @@ -187,7 +187,7 @@ override public function drawOnSprite( p_oSprite:Sprite2D, p_oMaterial:Material, p_oScene:Scene3D ):Void { var l_ratio:Float = Math.max (0, Math.min (1, ratioFromWorldVector (p_oSprite.getPosition ("camera")) * _a)); - var l_color:Dynamic = ColorMath.hex2rgb (_c); + var l_color:ColorMathRGB = ColorMath.hex2rgb (_c); var l_coltr:ColorTransform = p_oSprite.container.transform.colorTransform; // -- l_coltr.redOffset = Math.round (l_color.r * l_ratio); Modified: trunk/sandy/haxe/trunk/src/sandy/materials/attributes/PhongAttributesLightMap.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/materials/attributes/PhongAttributesLightMap.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/materials/attributes/PhongAttributesLightMap.hx Sat Dec 6 05:53:14 2008 @@ -27,7 +27,7 @@ /** * An array of an array which contains the alphas of the strata. The values of the inner array must be between 0 and 1. */ - public var alphas:Array>; + public var alphas:Array>; /** * An array of an array which contains the colors of the strata. @@ -37,7 +37,7 @@ /** * An array of an array which contains the ratios (length) of each strata. */ - public var ratios:Array>; + public var ratios:Array>; public function new () { alphas = [[], []]; Modified: trunk/sandy/haxe/trunk/src/sandy/math/ColorMath.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/math/ColorMath.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/math/ColorMath.hx Sat Dec 6 05:53:14 2008 @@ -16,6 +16,11 @@ package sandy.math; +typedef ColorMathRGB = { + r:Float, + g:Float, + b:Float +} /** * Math functions for colors. * @@ -60,7 +65,7 @@ * @param hex hexadecimal color. * @return The rgb color of the hexadecimal given. */ - public static function hex2rgb(hex:Int):Dynamic + public static function hex2rgb(hex:Int):ColorMathRGB { var r:Float; var g:Float; Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ASEParser.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/ASEParser.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/ASEParser.hx Sat Dec 6 05:53:14 2008 @@ -17,7 +17,6 @@ package sandy.parser; import flash.events.Event; -//import flash.utils.unescapeMultiByte; import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; @@ -60,7 +59,7 @@ * an embedded object * @param p_nScale The scale factor */ - public function new( p_sUrl:Dynamic, p_nScale:Float ) + public function new( p_sUrl:URL, p_nScale:Float ) { super( p_sUrl, p_nScale ); } Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx Sat Dec 6 05:53:14 2008 @@ -93,12 +93,18 @@ * */ +typedef ColladaImage = { + bitmapData: flash.display.BitmapData, + id : String, + fileName : String +} + class ColladaParser extends AParser, implements IParser { private var m_oCollada : haxe.xml.Fast; private var m_oUp:UpAxis; - private var m_oMaterials : Hash; + private var m_oMaterials : Hash; /** * Default path for COLLADA images. @@ -113,7 +119,7 @@ * COLLADA file or an instance of an embedded COLLADA file. * @param p_nScale The scale factor. */ - public function new( p_sUrl:Dynamic, p_nScale:Float ) + public function new( p_sUrl:URL, p_nScale:Float ) { RELATIVE_TEXTURE_PATH = "."; super( p_sUrl, p_nScale ); @@ -356,7 +362,7 @@ return l_oNode; } - private function getGeometry( p_sGeometryID : String, p_oMaterials : Hash ) : Geometry3D + private function getGeometry( p_sGeometryID : String, p_oMaterials : Hash ) : Geometry3D { var i : Int; var l_oOutpGeom : Geometry3D = new Geometry3D(); @@ -772,9 +778,9 @@ } - private function loadImages( p_oLibImages : List ) : Hash + private function loadImages( p_oLibImages : List ) : Hash { - var l_oImages : Hash = new Hash(); + var l_oImages : Hash = new Hash(); var l_oQueue : LoaderQueue = new LoaderQueue(); for ( l_oImage in p_oLibImages ) Modified: trunk/sandy/haxe/trunk/src/sandy/parser/Parser.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/Parser.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/Parser.hx Sat Dec 6 05:53:14 2008 @@ -33,7 +33,7 @@ * */ -class Parser +class Parser)> { /** * Parameter that is used to specify that the ASE (ASCII Scene Export) @@ -68,7 +68,7 @@ * @param p_nScale The scale factor * @return The parser to be used */ - public static function create( p_sFile:Dynamic, ?p_sParserType:String, ?p_nScale:Float ):IParser + public static function create( p_sFile:URL, ?p_sParserType:String, ?p_nScale:Float ): ParserClass { if ( p_nScale == null ) p_nScale = 1; @@ -76,7 +76,7 @@ // -- if( Std.is( p_sFile, String ) && p_sParserType == null ) { - l_sExt = (p_sFile.split('.')).reverse()[0]; + l_sExt = (untyped p_sFile.split('.')).reverse()[0]; } else { @@ -95,7 +95,7 @@ default: } // -- - return l_iParser; + return untyped l_iParser; } } Modified: trunk/sandy/haxe/trunk/src/sandy/parser/Parser3DS.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/Parser3DS.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/Parser3DS.hx Sat Dec 6 05:53:14 2008 @@ -84,7 +84,7 @@ * @param p_sUrl A String pointing to the location of the 3DS file * @param p_nScale The scale factor */ - public function new( p_sUrl:String, p_nScale:Float ) + public function new( p_sUrl:URL, p_nScale:Float ) { super( p_sUrl, p_nScale ); m_sDataFormat = URLLoaderDataFormat.BINARY; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Box.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Box.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Box.hx Sat Dec 6 05:53:14 2008 @@ -19,6 +19,7 @@ import sandy.core.data.PrimitiveFace; import sandy.core.data.UVCoord; import sandy.core.data.Vertex; +import sandy.core.data.Vector; import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; @@ -157,7 +158,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate (?arguments:Array) :Geometry3D + public function generate (?arguments:Array) :Geometry3D { if (arguments == null) arguments = []; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Cylinder.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Cylinder.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Cylinder.hx Sat Dec 6 05:53:14 2008 @@ -17,6 +17,7 @@ import sandy.core.data.PrimitiveFace; import sandy.core.data.Vertex; +import sandy.core.data.Vector; import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; @@ -176,7 +177,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate(?arguments:Array):Geometry3D + public function generate(?arguments:Array):Geometry3D { var l_oGeometry3D:Geometry3D = new Geometry3D(); // -- Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/GeodesicSphere.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/GeodesicSphere.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/GeodesicSphere.hx Sat Dec 6 05:53:14 2008 @@ -67,7 +67,7 @@ /** * @private */ - public function generate ( ?arguments:Array ):Geometry3D + public function generate ( ?arguments:Array ):Geometry3D { var l_oGeometry3D:Geometry3D = new Geometry3D(); Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Hedra.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Hedra.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Hedra.hx Sat Dec 6 05:53:14 2008 @@ -17,6 +17,7 @@ import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; +import sandy.core.data.Vector; /** * The Hedra class is used for creating a hedra. A hedra can be seen as two pyramids joined at their bases. @@ -67,7 +68,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate (?arguments:Array):Geometry3D + public function generate (?arguments:Array):Geometry3D { if (arguments == null) arguments = []; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Line3D.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Line3D.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Line3D.hx Sat Dec 6 05:53:14 2008 @@ -47,13 +47,9 @@ * * @see sandy.core.data.Vector */ - public function new ( p_sName:String=null, rest : Array ) + public function new ( p_sName:String=null, rest : Array ) { super ( p_sName ); - // "rest" can be a two-or-more-element array of vectors. Or the first element can itself be an array - if (rest.length == 1 && Std.is(rest[0], Array)) { - rest = rest[0]; - } if( rest.length < 2) { @@ -62,7 +58,7 @@ } else { - geometry = generate( [rest] ); + geometry = generate( rest ); enableBackFaceCulling = false; } } @@ -74,12 +70,12 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate ( ?arguments:Array ) : Geometry3D + public function generate ( ?arguments:Array ) : Geometry3D { if ( arguments == null ) arguments = []; var l_oGeometry:Geometry3D = new Geometry3D(); - var l_aPoints:Array = arguments[0]; + var l_aPoints:Array = arguments; // -- var i:Int = 0; var l:Int = l_aPoints.length; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/MD2.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/MD2.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/MD2.hx Sat Dec 6 05:53:14 2008 @@ -42,7 +42,7 @@ * * @return The geometry object. */ - public function generate (?arguments:Array):Geometry3D + public function generate (?arguments:Array):Geometry3D { var i:Int, j:Int, char:Int; var uvs:Array = []; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Plane3D.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Plane3D.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Plane3D.hx Sat Dec 6 05:53:14 2008 @@ -17,6 +17,7 @@ import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; +import sandy.core.data.Vector; /** * The Plane3D is used for creating a plane primitive. @@ -96,7 +97,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate( ?arguments:Array ):Geometry3D + public function generate( ?arguments:Array ):Geometry3D { if ( arguments == null ) arguments = []; Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Primitive3D.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Primitive3D.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Primitive3D.hx Sat Dec 6 05:53:14 2008 @@ -16,6 +16,7 @@ package sandy.primitive; import sandy.core.scenegraph.Geometry3D; +import sandy.core.data.Vector; /** * An interface implemented by all 3D primitive classes. @@ -35,6 +36,6 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate(?arguments:Array):Geometry3D; + public function generate(?arguments:Array):Geometry3D; } Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Sphere.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Sphere.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Sphere.hx Sat Dec 6 05:53:14 2008 @@ -17,6 +17,7 @@ import sandy.core.scenegraph.Geometry3D; import sandy.core.scenegraph.Shape3D; +import sandy.core.data.Vector; /** * The Sphere class is used for creating a sphere primitive @@ -106,7 +107,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate(?arguments:Array):Geometry3D + public function generate(?arguments:Array):Geometry3D { if (arguments == null) arguments = new Array(); Modified: trunk/sandy/haxe/trunk/src/sandy/primitive/Torus.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/primitive/Torus.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/primitive/Torus.hx Sat Dec 6 05:53:14 2008 @@ -129,7 +129,7 @@ * * @see sandy.core.scenegraph.Geometry3D */ - public function generate(?arguments:Array) : Geometry3D + public function generate(?arguments:Array) : Geometry3D { if (arguments == null) arguments = []; Modified: trunk/sandy/haxe/trunk/src/sandy/view/Frustum.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/view/Frustum.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/view/Frustum.hx Sat Dec 6 05:53:14 2008 @@ -50,8 +50,8 @@ // |/ |/ // 2---3 public var aPoints:Array; - public var aNormals:Array; - public var aConstants:Array; + public var aNormals:Array; + public var aConstants:Array; // front plane : aNormals[0], aConstants[0] <-> aPoints[0], aPoints[1], aPoints[2], aPoints[3] // upper plane : aNormals[1], aConstants[1] <-> aPoints[0], aPoints[1], aPoints[4], aPoints[5] // lower plane : aNormals[2], aConstants[2] <-> aPoints[2], aPoints[3], aPoints[6], aPoints[7] From niel.drummond at grumpytoad.org Sat Dec 6 06:29:58 2008 From: niel.drummond at grumpytoad.org (Niel Drummond) Date: Sat, 06 Dec 2008 15:29:58 +0100 Subject: [Sandy] status update: javascript target Message-ID: <493A8C66.4020404@grumpytoad.org> May I take the opportunity to ask for some testing help with the haxe javascript target? I managed to get Justin and Guy's Dice Demo working, and fixed numerous issues, but I haven't managed to test in all browsers (only firefox 3 and Webkit w/ Squirrelfish). Can people use a weird browser / and / or phone on http://cyanescent.co.uk/canvasdemo and report back? that would give me an idea what works and what doesn't. @Thomas: it's not possible to add javascript and canvas elements on the wiki. I would like to get the javascript demos running on the site, do you have some ideas ? Performance is very dependent on graphics card and browser version. I suspect google chrome is the fastest due to V8, but as I don't have windows, I'll have to wait for the port :-| - Niel From niel.drummond at grumpytoad.org Sat Dec 6 06:45:16 2008 From: niel.drummond at grumpytoad.org (Niel Drummond) Date: Sat, 06 Dec 2008 15:45:16 +0100 Subject: [Sandy] [sandy commit] r856 - in trunk/sandy/haxe/trunk/src/sandy: core/data math In-Reply-To: References: <000e0cd6aa4c61aeb7045ce9d78c@google.com> Message-ID: <493A8FFC.5090303@grumpytoad.org> kiroukou wrote: > How goes that haXe port so far? There were some big stumbling blocks for the JS target: - for browsers that do not implement the canvas function 'setTransform' , one has to decompose the bitmap render matrix into its constituent transform, scale, and rotate components. Thanks to Eugene from Dojo Foundation for his pioneering work on that. - the collada parser was causing a headache, due to it's bad performance and large filesize payload. (these two points are now fixed, and further work should be easier) I am now developing some unit tests based on the examples to use in continuing porting to 3.0.3 and for other targets. Future work may or may not include a Desktop version using the new CPP target. - Niel > > Thanks a lot to continue this effort btw. > > Thomas > > Le 30 nov. 08 ? 16:35, codesite-noreply at google.com a ?crit : > >> Author: cyanescent >> Date: Sun Nov 30 07:35:02 2008 >> New Revision: 856 >> >> Modified: >> trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx >> trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx >> trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx >> >> Log: >> Removing bad commit introduced in rev 853 >> >> Modified: trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx (original) >> +++ trunk/sandy/haxe/trunk/src/sandy/core/data/Vector.hx Sun Nov >> 30 07:35:02 2008 >> @@ -57,9 +57,6 @@ >> y = p_nY; >> z = p_nZ; >> >> -#if flash10 >> - prepare(); >> -#end >> } >> >> /** >> @@ -131,29 +128,6 @@ >> return Math.sqrt( x*x + y*y + z*z ); >> } >> >> -#if flash10 >> - public function getNormInvSqrt():Float >> - { >> - return invSqrt( x*x + y*y + z*z ); >> - } >> - public function prepare() { >> - var b = new flash.utils.ByteArray(); >> - b.length = 1024; >> - flash.Memory.select(b); >> - } >> - >> - public function invSqrt( x : Float ) : Float { >> - var half = 0.5 * x; >> - flash.Memory.setFloat(0,x); >> - var i = flash.Memory.getI32(0); >> - i = 0x5f3759df - (i>>1); >> - flash.Memory.setI32(0,i); >> - x = flash.Memory.getFloat(0); >> - x = x * (1.5 - half*x*x); >> - return x; >> - } >> -#end >> - >> /** >> * Compute and returns the invers of this vector. >> * >> @@ -265,22 +239,12 @@ >> public function normalize():Void >> { >> // -- We get the norm of the vector >> -#if flash10 >> - var norm:Float = getNormInvSqrt(); >> -#else >> var norm:Float = getNorm(); >> -#end >> // -- We escape the process is norm is null or equal to 1 >> if( norm == 0 || norm == 1) return; >> -#if flash10 >> - x = x * norm; >> - y = y * norm; >> - z = z * norm; >> -#else >> x = x / norm; >> y = y / norm; >> z = z / norm; >> -#end >> } >> >> /** >> @@ -313,13 +277,8 @@ >> */ >> public function getAngle ( w:Vector ):Float >> { >> -#if flash10 >> - var n1:Float = getNormInvSqrt(); >> - var n2:Float = w.getNormInvSqrt(); >> -#else >> var n1:Float = getNorm(); >> var n2:Float = w.getNorm(); >> -#end >> var denom:Float = n1 * n2; >> if( denom == 0 ) >> { >> @@ -327,11 +286,7 @@ >> } >> else >> { >> -#if flash10 >> - var ncos:Float = dot( w ) * ( denom ); >> -#else >> var ncos:Float = dot( w ) / ( denom ); >> -#end >> var sin2:Float = 1 - (ncos * ncos); >> if ( sin2 < 0 ) >> { >> >> Modified: trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx >> ============================================================================== >> >> --- trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx (original) >> +++ trunk/sandy/haxe/trunk/src/sandy/core/data/Vertex.hx Sun Nov >> 30 07:35:02 2008 >> @@ -220,29 +220,6 @@ >> { >> return Math.sqrt( x*x + y*y + z*z ); >> } >> -#if flash10 >> - public function getNormInvSqrt():Float >> - { >> - return invSqrt( x*x + y*y + z*z ); >> - } >> - public function prepare() { >> - var b = new flash.utils.ByteArray(); >> - b.length = 1024; >> - flash.Memory.select(b); >> - } >> - >> - public function invSqrt( x : Float ) : Float { >> - var half = 0.5 * x; >> - flash.Memory.setFloat(0,x); >> - var i = flash.Memory.getI32(0); >> - i = 0x5f3759df - (i>>1); >> - flash.Memory.setI32(0,i); >> - x = flash.Memory.getFloat(0); >> - x = x * (1.5 - half*x*x); >> - return x; >> - } >> -#end >> - >> >> /** >> * Return the invers of this vertex. >> @@ -367,22 +344,9 @@ >> public function normalize():Void >> { >> // -- We get the norm of the vector >> -#if flash10 >> - var norm:Float = getNormInvSqrt(); >> -#else >> var norm:Float = getNorm(); >> -#end >> // -- We escape the process is norm is null or equal to 1 >> if( norm == 0 || norm == 1) return; >> -#if flash10 >> - x = x * norm; >> - y = y * norm; >> - z = z * norm; >> - >> - wx *= norm; >> - wy *= norm; >> - wz *= norm; >> -#else >> x = x / norm; >> y = y / norm; >> z = z / norm; >> @@ -390,7 +354,6 @@ >> wx /= norm; >> wy /= norm; >> wz /= norm; >> -#end >> >> } >> >> @@ -402,11 +365,7 @@ >> */ >> public function getAngle ( w:Vertex ):Float >> { >> -#if flash10 >> - var ncos:Float = dot( w ) * ( getNormInvSqrt() * >> w.getNormInvSqrt() ); >> -#else >> var ncos:Float = dot( w ) / ( getNorm() * w.getNorm() ); >> -#end >> var sin2:Float = 1 - ncos * ncos; >> if (sin2<0) >> { >> >> Modified: trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx >> ============================================================================== >> >> --- trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx (original) >> +++ trunk/sandy/haxe/trunk/src/sandy/math/VectorMath.hx Sun Nov 30 >> 07:35:02 2008 >> @@ -39,29 +39,6 @@ >> return Math.sqrt( p_oV.x*p_oV.x + p_oV.y*p_oV.y + >> p_oV.z*p_oV.z ); >> } >> >> -#if flash10 >> - public static inline function getNormInvSqrt( p_oV:Vector ):Float >> - { >> - return invSqrt( p_oV.x*p_oV.x + p_oV.y*p_oV.y + >> p_oV.z*p_oV.z ); >> - } >> - public static inline function prepare() { >> - var b = new flash.utils.ByteArray(); >> - b.length = 1024; >> - flash.Memory.select(b); >> - } >> - >> - public static inline function invSqrt( x : Float ) : Float { >> - var half = 0.5 * x; >> - flash.Memory.setFloat(0,x); >> - var i = flash.Memory.getI32(0); >> - i = 0x5f3759df - (i>>1); >> - flash.Memory.setI32(0,i); >> - x = flash.Memory.getFloat(0); >> - x = x * (1.5 - half*x*x); >> - return x; >> - } >> -#end >> - >> /** >> * Computes the oposite vector of a specified 3D vector. >> * >> @@ -171,24 +148,14 @@ >> public inline static function normalize( p_oV:Vector ): Bool >> { >> // -- We get the norm of the vector >> -#if flash10 >> - var norm:Float = VectorMath.getNormInvSqrt( p_oV ); >> -#else >> var norm:Float = VectorMath.getNorm( p_oV ); >> -#end >> // -- We escape the process is norm is null or equal to 1 >> if( norm == 0 || norm == 1) { >> return false; >> } else { >> -#if flash10 >> - p_oV.x *= norm; >> - p_oV.y *= norm; >> - p_oV.z *= norm; >> -#else >> p_oV.x /= norm; >> p_oV.y /= norm; >> p_oV.z /= norm; >> -#end >> >> return true; >> } >> >> _______________________________________________ >> Sandy mailing list >> Sandy at osflash.org >> http://osflash.org/mailman/listinfo/sandy_osflash.org > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From info at maxpellizzaro.com Sat Dec 6 08:25:45 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Sat, 06 Dec 2008 17:25:45 +0100 Subject: [Sandy] Another small tutorial ... Message-ID: <493aa789.3dc.6d9c.1580821308@webmaildh3.aruba.it> Well, ok, enough for this weekend, but I had something to tell more to the list, so another small tutorial :) http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut075 Max. From xdevltd at gmail.com Sat Dec 6 08:30:35 2008 From: xdevltd at gmail.com (Floris) Date: Sat, 6 Dec 2008 17:30:35 +0100 Subject: [Sandy] Another small tutorial ... In-Reply-To: <493aa789.3dc.6d9c.1580821308@webmaildh3.aruba.it> References: <493aa789.3dc.6d9c.1580821308@webmaildh3.aruba.it> Message-ID: <7ab8c5500812060830p250ead82gb305e7d21d7994c1@mail.gmail.com> Nice tuto :-) Amazing how fast the tutorial collection is growing... 2008/12/6 info at maxpellizzaro.com > Well, > ok, enough for this weekend, > but I had something to tell more to the list, > so another small tutorial :) > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut075 > > Max. > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From kiroukou at gmail.com Sat Dec 6 10:43:53 2008 From: kiroukou at gmail.com (kiroukou) Date: Sat, 6 Dec 2008 19:43:53 +0100 Subject: [Sandy] Another small tutorial ... In-Reply-To: <493aa789.3dc.6d9c.1580821308@webmaildh3.aruba.it> References: <493aa789.3dc.6d9c.1580821308@webmaildh3.aruba.it> Message-ID: <6CEBBC45-D914-4F3E-B957-9EAD86B83635@gmail.com> can you add the automatic texture loading? :) Good work max ! Le 6 d?c. 08 ? 17:25, info at maxpellizzaro.com a ?crit : > Well, > ok, enough for this weekend, > but I had something to tell more to the list, > so another small tutorial :) > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut075 > > Max. > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From info at maxpellizzaro.com Sat Dec 6 11:21:08 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Sat, 06 Dec 2008 20:21:08 +0100 Subject: [Sandy] Another small tutorial ... Message-ID: <493ad0a4.217.2af9.865873706@webmaildh5.aruba.it> If I had the texure yes, but I don't know how to get it from swift3D, anyone can help ? Max ----- Original Message ----- Da : kiroukou A : sandy at osflash.org Oggetto : Re: [Sandy] Another small tutorial ... Data : Sat, 6 Dec 2008 19:43:53 +0100 > can you add the automatic texture loading? :) > > Good work max ! > Le 6 d?c. 08 ? 17:25, info at maxpellizzaro.com a ?crit : > > > Well, > > ok, enough for this weekend, > > but I had something to tell more to the list, > > so another small tutorial :) > > > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut075 > > > > Max. > > > > _______________________________________________ > > Sandy mailing list > > Sandy at osflash.org > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From info at maxpellizzaro.com Sat Dec 6 13:53:13 2008 From: info at maxpellizzaro.com (info at maxpellizzaro.com) Date: Sat, 06 Dec 2008 22:53:13 +0100 Subject: [Sandy] Another small tutorial ... Message-ID: <493af449.355.1aa.1551605338@webmaildh5.aruba.it> I added some texture and automatic loading :) Max. ----- Original Message ----- Da : kiroukou A : sandy at osflash.org Oggetto : Re: [Sandy] Another small tutorial ... Data : Sat, 6 Dec 2008 19:43:53 +0100 > can you add the automatic texture loading? :) > > Good work max ! > Le 6 d?c. 08 ? 17:25, info at maxpellizzaro.com a ?crit : > > > Well, > > ok, enough for this weekend, > > but I had something to tell more to the list, > > so another small tutorial :) > > > > http://www.flashsandy.org/tutorials/3.0/sandy_cs3_tut075 > > > > Max. > > > > _______________________________________________ > > Sandy mailing list > > Sandy at osflash.org > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From makc.the.great at gmail.com Sun Dec 7 10:16:21 2008 From: makc.the.great at gmail.com (Makc) Date: Sun, 7 Dec 2008 20:16:21 +0200 Subject: [Sandy] status update: javascript target In-Reply-To: <493A8C66.4020404@grumpytoad.org> References: <493A8C66.4020404@grumpytoad.org> Message-ID: <7a2c69bf0812071016i4e98c4ddn4155c7859369cdc6@mail.gmail.com> On Sat, Dec 6, 2008 at 4:29 PM, Niel Drummond wrote: > Can people use a weird browser / and > / or phone on http://cyanescent.co.uk/canvasdemo and report back? that would > give me an idea what works and what doesn't. Your browser does not support the canvas tag. Get the latest firefox. IE7 here :( From niel.drummond at grumpytoad.org Sun Dec 7 12:32:38 2008 From: niel.drummond at grumpytoad.org (Niel Drummond) Date: Sun, 07 Dec 2008 21:32:38 +0100 Subject: [Sandy] status update: javascript target In-Reply-To: <7a2c69bf0812071016i4e98c4ddn4155c7859369cdc6@mail.gmail.com> References: <493A8C66.4020404@grumpytoad.org> <7a2c69bf0812071016i4e98c4ddn4155c7859369cdc6@mail.gmail.com> Message-ID: <493C32E6.2060001@grumpytoad.org> Makc wrote: > On Sat, Dec 6, 2008 at 4:29 PM, Niel Drummond > wrote: > >> Can people use a weird browser / and >> / or phone on http://cyanescent.co.uk/canvasdemo and report back? that would >> give me an idea what works and what doesn't. >> > > Your browser does not support the canvas tag. Get the latest firefox. > > IE7 here :( > ok I fixed this by cheating a bit: I put the flash content if your browser doesn't support canvas element :-P . I'd be interested if ex-canvas works, but I haven't tried. I checked on some different browsers, and it seems to work on all the latest browsers apart from IE. Safari 2, Opera 9, Camino, Midori, Kazehakase, Shiira, Google Chrome, Gecko from whatever version Firefox 2 is. Even my phone works (but very slowly :-) - Niel > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From creek23grupzer0 at yahoo.com Tue Dec 9 05:30:12 2008 From: creek23grupzer0 at yahoo.com (Mj Mendoza IV) Date: Tue, 9 Dec 2008 05:30:12 -0800 (PST) Subject: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux In-Reply-To: <493C32E6.2060001@grumpytoad.org> Message-ID: <802027.44846.qm@web35604.mail.mud.yahoo.com> Has someone tried using Opensource FLEX SDK with Sandy under GNU/Linux? If yes, what IDE are you using on GNU/Linux? As I send this email, I am still trying to run FlashDevelop under WINE. Mj From makc.the.great at gmail.com Tue Dec 9 06:36:59 2008 From: makc.the.great at gmail.com (Makc) Date: Tue, 9 Dec 2008 16:36:59 +0200 Subject: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux In-Reply-To: <802027.44846.qm@web35604.mail.mud.yahoo.com> References: <493C32E6.2060001@grumpytoad.org> <802027.44846.qm@web35604.mail.mud.yahoo.com> Message-ID: <7a2c69bf0812090636l2864b87dkc3bb60ca938c512d@mail.gmail.com> I thought wine only emulates windows api, not .net runtime? On Tue, Dec 9, 2008 at 3:30 PM, Mj Mendoza IV wrote: > Has someone tried using Opensource FLEX SDK with Sandy under GNU/Linux? If yes, what IDE are you using on GNU/Linux? > > As I send this email, I am still trying to run FlashDevelop under WINE. > > Mj > > > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From creek23grupzer0 at yahoo.com Tue Dec 9 06:46:31 2008 From: creek23grupzer0 at yahoo.com (Mj Mendoza IV) Date: Tue, 9 Dec 2008 06:46:31 -0800 (PST) Subject: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux In-Reply-To: <7a2c69bf0812090636l2864b87dkc3bb60ca938c512d@mail.gmail.com> Message-ID: <272822.38327.qm@web35601.mail.mud.yahoo.com> Luckily, WINE is doing .Net too. http://appdb.winehq.org/objectManager.php?sClass=version&iId=3754 Sadly, they are still on it... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ** (./FlashDevelop.exe:18824): WARNING **: The following assembly referenced from /home/creek23/.wine/drive_c/Program Files/FlashDevelop/PluginCore.dll could not be loaded: ???? Assembly:?? System.Windows.Forms??? (assemblyref_index=1) ???? Version:??? 2.0.0.0 ???? Public Key: b77a5c561934e089 The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/creek23/.wine/drive_c/Program Files/FlashDevelop). ** (./FlashDevelop.exe:18824): WARNING **: Could not load file or assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Unhandled Exception: System.TypeLoadException: Could not load type 'PluginCore.Utilities.SingleInstanceApp' from assembly 'PluginCore, Version=2.0.0.23085, Culture=neutral'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Good thing is that they are doing something on this. Mj --- On Tue, 12/9/08, Makc wrote: From: Makc Subject: Re: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux To: sandy at osflash.org Date: Tuesday, December 9, 2008, 10:36 PM I thought wine only emulates windows api, not .net runtime? From codesite-noreply at google.com Tue Dec 9 09:38:07 2008 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 09 Dec 2008 17:38:07 +0000 Subject: [Sandy] [sandy commit] r860 - trunk/sandy/haxe/trunk/src/sandy/parser Message-ID: <00151750e6923c72e6045da09b41@google.com> Author: cyanescent Date: Tue Dec 9 09:00:59 2008 New Revision: 860 Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx Log: Bug fix for model provided by Justin, thanks for reporting. (Model will be distributed in forthcoming examples zip) Modified: trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx ============================================================================== --- trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx (original) +++ trunk/sandy/haxe/trunk/src/sandy/parser/ColladaParser.hx Tue Dec 9 09:00:59 2008 @@ -707,19 +707,47 @@ var l_oNode : haxe.xml.Fast = l_oEffect.node.profile_COMMON.node.technique; switch (true) { case l_oNode.hasNode.asset: - l_aTexture.push( l_oNode.node.asset.node.diffuse.node.texture ); + if ( l_oNode.node.asset.hasNode.diffuse && l_oNode.node.asset.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.asset.node.diffuse.node.texture ); + } else if ( l_oNode.node.asset.hasNode.emission && l_oNode.node.asset.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.asset.node.emission.node.texture ); + } case l_oNode.hasNode.annotate: - l_aTexture.push( l_oNode.node.annotate.node.diffuse.node.texture ); + if ( l_oNode.node.annotate.hasNode.diffuse && l_oNode.node.annotate.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.annotate.node.diffuse.node.texture ); + } else if ( l_oNode.node.annotate.hasNode.emission && l_oNode.node.annotate.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.annotate.node.emission.node.texture ); + } case l_oNode.hasNode.blinn: - l_aTexture.push( l_oNode.node.blinn.node.diffuse.node.texture ); + if ( l_oNode.node.blinn.hasNode.diffuse && l_oNode.node.blinn.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.blinn.node.diffuse.node.texture ); + } else if ( l_oNode.node.blinn.hasNode.emission && l_oNode.node.blinn.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.blinn.node.emission.node.texture ); + } case l_oNode.hasNode.constant: - l_aTexture.push( l_oNode.node.constant.node.diffuse.node.texture ); + if ( l_oNode.node.constant.hasNode.diffuse && l_oNode.node.constant.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.constant.node.diffuse.node.texture ); + } else if ( l_oNode.node.constant.hasNode.emission && l_oNode.node.constant.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.constant.node.emission.node.texture ); + } case l_oNode.hasNode.lambert: - l_aTexture.push( l_oNode.node.lambert.node.diffuse.node.texture ); + if ( l_oNode.node.lambert.hasNode.diffuse && l_oNode.node.lambert.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.lambert.node.diffuse.node.texture ); + } else if ( l_oNode.node.lambert.hasNode.emission && l_oNode.node.lambert.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.lambert.node.emission.node.texture ); + } case l_oNode.hasNode.phong: - l_aTexture.push( l_oNode.node.phong.node.diffuse.node.texture ); + if ( l_oNode.node.phong.hasNode.diffuse && l_oNode.node.phong.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.phong.node.diffuse.node.texture ); + } else if ( l_oNode.node.phong.hasNode.emission && l_oNode.node.phong.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.phong.node.emission.node.texture ); + } case l_oNode.hasNode.extra: - l_aTexture.push( l_oNode.node.extra.node.diffuse.node.texture ); + if ( l_oNode.node.extra.hasNode.diffuse && l_oNode.node.extra.node.diffuse.hasNode.texture ) { + l_aTexture.push( l_oNode.node.extra.node.diffuse.node.texture ); + } else if ( l_oNode.node.extra.hasNode.emission && l_oNode.node.extra.node.emission.hasNode.texture ) { + l_aTexture.push( l_oNode.node.extra.node.emission.node.texture ); + } } var l_oNodes : List = l_oNode.nodes.phong; From niel.drummond at grumpytoad.org Tue Dec 9 11:55:59 2008 From: niel.drummond at grumpytoad.org (Niel Drummond) Date: Tue, 09 Dec 2008 20:55:59 +0100 Subject: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux In-Reply-To: <802027.44846.qm@web35604.mail.mud.yahoo.com> References: <802027.44846.qm@web35604.mail.mud.yahoo.com> Message-ID: <493ECD4F.5000308@grumpytoad.org> Mj Mendoza IV wrote: > Has someone tried using Opensource FLEX SDK with Sandy under GNU/Linux? If yes, what IDE are you using on GNU/Linux? > > As I send this email, I am still trying to run FlashDevelop under WINE. > Do let me know if you get flashdevelop working on linux, I have tried before and not succeeded, also because of winforms implementation. I currently use the open source flex sdk (version 3 I think), with vim as an editor, so doesn't compete with an IDE - I read a better option is Eclipse with FDT, for a more feature-packed flash development environment. best of luck, - Niel > Mj > > > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From werner.avenant at gmail.com Wed Dec 10 00:46:48 2008 From: werner.avenant at gmail.com (Werner Avenant) Date: Wed, 10 Dec 2008 10:46:48 +0200 Subject: [Sandy] To the haxe sandy developers Message-ID: Hi Guys I know this is a development list but would like to bring the following to the attention of the haxe sandy developers. I'm pretty sure somewhere along the line someone is going to ask you Haxe Sandy: Why TweenerHX won't work with your Sandy objects: http://www.flashsandy.org/forum/viewtopic.php?f=5&t=1132 Hope this helps Werner From werner.avenant at gmail.com Wed Dec 10 00:58:24 2008 From: werner.avenant at gmail.com (Werner Avenant) Date: Wed, 10 Dec 2008 10:58:24 +0200 Subject: [Sandy] Opensource FLEX SDK + Sandy + GNU/Linux In-Reply-To: <493ECD4F.5000308@grumpytoad.org> References: <802027.44846.qm@web35604.mail.mud.yahoo.com> <493ECD4F.5000308@grumpytoad.org> Message-ID: Yes, flashdevelop won't run under wine I do all my flash work in Linux using Virtualbox-Ose, with an old copy of Windows 2000 installed. It works like a dream and runs pretty fast during development. But to test the compiled swf I still use linux as Flash (the standalone player) doesn't play too nicely with virtualbox On Tue, Dec 9, 2008 at 9:55 PM, Niel Drummond wrote: > Mj Mendoza IV wrote: > >> Has someone tried using Opensource FLEX SDK with Sandy under GNU/Linux? If >> yes, what IDE are you using on GNU/Linux? >> >> As I send this email, I am still trying to run FlashDevelop under WINE. >> >> > Do let me know if you get flashdevelop working on linux, I have tried > before and not succeeded, also because of winforms implementation. > > I currently use the open source flex sdk (version 3 I think), with vim as > an editor, so doesn't compete with an IDE - I read a better option is > Eclipse with FDT, for a more feature-packed flash development environment. > > best of luck, > - Niel > > Mj >> >> >> >> _______________________________________________ >> Sandy mailing list >> Sandy at osflash.org >> http://osflash.org/mailman/listinfo/sandy_osflash.org >> >> > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From niel.drummond at grumpytoad.org Wed Dec 10 12:27:16 2008 From: niel.drummond at grumpytoad.org (Niel Drummond) Date: Wed, 10 Dec 2008 21:27:16 +0100 Subject: [Sandy] To the haxe sandy developers In-Reply-To: References: Message-ID: <49402624.3050608@grumpytoad.org> Werner Avenant wrote: > Hi Guys > > I know this is a development list but would like to bring the following to > the attention of the haxe sandy developers. I'm pretty sure somewhere along > the line someone is going to ask you > > Haxe Sandy: Why TweenerHX won't work with your Sandy objects: > http://www.flashsandy.org/forum/viewtopic.php?f=5&t=1132 > Thanks for bringing this to my attention. In the examples we use an anonymous proxy object, which no doubt has a hit on performance. I'd been planning to switch to Michal Romeckio's FEffects library, because it has better support for other targets http://filt3r.free.fr/index.php/2008/04/12/50-feffects-for-haxe-010-tween-for-flash8-flash9-and-js . If you do some work with this, I would be interested in using it as defacto standard for the tweening examples. Thanks for your pointer. - Niel > Hope this helps > > Werner > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From kiroukou at gmail.com Wed Dec 10 15:17:14 2008 From: kiroukou at gmail.com (kiroukou) Date: Thu, 11 Dec 2008 00:17:14 +0100 Subject: [Sandy] [Rev 861] Major update/cleaning Message-ID: Hello all, I decided lately to remove some useless part of the Sandy package. Mainly because it was unoptimized and possibly lead to some memory leaks. So here is a first part of some changes I wanted to do for a while now. IT AFFECTS BACKWARD COMPATIBILITY ! (not a lot, but stll) Important changes: - cleaning of the event package. Now there is a cleaner implementation of EventBroadcaster which extends native EventDispatcher (with optimization), and BubbleEventBroadcaster extends that one. Basically the only changes this lead to are: - replace broadcastEvent with dispatchEvent - when you receive the Shape3DEvent, use myEvent.target.target to get the node which disptached the event (previously target was enough but now lead to the bubbleEventBroadcaster). - Cleaning of the scene property management on nodes and polygons. I think this change will allow some cleaning too with material manager etc.. - update/cull/render/display methods have their prototype simplified since no scene is required anymore. - TransformGroup and Group have their bounding volumes updated synchronously with the scenegraph creation. It means it can have an earlier culling (TODO). This has to be optimized since recomputed each cycle right now (should use bubbling/events instead) - BSphere can now be created from the BBox, which provide more accurate results. (BBox will be updated too later). - depthsorter package has been removed because not correctly managed and unoptimized. This are some major modifications. I have tested it, but please make some feedbacks asap, to allow developers to fix small issues rapidly. IMPORTANT: documentation hasn't been updated right now, which is on purpose until the change is validated. Thomas Pfeiffer kiroukou at gmail.com From petit at petitpub.com Wed Dec 10 15:53:10 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Thu, 11 Dec 2008 00:53:10 +0100 Subject: [Sandy] JavaFX to come Message-ID: <20081211005310.9zzxuoan1w8ww4c0@webmail.datakultur.com> Hi all! You may or not have noticed a new scripting language for Java, the Java FX. Says Streaming Media "Sun's JavaFX Sets Out to Challenge Flash and Silverlight" At http://www.streamingmedia.com/article.asp?id=10898 Time for another Sandy port in some distant future? (P From petit at petitpub.com Wed Dec 10 16:13:25 2008 From: petit at petitpub.com (petit at petitpub.com) Date: Thu, 11 Dec 2008 01:13:25 +0100 Subject: [Sandy] [Rev 861] Major update/cleaning In-Reply-To: References: Message-ID: <20081211011325.4xqp7fbeecs448k4@webmail.datakultur.com> kiroukou : says: > Hello all, > I decided lately to remove some useless part of the Sandy package. > Mainly because it was unoptimized and possibly lead to some memory > leaks. > So here is a first part of some changes I wanted to do for a while now. > > - depthsorter package has been removed because not correctly managed > and unoptimized. Seems like sandy.commands disappeared as well. > IMPORTANT: documentation hasn't been updated right now, which is on > purpose until the change is validated. So we'll wait with the doc changes then? /Petit From codesite-noreply at google.com Wed Dec 10 16:17:41 2008 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 11 Dec 2008 00:17:41 +0000 Subject: [Sandy] [sandy commit] r862 - in trunk/sandy/haxe/trunk/tests: . unit Message-ID: <0016e6509e8e0f3321045dba4ebf@google.com> Author: cyanescent Date: Wed Dec 10 15:47:14 2008 New Revision: 862 Added: trunk/sandy/haxe/trunk/tests/ trunk/sandy/haxe/trunk/tests/jsTest.html trunk/sandy/haxe/trunk/tests/testall.hxml trunk/sandy/haxe/trunk/tests/unit/ trunk/sandy/haxe/trunk/tests/unit/TestAll.hx trunk/sandy/haxe/trunk/tests/unit/TestParsers.hx Log: Adding some tests for Collada parsing. All tests work on js and flash9+. Tests require the external 'hxunit' library (as of writing can be found here http://code.google.com/p/hxunit/ ). Added: trunk/sandy/haxe/trunk/tests/jsTest.html ============================================================================== --- (empty file) +++ trunk/sandy/haxe/trunk/tests/jsTest.html Wed Dec 10 15:47:14 2008 @@ -0,0 +1,9 @@ + +haXe JSTest + +
+Your browser does not support the canvas tag. Get the latest firefox. + + + + Added: trunk/sandy/haxe/trunk/tests/testall.hxml ============================================================================== --- (empty file) +++ trunk/sandy/haxe/trunk/tests/testall.hxml Wed Dec 10 15:47:14 2008 @@ -0,0 +1,11 @@ +-cp ../src +-cp ../assets +-swf9 test.swf +-main unit.TestAll + +--next +-cp ../src +-cp ../assets +--remap flash:neash +-js test.js +-main unit.TestAll Added: trunk/sandy/haxe/trunk/tests/unit/TestAll.hx ============================================================================== --- (empty file) +++ trunk/sandy/haxe/trunk/tests/unit/TestAll.hx Wed Dec 10 15:47:14 2008 @@ -0,0 +1,43 @@ +/* +# ***** BEGIN LICENSE BLOCK ***** +Copyright the original author or authors. +Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (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.mozilla.org/MPL/MPL-1.1.html +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. + +# ***** END LICENSE BLOCK ***** +*/ + +/* All of these tests require the 'hxunit' package available here: http://code.google.com/p/hxunit/ */ + +package unit; + +class TestAll { + + public static function main() { + + // bootstrap the javascript environment +#if js + neash.Lib.Init("Container", 400, 400); + neash.Lib.Run(); + + if(haxe.Firebug.detect()) { + haxe.Firebug.redirectTraces(); + } +#end + + var r = new hxunit.Runner(); + TestParsers.add(r); +#if development + // personal sandbox - provided on request, but not really useful + TestSandbox.add(r); +#end + r.run(); + } +} Added: trunk/sandy/haxe/trunk/tests/unit/TestParsers.hx ============================================================================== --- (empty file) +++ trunk/sandy/haxe/trunk/tests/unit/TestParsers.hx Wed Dec 10 15:47:14 2008 @@ -0,0 +1,135 @@ +/* +# ***** BEGIN LICENSE BLOCK ***** +Copyright the original author or authors. +Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (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.mozilla.org/MPL/MPL-1.1.html +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. + +# ***** END LICENSE BLOCK ***** +*/ + +/* note: Javascript tests must be run from a web server - not local file, due to + * same-domain restrictions */ + +package unit; + +import hxunit.TestCase; +import hxunit.Assert; +import sandy.parser.IParser; +import sandy.parser.Parser; +import sandy.parser.ColladaParser; +import sandy.parser.ParserEvent; +import sandy.core.scenegraph.Camera3D; +import sandy.core.scenegraph.Group; +import sandy.core.scenegraph.Geometry3D; +import sandy.core.scenegraph.Shape3D; +import sandy.materials.BitmapMaterial; +import sandy.materials.ColorMaterial; +#if flash +import sandy.core.scenegraph.StarField; +import sandy.core.data.Vertex; +import flash.filters.GlowFilter; +import flash.text.TextField; +#end +import sandy.core.Scene3D; +import sandy.primitive.Box; +import sandy.view.ViewPort; +import flash.display.Sprite; +import flash.events.Event; +import flash.Lib; +import flash.net.URLRequest; +import flash.net.URLLoader; +import formats.json.JSON; +import Type; + +class TestParsers extends TestCase { + + public static function add ( r:hxunit.Runner ) { + r.addCase( new TestCollada() ); + } + +} + +class TestCollada extends TestCase { + + public function testDice() { + + var parser: ColladaParser = Parser.create( "../assets/dice.dae", Parser.COLLADA ); + var ttl = 1000; + + var self = this; + var root : Group = null; + var func = function () { + self.assertEquals( root.children.length, 1 ); + self.assertIs( root.children[0], sandy.core.scenegraph.Shape3D ); + var l_oGeom : Geometry3D = Reflect.field( root.children[0], 'm_oGeometry' ); + self.assertEquals( l_oGeom.aFacesVertexID.length, 12 ); + self.assertEquals( l_oGeom.aVertex.length, 8 ); + self.assertEquals( l_oGeom.aFacesNormals.length, 12 ); + self.assertEquals( l_oGeom.aUVCoords.length, 14 ); + self.assertIs( root.children[0].appearance.frontMaterial, BitmapMaterial ); + var l_oMat : BitmapMaterial = untyped root.children[0].appearance.frontMaterial; + var l_oULoader : URLLoader = new URLLoader(); + l_oULoader.addEventListener( 'INIT', function ( e:Event ) { + self.assertEquals( e.target.bitmapData, l_oMat.texture ); + } ); + l_oULoader.load( new URLRequest( '../assets/dice.jpg' ) ); + } + var cb = asyncResponder( func, ttl ); + parser.addEventListener( ParserEvent.INIT, + function (pEvt) {root = pEvt.group; cb();} ); + + parser.parse(); + + } + + public function testMenu3() { + + var parser: ColladaParser = Parser.create( "../assets/arrow.dae", Parser.COLLADA ); + var ttl = 1000; + + var self = this; + var root : Group = null; + var func = function () { + + self.assertEquals( root.children.length, 2 ); + self.assertIs( root.children[0], sandy.core.scenegraph.Shape3D ); + var l_oGeom : Geometry3D = Reflect.field( root.children[0], 'm_oGeometry' ); + self.assertEquals( l_oGeom.aFacesVertexID.length, 38 ); + self.assertEquals( l_oGeom.aVertex.length, 21 ); + self.assertEquals( l_oGeom.aFacesNormals.length, 38 ); + self.assertEquals( l_oGeom.aUVCoords.length, 34 ); + + self.assertIs( root.children[1].appearance.frontMaterial, BitmapMaterial ); + var l_oMat : BitmapMaterial = untyped root.children[1].appearance.frontMaterial; + var l_oULoader : URLLoader = new URLLoader(); + l_oULoader.addEventListener( 'INIT', function ( e:Event ) { + self.assertEquals( e.target.bitmapData, l_oMat.texture ); + } ); + l_oULoader.load( new URLRequest( '../assets/pCube1SG-pCube2.jpg' ) ); + + self.assertIs( root.children[0].appearance.frontMaterial, BitmapMaterial ); + var l_oMat : BitmapMaterial = untyped root.children[1].appearance.frontMaterial; + var l_oULoader : URLLoader = new URLLoader(); + l_oULoader.addEventListener( 'INIT', function ( e:Event ) { + self.assertEquals( e.target.bitmapData, l_oMat.texture ); + } ); + l_oULoader.load( new URLRequest( '../assets/pCube1SG-pasted__pPlane1.jpg' ) ); + + } + var cb = asyncResponder( func, ttl ); + parser.addEventListener( ParserEvent.INIT, + function (pEvt) {root = pEvt.group; cb();} ); + + parser.parse(); + + } + +} + From rafajafar at gmail.com Wed Dec 10 18:03:07 2008 From: rafajafar at gmail.com (rafajafar at gmail.com) Date: Thu, 11 Dec 2008 02:03:07 +0000 Subject: [Sandy] JavaFX to come Message-ID: <001636163c5f1b3258045dbbc78a@google.com> hehe, I dont think so. It runs crazy slow, and Java already has OpenGL support. Plus, dunno if you've seen the examples, but it's nothing for Adobe to get worried about. On Dec 10, 2008 6:53pm, petit at petitpub.com wrote: > Hi all! > > > > You may or not have noticed a new scripting language for Java, the Java FX. > > Says Streaming Media "Sun's JavaFX Sets Out to Challenge Flash and Silverlight" > > At http://www.streamingmedia.com/article.asp?id=10898 > > > > Time for another Sandy port in some distant future? > > > > (P > > > > _______________________________________________ > > Sandy mailing list > > Sandy at osflash.org > > http://osflash.org/mailman/listinfo/sandy_osflash.org > From creek23grupzer0 at yahoo.com Wed Dec 10 20:40:54 2008 From: creek23grupzer0 at yahoo.com (Mj Mendoza IV) Date: Wed, 10 Dec 2008 20:40:54 -0800 (PST) Subject: [Sandy] JavaFX to come In-Reply-To: <001636163c5f1b3258045dbbc78a@google.com> Message-ID: <68490.81411.qm@web35607.mail.mud.yahoo.com> Java really is still to slow. Even with all the attempts (JIT compiler, opengl, "even faster" VM). It can't beat the speed of SWF loading/parsing of Flash. Java platform is just too bloated. Although, hi-res 3D is the edge of Java over Flash. Mj --- On Thu, 12/11/08, rafajafar at gmail.com wrote: > From: rafajafar at gmail.com > Subject: Re: [Sandy] JavaFX to come > To: sandy at osflash.org > Date: Thursday, December 11, 2008, 10:03 AM > hehe, I dont think so. > > It runs crazy slow, and Java already has OpenGL support. > > Plus, dunno if you've seen the examples, but it's > nothing for Adobe to get > worried about. > > On Dec 10, 2008 6:53pm, petit at petitpub.com wrote: > > Hi all! > > > > > > > > You may or not have noticed a new scripting language > for Java, the Java > FX. > > > > Says Streaming Media "Sun's JavaFX Sets Out > to Challenge Flash and > Silverlight" > > > > At http://www.streamingmedia.com/article.asp?id=10898 > > > > > > > > Time for another Sandy port in some distant future? > > > > > > > > (P > > > > > > > > _______________________________________________ > > > > Sandy mailing list > > > > Sandy at osflash.org > > > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org From kiroukou at gmail.com Wed Dec 10 23:11:19 2008 From: kiroukou at gmail.com (Thomas Pfeiffer) Date: Thu, 11 Dec 2008 08:11:19 +0100 Subject: [Sandy] [Rev 861] Major update/cleaning In-Reply-To: <20081211011325.4xqp7fbeecs448k4@webmail.datakultur.com> References: <20081211011325.4xqp7fbeecs448k4@webmail.datakultur.com> Message-ID: indeed petit, this package was there for the event broadcaster implementation, and is not necessary from now. about the documentation, i'll complete it as soon as we agreed that the changes are good and implementation is validated. this is for avoiding too many documentation changes during the development phasis. have some of you guys been able to try the trunk? 2008/12/11, petit at petitpub.com : > kiroukou : says: > >> Hello all, >> I decided lately to remove some useless part of the Sandy package. >> Mainly because it was unoptimized and possibly lead to some memory >> leaks. >> So here is a first part of some changes I wanted to do for a while now. >> > > >> - depthsorter package has been removed because not correctly managed >> and unoptimized. > > Seems like sandy.commands disappeared as well. > > > >> IMPORTANT: documentation hasn't been updated right now, which is on >> purpose until the change is validated. > > So we'll wait with the doc changes then? > > /Petit > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From werner.avenant at gmail.com Thu Dec 11 00:18:09 2008 From: werner.avenant at gmail.com (Werner Avenant) Date: Thu, 11 Dec 2008 10:18:09 +0200 Subject: [Sandy] JavaFX to come In-Reply-To: <68490.81411.qm@web35607.mail.mud.yahoo.com> References: <001636163c5f1b3258045dbbc78a@google.com> <68490.81411.qm@web35607.mail.mud.yahoo.com> Message-ID: Speaking of speed and openGL intergration. I'm convinced that the next evolutionary step for Flash is direct integration with the GPU. Everything is pointing that way - just the fact that flash already has a basic camera object is enough of a foundation. I think in time Sandy's core (and all other 3D engines) will become wrapper objects calling Flash's direct GPU functions. Of course the good news will be that all your existing Sandy projects will be 100% ready (and you'll still have the added benefits of importing external objects, for example) I Adobe spends enough money on this they would skip OpenGL altogether (ie, they won't implement a layer on top of OpenGL) and make their VM speak directly to the GPU. They can learn from OpenGL's mistakes, and grab this opportunity to become the first true cross platform gaming system. If you think about it, the 3D work we do now is very similar to the work that Id Software did in 1994/95, think wolfenstein, doom I. It's just a matter of time before we'll play games like COD on a Flash VM. On Thu, Dec 11, 2008 at 6:40 AM, Mj Mendoza IV wrote: > Java really is still to slow. Even with all the attempts (JIT compiler, > opengl, "even faster" VM). > > It can't beat the speed of SWF loading/parsing of Flash. > > Java platform is just too bloated. > > Although, hi-res 3D is the edge of Java over Flash. > > Mj > > > --- On Thu, 12/11/08, rafajafar at gmail.com wrote: > > > From: rafajafar at gmail.com > > Subject: Re: [Sandy] JavaFX to come > > To: sandy at osflash.org > > Date: Thursday, December 11, 2008, 10:03 AM > > hehe, I dont think so. > > > > It runs crazy slow, and Java already has OpenGL support. > > > > Plus, dunno if you've seen the examples, but it's > > nothing for Adobe to get > > worried about. > > > > On Dec 10, 2008 6:53pm, petit at petitpub.com wrote: > > > Hi all! > > > > > > > > > > > > You may or not have noticed a new scripting language > > for Java, the Java > > FX. > > > > > > Says Streaming Media "Sun's JavaFX Sets Out > > to Challenge Flash and > > Silverlight" > > > > > > At http://www.streamingmedia.com/article.asp?id=10898 > > > > > > > > > > > > Time for another Sandy port in some distant future? > > > > > > > > > > > > (P > > > > > > > > > > > > _______________________________________________ > > > > > > Sandy mailing list > > > > > > Sandy at osflash.org > > > > > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > > > _______________________________________________ > > Sandy mailing list > > Sandy at osflash.org > > http://osflash.org/mailman/listinfo/sandy_osflash.org > > > > > _______________________________________________ > Sandy mailing list > Sandy at osflash.org > http://osflash.org/mailman/listinfo/sandy_osflash.org > From kiroukou at gmail.com Thu Dec 11 00:39:34 2008 From: kiroukou at gmail.com (Thomas Pfeiffer) Date: Thu, 11 Dec 2008 09:39:34 +0100 Subject: [Sandy] JavaFX to come In-Reply-To: References: <001636163c5f1b3258045dbbc78a@google.com> <68490.81411.qm@web35607.mail.mud.yahoo.com> Message-ID: I totally agree on this point. Adobe has pushed a lot of efforts on making Flash player inside 99% of computers, gave to the player a lot of 2D features to make it a must have (video, sound etc.) Now the community is aking for some more power and speed. Speed in rendering espacially, because with pixel bender and alchemy, we now have a better computation speed (and AMV2 improvement was only with excecution time). Now Adobe has understood we need better rendering and more speed, we can expect them to give that to us. Game industry (which is really big market for the web) needs it, and 3D too. Now, when we see the way they took advantage of the GPU with new wmode, I can't be sure how fast that result can be... 2008/12/11 Werner Avenant > Speaking of speed and openGL intergration. > > I'm convinced that the next evolutionary step for Flash is direct > integration with the GPU. Everything is pointing that way - just the fact > that flash already has a basic camera object is enough of a foundation. > > I think in time Sandy's core (and all other 3D engines) will become wrapper > objects calling Flash's direct GPU functions. Of course the good news will > be that all your existing Sandy projects will be 100% ready (and you'll > still have the added benefits of importing external objects, for example) > > I Adobe spends enough money on this they would skip OpenGL altogether (ie, > they won't implement a layer on top of OpenGL) and make their VM speak > directly to the GPU. They can learn from OpenGL's mistakes, and grab this > opportunity to become the first true cross platform gaming system. > > If you think about it, the 3D work we do now is very similar to the work > that Id Software did in 1994/95, think wolfenstein, doom I. It's just a > matter of time before we'll play games like COD on a Flash VM. > > > > > On Thu, Dec 11, 2008 at 6:40 AM, Mj Mendoza IV >wrote: > > > Java really is still to slow. Even with all the attempts (JIT compiler, > > opengl, "even faster" VM). > > > > It can't beat the speed of SWF loading/parsing of Flash. > > > > Java platform is just too bloated. > > > > Although, hi-res 3D is the edge of Java over Flash. > > > > Mj > > > > > > --- On Thu, 12/11/08, rafajafar at gmail.com wrote: > > > > > From: rafajafar at gmail.com > > > Subject: Re: [Sandy] JavaFX to come > > > To: sandy at osflash.org > > > Date: Thursday, December 11, 2008, 10:03 AM > > > hehe, I dont think so. > > > > > > It runs crazy slow, and Java already has OpenGL support. > > > > > > Plus, dunno if you've seen the examples, but it's > > > nothing for Adobe to get > > > worried about. > > > > > > On Dec 10, 2008 6:53pm, petit at petitpub.com wrote: > > > > Hi all! > > > > > > > > > > > > > > > > You may or not have noticed a new scripting language > > > for Java, the Java > > > FX. > > > > > > > > Says Streaming Media "Sun's JavaFX Sets Out > > > to Challenge Flash and > > > Silverlight" > > > > > > > > At http://www.streamingmedi