Exemplo n.º 1
0
        public XftSprite AddSprite(float width, float height, STYPE type, ORIPOINT ori, float maxFps, bool simple)
        {
            VertexSegment segment = GetVertices(4, 6);
            XftSprite     s       = new XftSprite(segment, width, height, type, ori, maxFps, simple);

            return(s);
        }
Exemplo n.º 2
0
//         public Rope AddRope()
//         {
//             Rope rope = new Rope();
//             return rope;
//         }
//
//         public SplineTrail AddSplineTrail(int elemCount)
//         {
//             VertexSegment segment = GetVertices(elemCount * 3, (elemCount - 1) * 12);
//             SplineTrail trail = new SplineTrail(segment);
//             return trail;
//         }
//
//         public SphericalBillboard AddSphericalBillboard()
//         {
//             VertexSegment segment = GetVertices(4, 6);
//             SphericalBillboard sb = new SphericalBillboard(segment);
//
//             return sb;
//         }

//         public Material GetMaterial()
//         {
//             return Material;
//         }

        public VertexSegment GetVertices(int vcount, int icount)
        {
            int vertNeed  = 0;
            int indexNeed = 0;

            if (VertexUsed + vcount >= VertexTotal)
            {
                vertNeed = (vcount / BlockSize + 1) * BlockSize;
            }
            if (IndexUsed + icount >= IndexTotal)
            {
                indexNeed = (icount / BlockSize + 1) * BlockSize;
            }
            VertexUsed += vcount;
            IndexUsed  += icount;
            if (vertNeed != 0 || indexNeed != 0)
            {
                EnlargeArrays(vertNeed, indexNeed);
                VertexTotal += vertNeed;
                IndexTotal  += indexNeed;
            }

            VertexSegment ret = new VertexSegment(VertexUsed - vcount, vcount, IndexUsed - icount, icount, this);

            return(ret);
        }
Exemplo n.º 3
0
        public RibbonTrail AddRibbonTrail(bool useFaceObj, Transform faceobj, float width, int maxelemnt, float len, Vector3 pos, float maxFps)
        {
            VertexSegment segment = GetVertices(maxelemnt * 2, (maxelemnt - 1) * 6);
            RibbonTrail   trail   = new RibbonTrail(segment, useFaceObj, faceobj, width, maxelemnt, len, pos, maxFps);

            return(trail);
        }
Exemplo n.º 4
0
        public CustomMesh AddCustomMesh(Mesh mesh, Vector3 dir, float maxFps)
        {
            VertexSegment segment = GetVertices(mesh.vertices.Length, mesh.triangles.Length);
            CustomMesh    cmesh   = new CustomMesh(segment, mesh, dir, maxFps);

            return(cmesh);
        }
Exemplo n.º 5
0
    public RibbonTrail AddRibbonTrail(float width, int maxelemnt, float len, Vector3 pos, int stretchType, float maxFps)
    {
        VertexSegment segment = GetVertices(maxelemnt * 2, (maxelemnt - 1) * 6);
        RibbonTrail   trail   = new RibbonTrail(segment, width, maxelemnt, len, pos, stretchType, maxFps);

        return(trail);
    }
Exemplo n.º 6
0
        public SphericalBillboard AddSphericalBillboard()
        {
            VertexSegment      segment = GetVertices(4, 6);
            SphericalBillboard sb      = new SphericalBillboard(segment);

            return(sb);
        }
Exemplo n.º 7
0
        public VertexSegment GetVertices(int vcount, int icount)
        {
            var vertNeed  = 0;
            var indexNeed = 0;

            if (_vertexUsed + vcount >= _vertexTotal)
            {
                vertNeed = (vcount / BlockSize + 1) * BlockSize;
            }

            if (_indexUsed + icount >= _indexTotal)
            {
                indexNeed = (icount / BlockSize + 1) * BlockSize;
            }

            _vertexUsed += vcount;
            _indexUsed  += icount;
            if (vertNeed != 0 || indexNeed != 0)
            {
                EnlargeArrays(vertNeed, indexNeed);
                _vertexTotal += vertNeed;
                _indexTotal  += indexNeed;
            }

            var ret = new VertexSegment(_vertexUsed - vcount, vcount, _indexUsed - icount, icount, this);

            return(ret);
        }
Exemplo n.º 8
0
        public SplineTrail AddSplineTrail(int elemCount)
        {
            VertexSegment segment = GetVertices(elemCount * 3, (elemCount - 1) * 12);
            SplineTrail   trail   = new SplineTrail(segment);

            return(trail);
        }
Exemplo n.º 9
0
        public RibbonTrail AddRibbonTrail(Camera mainCam, bool useFaceObj, Transform faceobj, float width, int maxelemnt, float len, Vector3 pos, int stretchType, float maxFps, bool isWeapon, EffectNode owner, bool isScale)
        {
            VertexSegment segment = GetVertices(maxelemnt * 2, (maxelemnt - 1) * 6);
            RibbonTrail   trail   = new RibbonTrail(segment, mainCam, useFaceObj, faceobj, width, maxelemnt, len, pos, stretchType, maxFps, isWeapon, owner, isScale);

            return(trail);
        }
Exemplo n.º 10
0
        private void HandleVertexSegment(Polyline polyline)
        {
            var codeValue = GetPair();
            var segment   = new VertexSegment();

            while (!Ended)
            {
                switch (codeValue.Code)
                {
                case 0:

                    polyline.Vertices.Add(segment);

                    if (codeValue.Value == SEQEND)
                    {
                        return;
                    }
                    else if (codeValue.Value == VERTEX)
                    {
                        segment = new VertexSegment();
                    }

                    break;

                default:
                    segment.ParseCode(codeValue);
                    break;
                }

                codeValue = GetPair();
            }
        }
Exemplo n.º 11
0
    public Sprite AddSprite(float width, float height, STYPE type, ORIPOINT ori, Camera cam, int uvStretch, float maxFps)
    {
        VertexSegment segment = GetVertices(4, 6);
        Sprite        s       = new Sprite(segment, width, height, type, ori, cam, uvStretch, maxFps);

        //Debug.Log("|"+segment.VertStart + "," + segment.VertCount);
        return(s);
    }
Exemplo n.º 12
0
        public Cone AddCone(Vector2 size, int numSegment, float angle, Vector3 dir, int uvStretch, float maxFps, bool usedelta, AnimationCurve deltaAngle)
        {
            VertexSegment segment = GetVertices((numSegment + 1) * 2, numSegment * 6);
            Cone          f       = new Cone(segment, size, numSegment, angle, dir, uvStretch, maxFps);

            f.UseDeltaAngle = usedelta;
            f.CurveAngle    = deltaAngle;
            return(f);
        }
Exemplo n.º 13
0
        private CodeValuePair HandleMLine()
        {
            var codeValue = GetPair();

            var mLine   = new MLine();
            var segment = new VertexSegment();

            while (!Ended)
            {
                switch (codeValue.Code)
                {
                case 0:
                    MLines.Add(mLine);

                    return(codeValue);

                case 11:

                    segment.Coordinate.X = codeValue.GetDouble();
                    break;

                case 21:

                    segment.Coordinate.Y = codeValue.GetDouble();
                    break;

                case 31:

                    segment.Coordinate.Z = codeValue.GetDouble();
                    mLine.Vertices.Add(segment);

                    segment = new VertexSegment();
                    break;

                default:

                    mLine.ParseCode(codeValue);
                    break;
                }

                codeValue = GetPair();
            }

            return(codeValue);
        }
Exemplo n.º 14
0
    public Sprite AddSprite(float width, float height, STYPE type, ORIPOINT ori, Camera cam, int uvStretch, float maxFps)
    {
        VertexSegment vertices = GetVertices(4, 6);

        return(new Sprite(vertices, width, height, type, ori, cam, uvStretch, maxFps));
    }
Exemplo n.º 15
0
        public VertexSegment GetRopeVertexSeg(int maxcount)
        {
            VertexSegment segment = GetVertices(maxcount * 2, (maxcount - 1) * 6);

            return(segment);
        }
Exemplo n.º 16
0
        public VertexSegment GetVertices(int vcount, int icount)
        {
            int vertNeed = 0;
            int indexNeed = 0;
            if (VertexUsed + vcount >= VertexTotal)
            {
                vertNeed = (vcount / BlockSize + 1) * BlockSize;
            }
            if (IndexUsed + icount >= IndexTotal)
            {
                indexNeed = (icount / BlockSize + 1) * BlockSize;
            }
            VertexUsed += vcount;
            IndexUsed += icount;
            if (vertNeed != 0 || indexNeed != 0)
            {
                EnlargeArrays(vertNeed, indexNeed);
                VertexTotal += vertNeed;
                IndexTotal += indexNeed;
            }

            VertexSegment ret = new VertexSegment(VertexUsed - vcount, vcount, IndexUsed - icount, icount, this);

            return ret;
        }