Exemplo n.º 1
0
 private static ITexture ProcessTexture(bool hasTexture, Color4D color4, TextureSlot textureSlot, string dir)
 {
     Log.Info($"Processing texture:: hasTex:{hasTexture}, Color: {color4}, Texture:{textureSlot.FilePath}");
     return(hasTexture
         ? (ITexture) new Texture(Path.Combine(dir, textureSlot.FilePath))
         : new SolidColor(Color.FromAssimpColor4(color4)));
 }
Exemplo n.º 2
0
 public static void Write(this BinaryWriter writer, Color4D val)
 {
     writer.Write(val.R);
     writer.Write(val.G);
     writer.Write(val.B);
     writer.Write(val.A);
 }
Exemplo n.º 3
0
 public void WriteColor4D(Color4D color)
 {
     this.Write(color.R);
     this.Write(color.G);
     this.Write(color.B);
     this.Write(color.A);
 }
Exemplo n.º 4
0
 public void WriteColor4D(Color4D color)
 {
     this.Write(color.R);
     this.Write(color.G);
     this.Write(color.B);
     this.Write(color.A);
 }
Exemplo n.º 5
0
 public static void Write(this BinaryWriter writer, Color4D v)
 {
     writer.Write(v.R);
     writer.Write(v.G);
     writer.Write(v.B);
     writer.Write(v.A);
 }
 public static Color FromAssimp(this Color4D value)
 {
     return(new Color(( byte )(value.R * 255f),
                      ( byte )(value.G * 255f),
                      ( byte )(value.B * 255f),
                      ( byte )(value.A * 255f)));
 }
        public void TestOpSubtractByValue()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r     = r1 - value;
            float g     = g1 - value;
            float b     = b1 - value;
            float a     = a1 - value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 - value;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtractValue");

            r = value - r1;
            g = value - g1;
            b = value - b1;
            a = value - a1;

            //Test right to left
            c = value - c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtractValue");
        }
Exemplo n.º 8
0
 public static Color ToNumerics(this Color4D value)
 {
     return(new Color(( byte )(value.R * 255f),
                      ( byte )(value.G * 255f),
                      ( byte )(value.B * 255f),
                      ( byte )(value.A * 255f)));
 }
        public void TestEquals()
        {
            float r1 = .25f, g1 = .1f, b1 = .75f, a1 = 1.0f;
            float r2 = .75f, g2 = 1.0f, b2 = 1.0f, a2 = .5f;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r1, g1, b1, a1);
            Color4D c3 = new Color4D(r2, g2, b2, a2);

            //Test IEquatable Equals
            Assert.IsTrue(c1.Equals(c2), "Test IEquatable equals");
            Assert.IsFalse(c1.Equals(c3), "Test IEquatable equals");

            //Test object equals override
            Assert.IsTrue(c1.Equals((object)c2), "Tests object equals");
            Assert.IsFalse(c1.Equals((object)c3), "Tests object equals");

            //Test op equals
            Assert.IsTrue(c1 == c2, "Testing OpEquals");
            Assert.IsFalse(c1 == c3, "Testing OpEquals");

            //Test op not equals
            Assert.IsTrue(c1 != c3, "Testing OpNotEquals");
            Assert.IsFalse(c1 != c2, "Testing OpNotEquals");
        }
Exemplo n.º 10
0
 public static void AssertEquals(float r, float g, float b, float a, Color4D c)
 {
     AssertEquals(r, c.R);
     AssertEquals(g, c.G);
     AssertEquals(b, c.B);
     AssertEquals(a, c.A);
 }
Exemplo n.º 11
0
 public static void AssertEquals(float r, float g, float b, float a, Color4D c, String msg)
 {
     AssertEquals(r, c.R, msg + String.Format(" => checking R component ({0} == {1}", r, c.R));
     AssertEquals(g, c.G, msg + String.Format(" => checking G component ({0} == {1}", g, c.G));
     AssertEquals(b, c.B, msg + String.Format(" => checking B component ({0} == {1}", b, c.B));
     AssertEquals(a, c.A, msg + String.Format(" => checking A component ({0} == {1}", a, c.A));
 }
Exemplo n.º 12
0
        public void TestEquals()
        {
            float r1 = .25f, g1 = .1f, b1 = .75f, a1 = 1.0f;
            float r2 = .75f, g2 = 1.0f, b2 = 1.0f, a2 = .5f;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r1, g1, b1, a1);
            Color4D c3 = new Color4D(r2, g2, b2, a2);

            //Test IEquatable Equals
            Assert.IsTrue(c1.Equals(c2), "Test IEquatable equals");
            Assert.IsFalse(c1.Equals(c3), "Test IEquatable equals");

            //Test object equals override
            Assert.IsTrue(c1.Equals((object) c2), "Tests object equals");
            Assert.IsFalse(c1.Equals((object) c3), "Tests object equals");

            //Test op equals
            Assert.IsTrue(c1 == c2, "Testing OpEquals");
            Assert.IsFalse(c1 == c3, "Testing OpEquals");

            //Test op not equals
            Assert.IsTrue(c1 != c3, "Testing OpNotEquals");
            Assert.IsFalse(c1 != c2, "Testing OpNotEquals");
        }
Exemplo n.º 13
0
 private static (float emissive, float diffuse, float reflective, float refractive) ProcessMaterialParts(
     Color4D ambient, Color4D diffuse, Color4D specular)
 {
     (float emissive, float diffuse, float reflective, float refractive)parts =
         (Color.FromAssimpColor4(ambient).GetBrightness(), Color.FromAssimpColor4(diffuse).GetBrightness(),
          Color.FromAssimpColor4(specular).GetBrightness(), 0);
     return(parts);
 }
Exemplo n.º 14
0
        //public override void UnapplyMaterial(Mesh, Material, Tex)

        public override void ApplyGhostMaterial(Mesh mesh, Material material, bool shaded, bool twoSided)
        {
            var color    = new Color4D(.6f, .6f, .9f, 0.15f);
            var oldColor = material.ColorDiffuse;

            material.ColorDiffuse = color;
            ApplyMaterial(mesh, material, false, shaded, twoSided);
            material.ColorDiffuse = oldColor;
        }
Exemplo n.º 15
0
 public static Color FromAssimpColor4(Color4D color4)
 {
     return(new Color
     {
         R = color4.R,
         G = color4.G,
         B = color4.B
     });
 }
Exemplo n.º 16
0
 public static Color4 FromColor(Color4D color)
 {
     Color4 c;
     c.R = color.R;
     c.G = color.G;
     c.B = color.B;
     c.A = color.A;
     return c;
 }
Exemplo n.º 17
0
 public FullVertex(Vector4 position)
 {
     _position          = new Vector4(0, 0, 0, 0);
     _normal            = new Vector4(0, 0, 0, 0);
     _color             = new Color4D(1, 1, 1, 1);
     _textureCoordinate = new Vector4(0, 0, 0, 0);
     _tangent           = new Vector4(0, 0, 0, 0);
     _bitangent         = new Vector4(0, 0, 0, 0);
 }
Exemplo n.º 18
0
        private Color4 FromColor(Color4D color)
        {
            Color4 c;

            c.R = color.R;
            c.G = color.G;
            c.B = color.B;
            c.A = color.A;
            return(c);
        }
Exemplo n.º 19
0
        protected Color4 toColor(Color4D color)
        {
            Color4 c;

            c.R = color.R;
            c.G = color.G;
            c.B = color.B;
            c.A = color.A;
            return(c);
        }
Exemplo n.º 20
0
        public static Vector4 FromAssimpColor(Color4D col)
        {
            Vector4 outCol;

            outCol.X = col.R;
            outCol.Y = col.G;
            outCol.Z = col.B;
            outCol.W = col.A;
            return(outCol);
        }
Exemplo n.º 21
0
        public static Color4 FromColor(Color4D color)
        {
            Color4 c;

            c.R = color.R;
            c.G = color.G;
            c.B = color.B;
            c.A = color.A;
            return(c);
        }
        public void TestIsBlack()
        {
            Color4D c1 = new Color4D(0, 0, 0, 1.0f);
            Color4D c2 = new Color4D(.25f, 1.0f, .5f, 1.0f) * .002f;
            Color4D c3 = new Color4D(.25f, .65f, 1.0f);

            Assert.IsTrue(c1.IsBlack(), "Testing isBlack");
            Assert.IsTrue(c2.IsBlack(), "Testing isBlack");
            Assert.IsFalse(c3.IsBlack(), "Testing !isBlack");
        }
Exemplo n.º 23
0
        private Color FromColor(Color4D color)
        {
            Color c;

            c.R = (byte)(color.R * 255);
            c.G = (byte)(color.G * 255);
            c.B = (byte)(color.B * 255);
            c.A = (byte)(color.A * 255);
            return(c);
        }
Exemplo n.º 24
0
 public void TestIndexer()
 {
     float r = .25f, g = .5f, b = .05f, a = 1.0f;
     Color4D c = new Color4D();
     c[0] = r;
     c[1] = g;
     c[2] = b;
     c[3] = a;
     TestHelper.AssertEquals(r, c[0], "Test Indexer, R");
     TestHelper.AssertEquals(g, c[1], "Test Indexer, G");
     TestHelper.AssertEquals(b, c[2], "Test Indexer, B");
     TestHelper.AssertEquals(a, c[3], "Test Indexer, A");
 }
Exemplo n.º 25
0
        public void TestDivideByFactor()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 / value;
            float g = g1 / value;
            float b = b1 / value;
            float a = a1 / value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            Color4D c = c1 / value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpDivideByFactor");
        }
Exemplo n.º 26
0
        public void TestDivideByFactor()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 / value;
            float g = g1 / value;
            float b = b1 / value;
            float a = a1 / value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            Color4D c = c1 / value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpDivideByFactor");
        }
Exemplo n.º 27
0
        public override void Convert(ConverterContext context)
        {
            var colors = context.Mesh.VertexColorChannels[0];
            var color  = new Color4D(1, 1, 1, 1);

            if (context.VertexIndex < colors.Count)
            {
                color = colors[context.VertexIndex];
            }
            context.ValuesList.Add(color.R);
            context.ValuesList.Add(color.G);
            context.ValuesList.Add(color.B);
            context.ValuesList.Add(color.A);
        }
        public void TestOpMultiply()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 * r2;
            float g = g1 * g2;
            float b = b1 * b2;
            float a = a1 * a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c  = c1 * c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiply");
        }
        public void TestOpSubtract()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 - r2;
            float g = g1 - g2;
            float b = b1 - b2;
            float a = a1 - a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c  = c1 - c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtract");
        }
Exemplo n.º 30
0
        public void TestDivide()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 / r2;
            float g = g1 / g2;
            float b = b1 / b2;
            float a = a1 / a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c = c1 / c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpDivide");
        }
        public void TestDivide()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 / r2;
            float g = g1 / g2;
            float b = b1 / b2;
            float a = a1 / a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c  = c1 / c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpDivide");
        }
        public void TestOpAdd()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 + r2;
            float g = g1 + g2;
            float b = b1 + b2;
            float a = a1 + a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c  = c1 + c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAdd");
        }
Exemplo n.º 33
0
        private static void WorldToScene(Scene scene, World_000B world, string textureExtension)
        {
            for (int i = 0; i < world.materialList.materialList.Length; i++)
            {
                var mat = world.materialList.materialList[i];

                scene.Materials.Add(new Material()
                {
                    ColorDiffuse = new Color4D(
                        mat.materialStruct.color.R / 255f,
                        mat.materialStruct.color.G / 255f,
                        mat.materialStruct.color.B / 255f,
                        mat.materialStruct.color.A / 255f),
                    TextureDiffuse = mat.materialStruct.isTextured != 0 ? new TextureSlot()
                    {
                        FilePath    = mat.texture.diffuseTextureName.stringString + textureExtension,
                        TextureType = TextureType.Diffuse
                    } : default,
Exemplo n.º 34
0
        public void TestOpMultiplyByScalar()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 * value;
            float g = g1 * value;
            float b = b1 * value;
            float a = a1 * value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 * value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiplyByValue");

            //Test right to left
            c = value * c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiplyByValue");
        }
Exemplo n.º 35
0
        public void TestOpAddValue()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 + value;
            float g = g1 + value;
            float b = b1 + value;
            float a = a1 + value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 + value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAddValue");

            //Test right to left
            c = value + c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAddValue");
        }
Exemplo n.º 36
0
 /// <summary>
 /// Retrieves a color value from the material property table.
 /// </summary>
 /// <param name="mat">Material to retrieve the data from</param>
 /// <param name="key">Ai mat key (base) name to search for</param>
 /// <param name="texType">Texture Type semantic, always zero for non-texture properties</param>
 /// <param name="texIndex">Texture index, always zero for non-texture properties</param>
 /// <returns>The color if it exists. If not, the default Color4D value is returned.</returns>
 public static Color4D GetMaterialColor(ref AiMaterial mat, String key, TextureType texType, uint texIndex)
 {
     IntPtr ptr = IntPtr.Zero;
     try {
         ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Color4D)));
         aiGetMaterialColor(ref mat, key, (uint) texType, texIndex, ptr);
         Color4D color = new Color4D();
         if(ptr != IntPtr.Zero) {
             color = MemoryHelper.MarshalStructure<Color4D>(ptr);
         }
         return color;
     } finally {
         if(ptr != IntPtr.Zero) {
             Marshal.FreeHGlobal(ptr);
         }
     }
 }
Exemplo n.º 37
0
 private static unsafe Color4 ConvertColor(Color4D value)
 {
     return *(Color4*)&value;
 }
Exemplo n.º 38
0
 private unsafe static SharpDX.Color4 ConvertColor(Color4D value)
 {
     return *(SharpDX.Color4*)&value;
 }
Exemplo n.º 39
0
        public void TestIsBlack()
        {
            Color4D c1 = new Color4D(0, 0, 0, 1.0f);
            Color4D c2 = new Color4D(.25f, 1.0f, .5f, 1.0f) * .002f;
            Color4D c3 = new Color4D(.25f, .65f, 1.0f);

            Assert.IsTrue(c1.IsBlack(), "Testing isBlack");
            Assert.IsTrue(c2.IsBlack(), "Testing isBlack");
            Assert.IsFalse(c3.IsBlack(), "Testing !isBlack");
        }
Exemplo n.º 40
0
        public void TestOpAdd()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 + r2;
            float g = g1 + g2;
            float b = b1 + b2;
            float a = a1 + a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c = c1 + c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAdd");
        }
Exemplo n.º 41
0
        public void TestOpAddValue()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 + value;
            float g = g1 + value;
            float b = b1 + value;
            float a = a1 + value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 + value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAddValue");

            //Test right to left
            c = value + c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpAddValue");
        }
Exemplo n.º 42
0
 public static void AssertEquals(float r, float g, float b, float a, Color4D c, String msg)
 {
     AssertEquals(r, c.R, msg + String.Format(" => checking R component ({0} == {1}", r, c.R));
     AssertEquals(g, c.G, msg + String.Format(" => checking G component ({0} == {1}", g, c.G));
     AssertEquals(b, c.B, msg + String.Format(" => checking B component ({0} == {1}", b, c.B));
     AssertEquals(a, c.A, msg + String.Format(" => checking A component ({0} == {1}", a, c.A));
 }
Exemplo n.º 43
0
 public static void AssertEquals(float r, float g, float b, float a, Color4D c)
 {
     AssertEquals(r, c.R);
     AssertEquals(g, c.G);
     AssertEquals(b, c.B);
     AssertEquals(a, c.A);
 }
Exemplo n.º 44
0
        public void TestOpMultiply()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 * r2;
            float g = g1 * g2;
            float b = b1 * b2;
            float a = a1 * a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c = c1 * c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiply");
        }
Exemplo n.º 45
0
        public void TestOpMultiplyByScalar()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 * value;
            float g = g1 * value;
            float b = b1 * value;
            float a = a1 * value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 * value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiplyByValue");

            //Test right to left
            c = value * c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpMultiplyByValue");
        }
Exemplo n.º 46
0
 private static bool AreNullableColorsApproxEqual(Color4D? a, Color4D? b)
 {
     if (a.HasValue != b.HasValue)
     {
         return false;
     }
     if (!a.HasValue)
     {
         return true;
     }             
     var diff = a.Value - b.Value;
     return Math.Abs(diff.R) + Math.Abs(diff.G) + Math.Abs(diff.B) + Math.Abs(diff.A) < MergeVectorEpsilon;
 }
Exemplo n.º 47
0
        public void TestOpSubtract()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float r2 = .2f, g2 = .1f, b2 = .05f, a2 = .25f;
            float r = r1 - r2;
            float g = g1 - g2;
            float b = b1 - b2;
            float a = a1 - a2;

            Color4D c1 = new Color4D(r1, g1, b1, a1);
            Color4D c2 = new Color4D(r2, g2, b2, a2);
            Color4D c = c1 - c2;

            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtract");
        }
Exemplo n.º 48
0
        public void TestOpSubtractByValue()
        {
            float r1 = .5f, g1 = .25f, b1 = .7f, a1 = 1.0f;
            float value = .2f;
            float r = r1 - value;
            float g = g1 - value;
            float b = b1 - value;
            float a = a1 - value;

            Color4D c1 = new Color4D(r1, g1, b1, a1);

            //Test left to right
            Color4D c = c1 - value;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtractValue");

            r = value - r1;
            g = value - g1;
            b = value - b1;
            a = value - a1;

            //Test right to left
            c = value - c1;
            TestHelper.AssertEquals(r, g, b, a, c, "Testing OpSubtractValue");
        }
Exemplo n.º 49
0
 public float ToFloat(Color4D color)
 {
     return (color.R + color.G + color.B + color.A) / 4f;
 }
Exemplo n.º 50
0
 private static Color ConvertColor(Color4D c, AssimpMaterial aMaterial)
 {
     if (!aMaterial.HasColorTransparent)
     {
         // no transparency specified
         return Color.FromArgb(255, (byte)(255 * c.R), (byte)(255 * c.G), (byte)(255 * c.B));
     }
     return Color.FromArgb((byte)(255 * c.A), (byte)(255 * c.R), (byte)(255 * c.G), (byte)(255 * c.B));
 }
Exemplo n.º 51
0
 private Color4 FromColor(Color4D color)
 {
     Color4 c;
     c.R = color.R;
     c.G = color.G;
     c.B = color.B;
     c.A = color.A;
     return c;
 }
Exemplo n.º 52
0
 private Color FromColor(Color4D color)
 {
     Color c;
     c.R = (byte)(color.R * 255);
     c.G = (byte)(color.G * 255);
     c.B = (byte)(color.B * 255);
     c.A = (byte)(color.A * 255);
     return c;
 }
Exemplo n.º 53
0
 public static int ToInteger(Color4D color)
 {
     return (int)(color.R * 255) | ((int)(color.G * 255) << 8) | ((int)(color.B * 255) << 16) | ((int)(color.A * 255) << 24);
 }
Exemplo n.º 54
0
		public static void Write (this BinaryWriter writer, Color4D val) {
			writer.Write(val.R);
			writer.Write(val.G);
			writer.Write(val.B);
			writer.Write(val.A);
		}
Exemplo n.º 55
0
 public void TestIndexer()
 {
     float r = .25f, g = .5f, b = .05f, a = 1.0f;
     Color4D c = new Color4D();
     c[0] = r;
     c[1] = g;
     c[2] = b;
     c[3] = a;
     TestHelper.AssertEquals(r, c[0], "Test Indexer, R");
     TestHelper.AssertEquals(g, c[1], "Test Indexer, G");
     TestHelper.AssertEquals(b, c[2], "Test Indexer, B");
     TestHelper.AssertEquals(a, c[3], "Test Indexer, A");
 }
Exemplo n.º 56
0
 private Color ConvertMaterialColor(Color4D c)
 {
     return new Color(c.R, c.G, c.B, c.A);
 }