This repository has been archived on 2020-09-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
libs/qglview/loader_3ds.h
Бычков Андрей ba8bc27298 1
git-svn-id: svn://db.shs.com.ru/libs@1 a8b55f48-bf90-11e4-a774-851b48703e85
2015-02-28 21:28:53 +00:00

73 lines
3.2 KiB
C++

/*
QGLView
Copyright (C) 2012 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOADER_3DS_H
#define LOADER_3DS_H
#include "gltexture_manager.h"
#include "globject.h"
#include <QGLWidget>
#include <QFileInfo>
#include <QDateTime>
#define LOADER_3DS_CHUNK_MAIN 0x4D4D // [-] сцена
#define LOADER_3DS_CHUNK_COLOR_F 0x0010 // [+] цвет во float
#define LOADER_3DS_CHUNK_COLOR_B 0x0011 // [+] цвет в byte
#define LOADER_3DS_CHUNK_OBJECTS 0x3D3D // [-] всяческие объекты
#define LOADER_3DS_CHUNK_OBJECT 0x4000 // [+] объект
#define LOADER_3DS_CHUNK_MESH 0x4100 // [-] mesh-объект
#define LOADER_3DS_CHUNK_VERTLIST 0x4110 // [+] список вершин
#define LOADER_3DS_CHUNK_FACELIST 0x4120 // [+] список граней
#define LOADER_3DS_CHUNK_FACEMAT 0x4130 // [+] материалы граней
#define LOADER_3DS_CHUNK_MAPLIST 0x4140 // [+] текстурные координаты
#define LOADER_3DS_CHUNK_SMOOTH 0x4150 // [+] группы сглаживания
#define LOADER_3DS_CHUNK_TRMATRIX 0x4160 // [+] матрица перевода
#define LOADER_3DS_CHUNK_LIGHT 0x4600 // [+] источник света
#define LOADER_3DS_CHUNK_SPOTLIGHT 0x4610 // [+]
#define LOADER_3DS_CHUNK_LIGHT_OFF 0x4620 // [+]
#define LOADER_3DS_CHUNK_ATTENUATION_ON 0x4625 // [+]
#define LOADER_3DS_CHUNK_RANGE_START 0x4659 // [+]
#define LOADER_3DS_CHUNK_RANGE_END 0x465A // [+]
#define LOADER_3DS_CHUNK_MULTIPLIER 0x465B // [+]
#define LOADER_3DS_CHUNK_CAMERA 0x4700 // [+] объект-камера
#define LOADER_3DS_CHUNK_MATERIAL 0xAFFF // [-] материал
#define LOADER_3DS_CHUNK_MATNAME 0xA000 // [+] название материала
#define LOADER_3DS_CHUNK_TEXTURE 0xA200 // [-] текстура материала
#define LOADER_3DS_CHUNK_MAPFILE 0xA300 // [+] имя файла текстуры
namespace Loader3DS {
#pragma pack(push, 1)
struct Chunk {
ushort id;
uint size;
};
struct Face {
ushort v0;
ushort v1;
ushort v2;
ushort flags;
};
#pragma pack(pop)
void init3DSMesh(GLObjectBase * o, const QVector<uint> & smooth);
}
GLObjectBase * loadFrom3DSFile(const QString & filepath, double scale = 1.0);
#endif // LOADER_3DS_H