Exemplo n.º 1
0
 public void  Set(BxBezier6Line3F src)
 {
     for (byte i = 0; i < 7; i++)
     {
         fDt[i].Set(src[i]);
     }
 }
Exemplo n.º 2
0
        // -------------------------------------------------------

        private void  GetPosDiff(BxCmSeparatePatch_Object patch, uint surfaceNo, out BxBezier3Line3F hPosBez0, out BxBezier6Line3F hPosBez1, out BxBezier6Line3F hPosBez2, out BxBezier3Line3F hPosBez3,
                                 out BxBezier3Line3F vPosBez0, out BxBezier6Line3F vPosBez1, out BxBezier6Line3F vPosBez2, out BxBezier3Line3F vPosBez3, out BxBezier2Line3F hDiffBez0, out BxBezier5Line3F hDiffBez1,
                                 out BxBezier5Line3F hDiffBez2, out BxBezier2Line3F hDiffBez3, out BxBezier2Line3F vDiffBez0, out BxBezier5Line3F vDiffBez1, out BxBezier5Line3F vDiffBez2, out BxBezier2Line3F vDiffBez3)
        {
            GetPosBezierH(patch, surfaceNo, out hPosBez0, out hPosBez1, out hPosBez2, out hPosBez3);
            GetPosBezierV(patch, surfaceNo, out vPosBez0, out vPosBez1, out vPosBez2, out vPosBez3);
            GetDiffBezierH(patch, surfaceNo, out hDiffBez0, out hDiffBez1, out hDiffBez2, out hDiffBez3);
            GetDiffBezierV(patch, surfaceNo, out vDiffBez0, out vDiffBez1, out vDiffBez2, out vDiffBez3);
        }
Exemplo n.º 3
0
        public BxBezier6Line3F(BxBezier6Line3F a)
        {
            fDt = new BxVec3F[7];

            for (byte i = 0; i < 7; i++)
            {
                fDt[i] = new BxVec3F(a[i]);
            }
        }
Exemplo n.º 4
0
        private void  FromBezier6(BxBezier6Line3F src, uint surfaceOfs, byte ofsBase, float[] dst)
        {
            uint texelOfs = ( uint )((surfaceOfs * 80 * KNumFloatInVector4) + (ofsBase * KNumFloatInVector4));

            for (byte i = 0; i < 7; i++)
            {
                dst[texelOfs + i * KNumFloatInVector4 + 0] = src[i].X;
                dst[texelOfs + i * KNumFloatInVector4 + 1] = src[i].Y;
                dst[texelOfs + i * KNumFloatInVector4 + 2] = src[i].Z;
            }
        }
Exemplo n.º 5
0
        // ------

        private void  SetVertexBufferOne(
            BxBezier3Line3F hPosBez0, BxBezier6Line3F hPosBez1, BxBezier6Line3F hPosBez2, BxBezier3Line3F hPosBez3, BxBezier3Line3F vPosBez0, BxBezier6Line3F vPosBez1,
            BxBezier6Line3F vPosBez2, BxBezier3Line3F vPosBez3, BxBezier2Line3F hDiffBez0, BxBezier5Line3F hDiffBez1, BxBezier5Line3F hDiffBez2, BxBezier2Line3F hDiffBez3,
            BxBezier2Line3F vDiffBez0, BxBezier5Line3F vDiffBez1, BxBezier5Line3F vDiffBez2, BxBezier2Line3F vDiffBez3, int tessDenom, uint surfaceNo, VertexInfo[] vertexAry)
        {
            SetVertexBuffer0(hPosBez0, hPosBez1, hDiffBez0, surfaceNo, vertexAry);
            SetVertexBuffer1(hPosBez2, hPosBez3, hDiffBez3, surfaceNo, vertexAry);
            SetVertexBuffer2(hDiffBez1, hDiffBez2, tessDenom, surfaceNo, vertexAry);
            SetVertexBuffer3(vPosBez0, vPosBez1, vDiffBez0, surfaceNo, vertexAry);
            SetVertexBuffer4(vPosBez2, vPosBez3, vDiffBez3, surfaceNo, vertexAry);
            SetVertexBuffer5(vDiffBez1, vDiffBez2, surfaceNo, vertexAry);
        }
Exemplo n.º 6
0
        public BxBezier6Line3F  UpperTo6()
        {
            BxBezier6Line3F result = new BxBezier6Line3F();

            result[0].Set(this[0]);
            result[1].Set((this[0] + this[1]) / 2.0F);
            result[2].Set((this[0] + 3.0F * this[1] + this[2]) / 5.0F);
            result[3].Set((this[0] + 9.0F * this[1] + 9.0F * this[2] + this[3]) / 20.0F);
            result[4].Set((this[1] + 3.0F * this[2] + this[3]) / 5.0F);
            result[5].Set((this[2] + this[3]) / 2.0F);
            result[6].Set(this[3]);

            return(result);
        }
Exemplo n.º 7
0
        private void  ExecBezV(BxCmSeparatePatch_Object src, uint surfaceNo, BxCmSeparatePatch_Object dst)
        {
            BxBezier6Line3F[] bezV6 = new BxBezier6Line3F[4];
            BxBezier3Line3F[] bezU3 = new BxBezier3Line3F[7];

            for (byte i = 0; i < 4; i++)
            {
                bezV6[i] = new BxBezier6Line3F();
            }
            for (byte i = 0; i < 7; i++)
            {
                bezU3[i] = new BxBezier3Line3F();
            }

            byte hvId = 1;

            GetBezier(src, surfaceNo, hvId, bezV6);
            TransBezier(bezV6, bezU3);
            Correct(bezU3, surfaceNo, hvId, dst);
        }
Exemplo n.º 8
0
        private void  SetVertexBuffer4(BxBezier6Line3F vPosBez2, BxBezier3Line3F vPosBez3, BxBezier2Line3F vDiffBez3, uint surfaceNo, VertexInfo[] vertexAry)
        {
            uint dstIndex = (surfaceNo * 6) + 4;

            ToVector3(vPosBez2[0], ref vertexAry[dstIndex].pnt0);
            ToVector3(vPosBez2[1], ref vertexAry[dstIndex].pnt1);
            ToVector3(vPosBez2[2], ref vertexAry[dstIndex].pnt2);
            ToVector3(vPosBez2[3], ref vertexAry[dstIndex].pnt3);
            ToVector3(vPosBez2[4], ref vertexAry[dstIndex].pnt4);
            ToVector3(vPosBez2[5], ref vertexAry[dstIndex].pnt5);
            ToVector3(vPosBez2[6], ref vertexAry[dstIndex].pnt6);

            ToVector3(vPosBez3[0], ref vertexAry[dstIndex].pnt7);
            ToVector3(vPosBez3[1], ref vertexAry[dstIndex].pnt8);
            ToVector3(vPosBez3[2], ref vertexAry[dstIndex].pnt9);
            ToVector3(vPosBez3[3], ref vertexAry[dstIndex].pnt10);

            ToVector3(vDiffBez3[0], ref vertexAry[dstIndex].pnt11);
            ToVector3(vDiffBez3[1], ref vertexAry[dstIndex].pnt12);
            ToVector3(vDiffBez3[2], ref vertexAry[dstIndex].pnt13);
        }
Exemplo n.º 9
0
        private void  SetVertexBuffer3(BxBezier3Line3F vPosBez0, BxBezier6Line3F vPosBez1, BxBezier2Line3F vDiffBez0, uint surfaceNo, VertexInfo[] vertexAry)
        {
            uint dstIndex = (surfaceNo * 6) + 3;

            ToVector3(vPosBez0[0], ref vertexAry[dstIndex].pnt0);
            ToVector3(vPosBez0[1], ref vertexAry[dstIndex].pnt1);
            ToVector3(vPosBez0[2], ref vertexAry[dstIndex].pnt2);
            ToVector3(vPosBez0[3], ref vertexAry[dstIndex].pnt3);

            ToVector3(vPosBez1[0], ref vertexAry[dstIndex].pnt4);
            ToVector3(vPosBez1[1], ref vertexAry[dstIndex].pnt5);
            ToVector3(vPosBez1[2], ref vertexAry[dstIndex].pnt6);
            ToVector3(vPosBez1[3], ref vertexAry[dstIndex].pnt7);
            ToVector3(vPosBez1[4], ref vertexAry[dstIndex].pnt8);
            ToVector3(vPosBez1[5], ref vertexAry[dstIndex].pnt9);
            ToVector3(vPosBez1[6], ref vertexAry[dstIndex].pnt10);

            ToVector3(vDiffBez0[0], ref vertexAry[dstIndex].pnt11);
            ToVector3(vDiffBez0[1], ref vertexAry[dstIndex].pnt12);
            ToVector3(vDiffBez0[2], ref vertexAry[dstIndex].pnt13);
        }
Exemplo n.º 10
0
        // ------

        private void  ConvVtfInfo(BxBezier3Line3F hPosBez0, BxBezier6Line3F hPosBez1, BxBezier6Line3F hPosBez2, BxBezier3Line3F hPosBez3, BxBezier3Line3F vPosBez0, BxBezier6Line3F vPosBez1,
                                  BxBezier6Line3F vPosBez2, BxBezier3Line3F vPosBez3, BxBezier2Line3F hDiffBez0, BxBezier5Line3F hDiffBez1, BxBezier5Line3F hDiffBez2, BxBezier2Line3F hDiffBez3,
                                  BxBezier2Line3F vDiffBez0, BxBezier5Line3F vDiffBez1, BxBezier5Line3F vDiffBez2, BxBezier2Line3F vDiffBez3, uint surfaceOfs, float[] vtfInfo)
        {
            FromBezier3(hPosBez0, surfaceOfs, 0, vtfInfo);
            FromBezier6(hPosBez1, surfaceOfs, 4, vtfInfo);
            FromBezier6(hPosBez2, surfaceOfs, 11, vtfInfo);
            FromBezier3(hPosBez3, surfaceOfs, 18, vtfInfo);

            FromBezier3(vPosBez0, surfaceOfs, 22, vtfInfo);
            FromBezier6(vPosBez1, surfaceOfs, 26, vtfInfo);
            FromBezier6(vPosBez2, surfaceOfs, 33, vtfInfo);
            FromBezier3(vPosBez3, surfaceOfs, 40, vtfInfo);

            FromBezier2(hDiffBez0, surfaceOfs, 44, vtfInfo);
            FromBezier5(hDiffBez1, surfaceOfs, 47, vtfInfo);
            FromBezier5(hDiffBez2, surfaceOfs, 53, vtfInfo);
            FromBezier2(hDiffBez3, surfaceOfs, 59, vtfInfo);

            FromBezier2(vDiffBez0, surfaceOfs, 62, vtfInfo);
            FromBezier5(vDiffBez1, surfaceOfs, 65, vtfInfo);
            FromBezier5(vDiffBez2, surfaceOfs, 71, vtfInfo);
            FromBezier2(vDiffBez3, surfaceOfs, 77, vtfInfo);
        }
Exemplo n.º 11
0
 private void  GetPosBezierInner(BxCmSeparatePatch_Object src, uint surfaceNo, byte hvId, byte hvOfs, out BxBezier6Line3F posBezInner)
 {
     posBezInner = src[surfaceNo].SurfaceEdge[hvId][hvOfs].Inner.Copy;
 }
Exemplo n.º 12
0
        private void  GetPosBezierMain(BxCmSeparatePatch_Object src, uint surfaceNo, byte hvId, out BxBezier3Line3F posBez0, out BxBezier6Line3F posBez1, out BxBezier6Line3F posBez2, out BxBezier3Line3F posBez3)
        {
            byte hvOfs, crossIdx;

            hvOfs    = 0;
            crossIdx = 0;
            GetPosBezierOuter(src, surfaceNo, hvId, hvOfs, crossIdx, out posBez0);
            GetPosBezierInner(src, surfaceNo, hvId, hvOfs, out posBez1);

            hvOfs    = 1;
            crossIdx = 6;
            GetPosBezierOuter(src, surfaceNo, hvId, hvOfs, crossIdx, out posBez3);
            GetPosBezierInner(src, surfaceNo, hvId, hvOfs, out posBez2);
        }
Exemplo n.º 13
0
 private void  GetPosBezierV(BxCmSeparatePatch_Object src, uint surfaceNo, out BxBezier3Line3F vPosBez0, out BxBezier6Line3F vPosBez1, out BxBezier6Line3F vPosBez2, out BxBezier3Line3F vPosBez3)
 {
     GetPosBezierMain(src, surfaceNo, 1, out vPosBez0, out vPosBez1, out vPosBez2, out vPosBez3);
 }