コード例 #1
0
ファイル: Chunk_MCNR.cs プロジェクト: justMaku/W3DT
        public Chunk_MCNR(ADTFile file) : base(file, "MCNR", Magic)
        {
            normals = new Position[145];
            for (int i = 0; i < 145; i++)
            {
                float x = file.readUInt8() / 127;
                float z = file.readUInt8() / 127;
                float y = file.readUInt8() / 127;

                // Super-hacky fix? This does not seem right, but it prevents lighting issues?
                if (y == 1.0 && z == 0.0)
                {
                    z = 1.0f;
                    y = 0.0f;
                }

                normals[i] = new Position(x, y, z);
            }
        }
コード例 #2
0
ファイル: Chunk_MCNR.cs プロジェクト: Kruithne/W3DT
        public Chunk_MCNR(ADTFile file)
            : base(file, "MCNR", Magic)
        {
            normals = new Position[145];
            for (int i = 0; i < 145; i++)
            {
                float x = file.readUInt8() / 127;
                float z = file.readUInt8() / 127;
                float y = file.readUInt8() / 127;

                // Super-hacky fix? This does not seem right, but it prevents lighting issues?
                if (y == 1.0 && z == 0.0)
                {
                    z = 1.0f;
                    y = 0.0f;
                }

                normals[i] = new Position(x, y, z);
            }
        }