Files
assaultcube-/source/src/model.h
T
Lee Salzman 2ed1e7366d better tag support
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1728 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-03-30 02:42:49 +00:00

68 lines
2.3 KiB
C

enum { ANIM_IDLE = 0, ANIM_RUN, ANIM_ATTACK, ANIM_PAIN, ANIM_JUMP, ANIM_LAND, ANIM_FLIPOFF, ANIM_SALUTE, ANIM_TAUNT, ANIM_WAVE, ANIM_POINT, ANIM_CROUCH_IDLE, ANIM_CROUCH_WALK, ANIM_CROUCH_ATTACK, ANIM_CROUCH_PAIN, ANIM_CROUCH_DEATH, ANIM_DEATH, ANIM_LYING_DEAD, ANIM_FLAG, ANIM_GUN_IDLE, ANIM_GUN_SHOOT, ANIM_GUN_RELOAD, ANIM_GUN_THROW, ANIM_MAPMODEL, ANIM_TRIGGER, ANIM_ALL, NUMANIMS };
#define ANIM_INDEX 0xFF
#define ANIM_LOOP (1<<8)
#define ANIM_START (1<<9)
#define ANIM_END (1<<10)
#define ANIM_REVERSE (1<<11)
#define ANIM_NOINTERP (1<<12)
#define ANIM_MIRROR (1<<13)
#define ANIM_NOSKIN (1<<14)
#define ANIM_TRANSLUCENT (1<<15)
struct animstate // used for animation blending of animated characters
{
int anim, frame, range, basetime;
float speed;
animstate() { reset(); }
void reset() { anim = frame = range = basetime = 0; speed = 100.0f; };
bool operator==(const animstate &o) const { return frame==o.frame && range==o.range && basetime==o.basetime && speed==o.speed; }
bool operator!=(const animstate &o) const { return frame!=o.frame || range!=o.range || basetime!=o.basetime || speed!=o.speed; }
};
enum { MDL_MD2 = 1, MDL_MD3 };
enum { MDL_ATTACH_VWEP = 0 };
struct model;
struct modelattach
{
const char *name;
int type, anim, basetime;
float speed;
model *m;
};
struct dynent;
struct model
{
bool cullface;
float translucency, scale;
vec translate;
int batch;
model() : cullface(true), translucency(0.25f), scale(1), translate(0, 0, 0), batch(-1) {}
virtual ~model() {}
virtual bool load() = 0;
virtual char *name() = 0;
virtual int type() = 0;
virtual void cleanup() = 0;
virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0;
virtual void setskin(int tex = 0) = 0;
virtual void genshadows(float height, float rad) {}
virtual void rendershadow(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, modelattach *a = NULL) {}
virtual bool hasshadows() { return false; }
virtual void startrender() {}
virtual void endrender() {}
};
struct mapmodelinfo { int rad, h, zoff; string name; model *m; };