Ejemplo n.º 1
0
        private InteropVertex GetInteropVertex(Vertex v)
        {
            InteropVertex iv = new InteropVertex();

            InteropVector4 dvOne = new InteropVector4();

            dvOne.X = 1;
            dvOne.Y = 1;
            dvOne.Z = 1;
            dvOne.W = 1;

            InteropVector4 dvZero = new InteropVector4();

            dvZero.X = 0;
            dvZero.Y = 0;
            dvZero.W = 0;
            dvZero.W = 0;

            iv.Position     = GetInteropVector4(v.Position, dvZero);
            iv.Normal       = GetInteropVector4(v.Normal, dvZero);
            iv.UV           = GetInteropVector4(v.UV, dvZero);
            iv.BlendWeights = GetInteropVector4(v.BlendWeights, dvZero);
            iv.BlendIndices = v.BlendIndices.GetValueOrDefault(0);
            iv.Color        = GetInteropVector4(v.Color, dvOne);
            iv.Tangent1     = GetInteropVector4(v.Tangent1, dvZero);
            iv.Tangent2     = GetInteropVector4(v.Tangent2, dvZero);

            return(iv);
        }
Ejemplo n.º 2
0
 private InteropVector4 GetInteropVector4(Vector4?v4, InteropVector4 dv)
 {
     if (v4.HasValue)
     {
         return(GetInteropVector4(v4.Value));
     }
     return(dv);
 }
Ejemplo n.º 3
0
 private InteropVector4 GetInteropVector4(Vector3?v3, InteropVector4 dv)
 {
     if (v3.HasValue)
     {
         return(GetInteropVector4(v3.Value));
     }
     return(dv);
 }
Ejemplo n.º 4
0
        private InteropVector4 GetInteropVector4(Vector4 v4)
        {
            InteropVector4 iv = new InteropVector4();

            iv.X = v4.X;
            iv.Y = v4.Y;
            iv.Z = v4.Z;
            iv.W = v4.W;

            return(iv);
        }