2003-04-25 21:05:40 +00:00
|
|
|
#ifndef Model_H
|
|
|
|
|
#define Model_H
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: Model
|
|
|
|
|
|
|
|
|
|
Desc: A 3D model.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "Actor.h"
|
|
|
|
|
#include "RageTypes.h"
|
2003-05-04 05:21:16 +00:00
|
|
|
#include <vector>
|
2003-04-25 21:05:40 +00:00
|
|
|
|
|
|
|
|
struct msModel;
|
|
|
|
|
|
|
|
|
|
typedef float matrix_t[3][4];
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
matrix_t mRelative;
|
|
|
|
|
matrix_t mAbsolute;
|
|
|
|
|
matrix_t mRelativeFinal;
|
|
|
|
|
matrix_t mFinal;
|
|
|
|
|
} myBone_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Model : public Actor
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Model ();
|
|
|
|
|
virtual ~Model ();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void Clear ();
|
2003-05-04 05:21:16 +00:00
|
|
|
bool LoadMilkshapeAscii( CString sPath );
|
|
|
|
|
bool LoadMilkshapeAsciiBones( CString sPath );
|
2003-04-25 21:05:40 +00:00
|
|
|
|
|
|
|
|
virtual void Update( float fDelta );
|
|
|
|
|
virtual void DrawPrimitives();
|
|
|
|
|
|
|
|
|
|
float CalcDistance () const;
|
|
|
|
|
void SetupBones ();
|
|
|
|
|
void AdvanceFrame (float dt);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
msModel *m_pModel;
|
|
|
|
|
RageVector3 m_vMins, m_vMaxs;
|
|
|
|
|
myBone_t *m_pBones;
|
2003-05-04 05:21:16 +00:00
|
|
|
typedef vector<RageVertex> RageVertexVector;
|
|
|
|
|
vector<RageVertexVector> m_vTempVerticesByBone;
|
2003-04-25 21:05:40 +00:00
|
|
|
float m_fCurrFrame;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|