Ejemplo n.º 1
0
 public void WeldVertices(WeldEpsilonsFlags flags, WeldEpsilons epsilons, GraphicsStream adjacencyIn, GraphicsStream adjacencyOut, out int[] faceRemap, out GraphicsStream vertexRemap)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 2
0
 public void WeldVertices(WeldEpsilonsFlags flags, WeldEpsilons epsilons, GraphicsStream adjacencyIn, [Out] GraphicsStream adjacencyOut)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
            public OptimizeArguments(OpsParsedStatement statement)
            {
                OpsParsedArgument splits  = statement.FindArgument("splits");
                OpsParsedArgument nocache = statement.FindArgument("nocache");
                OpsParsedArgument weld    = statement.FindArgument("weld");
                OpsParsedArgument e       = statement.FindArgument("e");
                OpsParsedArgument P       = statement.FindArgument("P");
                OpsParsedArgument W       = statement.FindArgument("W");
                OpsParsedArgument N       = statement.FindArgument("N");
                OpsParsedArgument T       = statement.FindArgument("T");
                OpsParsedArgument B       = statement.FindArgument("B");
                OpsParsedArgument UV      = statement.FindArgument("UV");
                OpsParsedArgument D       = statement.FindArgument("D");
                OpsParsedArgument S       = statement.FindArgument("S");
                OpsParsedArgument PS      = statement.FindArgument("PS");
                OpsParsedArgument F       = statement.FindArgument("F");


                if (splits != null && int.Parse(splits.Value) == 0)
                {
                    meshFlags |= MeshFlags.OptimizeDoNotSplit;
                }

                if (nocache != null && int.Parse(nocache.Value) == 0)
                {
                    meshFlags |= MeshFlags.OptimizeVertexCache;
                }

                if (weld != null)
                {
                    if (0 == String.Compare(weld.Value, "none", true))
                    {
                        weldType = WeldType.None;
                    }
                    else if (0 == String.Compare(weld.Value, "all", true))
                    {
                        weldType      = WeldType.All;
                        epsilonFlags |= WeldEpsilonsFlags.WeldAll;
                    }
                }


                if (weldType == WeldType.Epsilon)
                {
                    float delta = 1.0e-6f;

                    if (e != null)
                    {
                        delta = float.Parse(e.Value);
                    }

                    epsilons.Binormal         = delta;
                    epsilons.BlendWeights     = delta;
                    epsilons.Diffuse          = delta;
                    epsilons.Normal           = delta;
                    epsilons.PointSize        = delta;
                    epsilons.Position         = delta;
                    epsilons.Specular         = delta;
                    epsilons.Tangent          = delta;
                    epsilons.TessellateFactor = delta;

                    if (P != null)
                    {
                        epsilons.Position = float.Parse(P.Value);
                    }

                    if (W != null)
                    {
                        epsilons.BlendWeights = float.Parse(W.Value);
                    }

                    if (N != null)
                    {
                        epsilons.Normal = float.Parse(N.Value);
                    }

                    if (T != null)
                    {
                        epsilons.Tangent = float.Parse(T.Value);
                    }

                    if (B != null)
                    {
                        epsilons.Binormal = float.Parse(B.Value);
                    }

                    float   uvDelta      = (UV == null) ? delta : float.Parse(UV.Value);
                    float[] uvDeltaArray = epsilons.TextureCoordinate;
                    for (int i = 0; i < uvDeltaArray.Length; i++)
                    {
                        uvDeltaArray[i] = uvDelta;
                    }
                    epsilons.TextureCoordinate = uvDeltaArray;

                    if (D != null)
                    {
                        epsilons.Diffuse = float.Parse(D.Value);
                    }

                    if (S != null)
                    {
                        epsilons.Specular = float.Parse(S.Value);
                    }

                    if (PS != null)
                    {
                        epsilons.PointSize = float.Parse(PS.Value);
                    }

                    if (F != null)
                    {
                        epsilons.TessellateFactor = float.Parse(F.Value);
                    }
                }
            }
Ejemplo n.º 4
0
 public void WeldVertices(WeldEpsilonsFlags flags, WeldEpsilons epsilons, int[] adjacencyIn)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
            public OptimizeArguments(OpsParsedStatement statement)
            {
                OpsParsedArgument splits = statement.FindArgument("splits");
                OpsParsedArgument nocache = statement.FindArgument("nocache");
                OpsParsedArgument weld = statement.FindArgument("weld");
                OpsParsedArgument e = statement.FindArgument("e");
                OpsParsedArgument P = statement.FindArgument("P");
                OpsParsedArgument W = statement.FindArgument("W");
                OpsParsedArgument N = statement.FindArgument("N");
                OpsParsedArgument T = statement.FindArgument("T");
                OpsParsedArgument B = statement.FindArgument("B");
                OpsParsedArgument UV = statement.FindArgument("UV");
                OpsParsedArgument D = statement.FindArgument("D");
                OpsParsedArgument S = statement.FindArgument("S");
                OpsParsedArgument PS = statement.FindArgument("PS");
                OpsParsedArgument F = statement.FindArgument("F");


                if( splits != null && int.Parse(splits.Value) == 0)
                    meshFlags |= MeshFlags.OptimizeDoNotSplit;

                if( nocache != null && int.Parse(nocache.Value) == 0)
                    meshFlags |= MeshFlags.OptimizeVertexCache;

                if( weld != null)
                {
                    if( 0 == String.Compare( weld.Value, "none", true) )
                    {
                        weldType = WeldType.None;
                    }
                    else if( 0 == String.Compare( weld.Value, "all", true) )
                    {
                        weldType = WeldType.All;
                        epsilonFlags |= WeldEpsilonsFlags.WeldAll;
                    }
                }


                if(weldType == WeldType.Epsilon)
                {
                    float delta = 1.0e-6f;

                    if(e != null)
                        delta = float.Parse( e.Value );

                    epsilons.Binormal=delta;
                    epsilons.BlendWeights=delta;
                    epsilons.Diffuse=delta;
                    epsilons.Normal=delta;
                    epsilons.PointSize=delta;
                    epsilons.Position=delta;
                    epsilons.Specular=delta;
                    epsilons.Tangent=delta;
                    epsilons.TessellateFactor=delta;

                    if(P != null)
                        epsilons.Position = float.Parse( P.Value );

                    if(W != null)
                        epsilons.BlendWeights = float.Parse( W.Value );

                    if(N != null)
                        epsilons.Normal = float.Parse( N.Value );

                    if(T != null)
                        epsilons.Tangent = float.Parse( T.Value );

                    if(B != null)
                        epsilons.Binormal = float.Parse( B.Value );

                    float uvDelta = (UV == null) ? delta : float.Parse( UV.Value );
                    float[] uvDeltaArray = epsilons.TextureCoordinate;
                    for( int i = 0; i < uvDeltaArray.Length; i++)
                        uvDeltaArray[i] = uvDelta;
                    epsilons.TextureCoordinate = uvDeltaArray;

                    if(D != null)
                        epsilons.Diffuse = float.Parse( D.Value );

                    if(S != null)
                        epsilons.Specular = float.Parse( S.Value );

                    if(PS != null)
                        epsilons.PointSize = float.Parse( PS.Value );

                    if(F != null)
                        epsilons.TessellateFactor = float.Parse( F.Value );
                }

            
            }