ScummVM API documentation
xmesh.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * This file is based on WME.
24 * http://dead-code.org/redir.php?target=wme
25 * Copyright (c) 2003-2013 Jan Nedoma and contributors
26 */
27
28#ifndef WINTERMUTE_XMESH_H
29#define WINTERMUTE_XMESH_H
30
31#include "engines/wintermute/base/base_named_object.h"
32#include "engines/wintermute/base/gfx/xmodel.h"
33#include "engines/wintermute/coll_templ.h"
34
35namespace Wintermute {
36
37class BaseSprite;
38class FrameNode;
39class Material;
40class ShadowVolume;
41class VideoTheoraPlayer;
42class SkinMeshHelper;
43class DXMesh;
44class Effect3D;
45class Effect3DParams;
46struct XMeshObject;
47
48class XMesh : public BaseNamedObject {
49 friend class XSkinMeshLoader;
50public:
51 XMesh(BaseGame *inGame);
52 virtual ~XMesh();
53
54 virtual bool loadFromXData(const char *filename, XFileData *xobj);
55 bool findBones(FrameNode *rootFrame);
56 virtual bool update(FrameNode *parentFrame);
57 virtual bool render(XModel *model) = 0;
58 virtual bool renderFlatShadowModel(uint32 shadowColor) = 0;
59 bool updateShadowVol(ShadowVolume *shadow, DXMatrix *modelMat, DXVector3 *light, float extrusionDepth);
60
61 bool pickPoly(DXVector3 *pickRayOrig, DXVector3 *pickRayDir);
62
63 DXVector3 _BBoxStart;
64 DXVector3 _BBoxEnd;
65
66 bool setMaterialSprite(const char *matName, BaseSprite *sprite);
67 bool setMaterialTheora(const char *matName, VideoTheoraPlayer *theora);
68 bool setMaterialEffect(const char *matName, Effect3D *effect, Effect3DParams *params);
69 bool removeMaterialEffect(const char *matName);
70
71 bool invalidateDeviceObjects();
72 bool restoreDeviceObjects();
73
74protected:
75 bool generateMesh();
76
77 SkinMeshHelper *_skinMesh;
78 DXMesh *_blendedMesh;
79 DXMesh *_staticMesh;
80
81 DXMatrix **_boneMatrices;
82
83 uint32 *_adjacency;
84
85 BaseArray<Material *> _materials;
86};
87
88} // namespace Wintermute
89
90#endif
Definition: coll_templ.h:345
Definition: base_game.h:79
Definition: base_named_object.h:36
Definition: base_sprite.h:40
Definition: xskinmesh.h:127
Definition: 3deffect.h:36
Definition: 3deffect_params.h:36
Definition: xframe_node.h:44
Definition: 3dshadow_volume.h:49
Definition: skin_mesh_helper.h:41
Definition: video_theora_player.h:41
Definition: xfile_loader.h:459
Definition: xmesh.h:48
Definition: xmodel.h:54
Definition: xmath.h:139
Definition: xmath.h:72