Ejemplo n.º 1
0
        // Convex Volume Planes. Contains blocks of floating-point numbers.
        public static void ReadMCVP(BinaryReader reader, int MCVPsize) // optional
        {
            // These are used to define the volume of when you are inside this WMO.
            // Important for transports.
            //If a point is behind all planes (i.e. point-plane distance is negative for all planes), it is inside.
            List <C4Plane> ConvexVolumePlanes = new List <C4Plane>();

            for (int i = 0; i < MCVPsize / 16; i++)
            {
                C4Plane convexVolumePlane = new C4Plane();
                convexVolumePlane.normal   = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                convexVolumePlane.distance = reader.ReadSingle();
                ConvexVolumePlanes.Add(convexVolumePlane);
            }
        }
Ejemplo n.º 2
0
        // Portal information.
        public static void ReadMOPT(BinaryReader reader)
        {
            List <SMOPortal> PortalInfo = new List <SMOPortal>();

            for (int i = 0; i < wmoData.Info.nPortals; ++i)
            {
                SMOPortal portal = new SMOPortal();
                portal.startVertex = reader.ReadUInt16();
                portal.count       = reader.ReadUInt16();
                C4Plane plane = new C4Plane();
                plane.normal   = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                plane.distance = reader.ReadSingle();
                portal.plane   = plane;
                PortalInfo.Add(portal);
            }
        }