Example #1
0
        void MapWriter::writeFace(const Model::Face& face, std::ostream& stream) {
            const String textureName = Utility::isBlank(face.textureName()) ? Model::Texture::Empty : face.textureName();
            
            stream.precision(FloatPrecision);
            stream <<
            "( " <<
            face.point(0).x() << " " <<
            face.point(0).y() << " " <<
            face.point(0).z() <<
            " ) ( "           <<
            face.point(1).x() << " " <<
            face.point(1).y() << " " <<
            face.point(1).z() <<
            " ) ( "           <<
            face.point(2).x() << " " <<
            face.point(2).y() << " " <<
            face.point(2).z() <<
            " ) ";

            stream.precision(6);
            stream <<
            textureName     << " " <<
            face.xOffset()  << " " <<
            face.yOffset()  << " " <<
            face.rotation() << " " <<
            face.xScale()   << " " <<
            face.yScale()   << "\n";
        }
Example #2
0
        size_t MapWriter::writeFace(Model::Face& face, const size_t lineNumber, FILE* stream) {
            const String textureName = Utility::isBlank(face.textureName()) ? Model::Texture::Empty : face.textureName();

            std::fprintf(stream, FaceFormat.c_str(),
                    face.point(0).x(),
                    face.point(0).y(),
                    face.point(0).z(),
                    face.point(1).x(),
                    face.point(1).y(),
                    face.point(1).z(),
                    face.point(2).x(),
                    face.point(2).y(),
                    face.point(2).z(),
                    textureName.c_str(),
                    face.xOffset(),
                    face.yOffset(),
                    face.rotation(),
                    face.xScale(),
                    face.yScale());
            face.setFilePosition(lineNumber);
            return 1;
        }