Example #1
0
 public void  Set(BxBezier2Line3F src)
 {
     for (byte i = 0; i < 3; i++)
     {
         fDt[i].Set(src[i]);
     }
 }
Example #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);
        }
Example #3
0
        public BxBezier2Line3F(BxBezier2Line3F a)
        {
            fDt = new BxVec3F[3];

            for (byte i = 0; i < 3; i++)
            {
                fDt[i] = new BxVec3F(a[i]);
            }
        }
Example #4
0
        private void  FromBezier2(BxBezier2Line3F src, uint surfaceOfs, byte ofsBase, float[] dst)
        {
            uint texelOfs = ( uint )((surfaceOfs * 80 * KNumFloatInVector4) + (ofsBase * KNumFloatInVector4));

            for (byte i = 0; i < 3; 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;
            }
        }
Example #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);
        }
Example #6
0
        // ------

        public BxBezier2Line3F  Diff()
        {
            BxBezier2Line3F diff = new BxBezier2Line3F();

            for (byte i = 0; i < BxVec3F.KNumVec3F; i++)
            {
                for (byte j = 0; j < 3; j++)
                {
                    diff[j][i] = 3.0F * (this[j + 1][i] - this[j][i]);
                }
            }

            return(diff);
        }
Example #7
0
        private void  GetDiffBezierMain(
            BxCmSeparatePatch_Object src, uint surfaceNo, byte hvId, out BxBezier2Line3F diffBez0, out BxBezier5Line3F diffBez1, out BxBezier5Line3F diffBez2, out BxBezier2Line3F diffBez3)
        {
            byte hvOfs, crossIdx;

            hvOfs    = 0;
            crossIdx = 0;
            GetDiffBezierOuter(src, surfaceNo, hvId, hvOfs, crossIdx, out diffBez0);
            GetDiffBezierInner(src, surfaceNo, hvId, hvOfs, out diffBez1);

            hvOfs    = 1;
            crossIdx = 6;
            GetDiffBezierOuter(src, surfaceNo, hvId, hvOfs, crossIdx, out diffBez3);
            GetDiffBezierInner(src, surfaceNo, hvId, hvOfs, out diffBez2);
        }
Example #8
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);
        }
Example #9
0
        private void  GetDiffBezierOuter(BxCmSeparatePatch_Object src, uint surfaceNo, byte hvId, byte hvOfs, byte crossIdx, out BxBezier2Line3F diffBez)
        {
            byte vNo0, vNo1;

            HVtoVertexNo(hvId, hvOfs, out vNo0, out vNo1);

            byte wingHvId = ( byte )(1 - hvId);

            BxBezier3Line3F posBez = new BxBezier3Line3F();

            posBez[0].Set(src[surfaceNo].Vertex[vNo0].Pos);
            posBez[3].Set(src[surfaceNo].Vertex[vNo1].Pos);
            posBez[1].Set(src[surfaceNo].SurfaceEdge[wingHvId][0].Inner[crossIdx]);
            posBez[2].Set(src[surfaceNo].SurfaceEdge[wingHvId][1].Inner[crossIdx]);

            diffBez = posBez.Diff();

            Debug.Assert(diffBez[0].Length >= (BxMathF.KNearZeroF * 10.0));
            Debug.Assert(diffBez[2].Length >= (BxMathF.KNearZeroF * 10.0));
        }
Example #10
0
 private void  GetDiffBezierV(BxCmSeparatePatch_Object src, uint surfaceNo, out BxBezier2Line3F vDiffBez0, out BxBezier5Line3F vDiffBez1, out BxBezier5Line3F vDiffBez2, out BxBezier2Line3F vDiffBez3)
 {
     GetDiffBezierMain(src, surfaceNo, 1, out vDiffBez0, out vDiffBez1, out vDiffBez2, out vDiffBez3);
 }
Example #11
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);
        }
Example #12
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);
        }