Files
BlitzNext/Runtime/blitz3d/md2model.hpp
T

60 lines
995 B
C++
Raw Normal View History

2019-01-18 21:26:42 +01:00
#pragma once
2019-01-18 15:55:06 +01:00
#include "md2rep.hpp"
2019-01-18 17:04:17 +01:00
#include "model.hpp"
2019-01-18 21:26:42 +01:00
#include <string>
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
class MD2Model : public Model {
public:
2019-01-18 21:26:42 +01:00
MD2Model(const std::string& filename);
2019-01-18 17:04:17 +01:00
MD2Model(const MD2Model& t);
2014-01-31 08:23:00 +13:00
~MD2Model();
//Entity interface
2019-01-18 17:04:17 +01:00
Entity* clone()
{
return new MD2Model(*this);
}
MD2Model* getMD2Model()
{
return this;
}
2014-01-31 08:23:00 +13:00
//Object interface
2019-01-18 17:04:17 +01:00
void animate(float elapsed);
2014-01-31 08:23:00 +13:00
//Model interface
2019-01-18 17:04:17 +01:00
bool render(const RenderContext& rc);
2014-01-31 08:23:00 +13:00
//MD2 interface
2019-01-18 17:04:17 +01:00
void startMD2Anim(int first, int last, int mode, float speed, float trans);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
int getMD2AnimLength() const;
bool getMD2Animating() const
{
return !!anim_mode;
}
float getMD2AnimTime() const
{
return anim_time;
}
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
bool getValid() const;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
private:
2014-01-31 08:23:00 +13:00
struct Rep;
2019-01-18 17:04:17 +01:00
Rep* rep;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
int anim_mode;
float anim_time, anim_speed;
int anim_first, anim_last, anim_len;
2014-01-31 08:23:00 +13:00
float render_t;
2019-01-18 17:04:17 +01:00
int render_a, render_b;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
float trans_time, trans_speed;
MD2Rep::Vert* trans_verts;
2014-01-31 08:23:00 +13:00
//Unimplemented
2019-01-18 17:04:17 +01:00
MD2Model& operator=(const MD2Model&);
2014-01-31 08:23:00 +13:00
};