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; }
// 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); }