Пример #1
0
    public void Export(CDBrush cdBrush)
    {
        if (cdBrush == null)
        {
            return;
        }
        cdBrush.Release();
        for (int i = 0; i < GetFaceNum(); i++)
        {
            CDSide    side = new CDSide();
            HalfSpace HS   = new HalfSpace();
            HS.Normal = GetFace(i).Normal;
            HS.Dist   = GetFace(i).Dist;

            side.Init(HS, false);
            cdBrush.LstSides.Add(side);
            cdBrush.cd = this;
        }

        Bounds tmpAABB;

        GetAABB(out tmpAABB);
        if (tmpAABB != null)
        {
            cdBrush.BoundAABB = tmpAABB;
        }
        cdBrush.Flags = Flags;
    }
Пример #2
0
 public CDBrush(CDBrush src)
 {
     BoundAABB = src.BoundAABB;
     LstSides  = new List <CDSide>();
     for (int i = 0; i < src.LstSides.Count; i++)
     {
         CDSide side = new CDSide(src.LstSides[i].Plane, src.LstSides[i].Bevel);
         LstSides.Add(side);
     }
     Flags = src.Flags;
 }
Пример #3
0
    // Load and save method
    public bool Load(LBinaryFile fs)
    {
        Release();
        BoundAABB = SLBinary.LoadAABB(fs);
        Flags     = fs.Reader.ReadUInt32();
        int numsides = fs.Reader.ReadInt32();

        for (int i = 0; i < numsides; i++)
        {
            Vector3 normal = SLBinary.LoadVector3(fs);
            float   dist   = fs.Reader.ReadSingle();
            bool    bevel  = SLBinary.LoadBool(fs);
            CDSide  side   = new CDSide();
            side.Init(normal, dist, bevel);
            LstSides.Add(side);
        }

        return(true);
    }