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 
35 namespace Wintermute {
36 
37 class BaseSprite;
38 class FrameNode;
39 class Material;
40 class ShadowVolume;
41 class VideoTheoraPlayer;
42 class SkinMeshHelper;
43 class DXMesh;
44 class Effect3D;
45 class Effect3DParams;
46 struct XMeshObject;
47 
48 class XMesh : public BaseNamedObject {
49  friend class XSkinMeshLoader;
50 public:
51  XMesh(BaseGame *inGame);
52  virtual ~XMesh();
53 
54  virtual bool loadFromXData(const Common::String &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() = 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 Common::String &matName, BaseSprite *sprite);
67  bool setMaterialTheora(const Common::String &matName, VideoTheoraPlayer *theora);
68  bool setMaterialEffect(const Common::String &matName, Effect3D *effect, Effect3DParams *params);
69  bool removeMaterialEffect(const Common::String &matName);
70 
71  bool invalidateDeviceObjects();
72  bool restoreDeviceObjects();
73 
74 protected:
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: base_game.h:76
Definition: str.h:59
Definition: xskinmesh.h:127
Definition: xmath.h:50
Definition: video_theora_player.h:41
Definition: skin_mesh_helper.h:41
Definition: xmodel.h:54
Definition: xmesh.h:48
Definition: 3dshadow_volume.h:49
Definition: coll_templ.h:63
Definition: 3deffect_params.h:36
Definition: base_named_object.h:36
Definition: xframe_node.h:44
Definition: xmath.h:116
Definition: base_sprite.h:40
Definition: 3deffect.h:36
Definition: xfile_loader.h:459
Definition: achievements_tables.h:27