예제 #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";
        }
 FaceSnapshot::FaceSnapshot(const Model::Face& face) {
     m_faceId = face.faceId();
     m_xOffset = face.xOffset();
     m_yOffset = face.yOffset();
     m_xScale = face.xScale();
     m_yScale = face.yScale();
     m_rotation = face.rotation();
     m_texture = face.texture();
     m_textureName = face.textureName();
 }
예제 #3
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;
        }