Пример #1
0
    public BSPModel(BinaryReader bspFile)
    {
        boundingBox = new BSPBoundingBox(new Vector3(bspFile.ReadSingle(), bspFile.ReadSingle(), bspFile.ReadSingle()),
                                         new Vector3(bspFile.ReadSingle(), bspFile.ReadSingle(), bspFile.ReadSingle()));

        origin    = new Vector3(bspFile.ReadSingle(), bspFile.ReadSingle(), bspFile.ReadSingle());
        node_id0  = bspFile.ReadUInt32();
        node_id1  = bspFile.ReadUInt32();
        node_id2  = bspFile.ReadUInt32();
        node_id3  = bspFile.ReadUInt32();
        leafCount = bspFile.ReadUInt32();
        faceIndex = bspFile.ReadUInt32();
        faceCount = bspFile.ReadUInt32();
    }
Пример #2
0
    public BSPNode(BinaryReader bspFile)
    {
        planeIndex = bspFile.ReadInt32();
        front      = bspFile.ReadUInt16();
        back       = bspFile.ReadUInt16();

        int x = bspFile.ReadInt16();
        int y = bspFile.ReadInt16();
        int z = bspFile.ReadInt16();

        int x2 = bspFile.ReadInt16();
        int y2 = bspFile.ReadInt16();
        int z2 = bspFile.ReadInt16();

        boundingBox = new BSPBoundingBox(new Vector3(x, z, y), new Vector3(x2, z2, y2));

        faceIndex = bspFile.ReadUInt16();
        faceCount = bspFile.ReadUInt16();
    }
Пример #3
0
    public BSPLeaf(BinaryReader bspFile)
    {
        type         = bspFile.ReadInt32();
        visListIndex = bspFile.ReadInt32();

        int x = bspFile.ReadInt16();
        int y = bspFile.ReadInt16();
        int z = bspFile.ReadInt16();

        int x2 = bspFile.ReadInt16();
        int y2 = bspFile.ReadInt16();
        int z2 = bspFile.ReadInt16();

        boundingBox = new BSPBoundingBox(new Vector3(x, z, y), new Vector3(x2, z2, y2));

        faceListIndex = bspFile.ReadUInt16();
        faceCount     = bspFile.ReadUInt16();

        sndWater = bspFile.ReadByte();
        sndWater = bspFile.ReadByte();
        sndSlime = bspFile.ReadByte();
        sndLava  = bspFile.ReadByte();
    }