28 #ifndef WINTERMUTE_XMODEL_H 29 #define WINTERMUTE_XMODEL_H 31 #include "engines/wintermute/base/base_object.h" 32 #include "engines/wintermute/base/base_sprite.h" 33 #include "engines/wintermute/coll_templ.h" 34 #include "engines/wintermute/math/rect32.h" 35 #include "engines/wintermute/video/video_theora_player.h" 36 #include "engines/wintermute/utils/utils.h" 38 #include "math/matrix4.h" 39 #include "math/vector3d.h" 40 #include "math/vector4d.h" 44 class AnimationChannel;
56 #define X_NUM_ANIMATION_CHANNELS 10 65 class XModelMatSprite {
77 XModelMatSprite(
const char *matName,
BaseSprite *sprite) {
80 BaseUtils::setString(&_matName, matName);
87 BaseUtils::setString(&_matName, matName);
116 persistMgr->transferCharPtr(TMEMBER(_matName));
117 persistMgr->transferPtr(TMEMBER(_sprite));
119 persistMgr->transferPtr(TMEMBER(_theora));
130 const static int kDefaultTicksPerSecond = 4800;
142 bool update()
override;
144 bool renderFlatShadowModel();
147 bool updateShadowVol(
ShadowVolume *shadow, Math::Matrix4 &modelMat,
const Math::Vector3d &light,
float extrusionDepth);
149 bool playAnim(
int channel,
const Common::String &anim, uint32 transitionTime = 0,
bool forceReset =
false, uint32 stopTransitionTime = 0);
150 bool isAnimPending(
char *animName =
nullptr);
151 bool isAnimPending(
int channel,
const char *animName =
nullptr);
153 bool isTransparentAt(
int x,
int y);
161 Math::Matrix4 _lastWorldMat;
165 bool parseAnim(byte *buffer);
169 bool stopAnim(
int channel, uint32 transitionTime);
170 bool stopAnim(uint32 transitionTime);
172 Math::Matrix4 *getBoneMatrix(
const char *boneName);
175 bool setMaterialSprite(
const char *materialName,
const char *spriteFilename);
176 bool setMaterialTheora(
const char *materialName,
const char *theoraFilename);
177 bool initializeSimple();
179 bool invalidateDeviceObjects()
override;
180 bool restoreDeviceObjects()
override;
182 bool unloadAnimation(
const char *animName);
184 uint32 _ticksPerSecond;
189 void cleanup(
bool complete =
true);
190 bool findBones(
bool animOnly =
false,
XModel *parentModel =
nullptr);
192 void updateBoundingRect();
193 void static inline updateRect(
Rect32 *rc, int32 x, int32 y);
195 Math::Matrix4 _lastViewMat;
196 Math::Matrix4 _lastProjMat;
200 Math::Vector3d _BBoxStart;
201 Math::Vector3d _BBoxEnd;
Definition: base_game.h:75
Definition: base_persistence_manager.h:55
Definition: coll_templ.h:115
Definition: xanimation_set.h:42
Definition: video_theora_player.h:41
Definition: 3dshadow_volume.h:48
Definition: xanimation_channel.h:37
Definition: coll_templ.h:63
Definition: base_named_object.h:36
Definition: xframe_node.h:46
Definition: xmaterial.h:76
Definition: base_sprite.h:40
Definition: xfile_loader.h:452
Definition: base_object.h:57
Definition: achievements_tables.h:27