⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mesh.h

📁 最新osg包
💻 H
字号:
// -*-c++-*-/* * $Id: mesh.h 5224 2006-07-04 09:13:15Z robert $ * * Loader for DirectX .x files. * Copyright (c)2002-2006 Ulrich Hertlein <u.hertlein@sandbox.de> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#ifndef _MESH_H_#define _MESH_H_#include "types.h"namespace DX {    class Object;    /**     * DirectX mesh.     */    class Mesh {    public:        Mesh(Object * obj);        virtual ~Mesh() {            clear();        }        void clear();        /**         * Generate per-vertex normals for the mesh.         * @return false if an error occurred, else true.         */        bool generateNormals(float creaseAngle);        /// Get Vertices.        const std::vector<Vector> & getVertices() const {            return _vertices;        }        /// Get MeshFaces.        const std::vector<MeshFace> & getFaces() const {            return _faces;        }        /// Get MeshTextureCoords.        inline const MeshTextureCoords* getMeshTextureCoords() const {            return _textureCoords;        }        /// Get MeshMaterialList.        inline const MeshMaterialList* getMeshMaterialList() const {            return _materialList;        }        /// Get MeshNormals.        inline const MeshNormals* getMeshNormals() const {            return _normals;        }        /// Parse 'Mesh'.        void parseMesh(std::ifstream& fin);    private:        Object * _obj;        std::vector<Vector> _vertices;        std::vector<MeshFace> _faces;        /// Normals (per-face).        MeshNormals* _normals;        /// Texture coordinates (per-vertex).        MeshTextureCoords* _textureCoords;        /// Materials.        MeshMaterialList* _materialList;        /// Parse 'MeshNormals'.        void parseMeshNormals(std::ifstream& fin);        /// Parse 'MeshMaterialList'.        void parseMeshMaterialList(std::ifstream& fin);        /// Read 'MeshTextureCoords'.        void readMeshTexCoords(std::ifstream& fin);    };} // namespace#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -