2004-05-30 02:46:58 +02:00
|
|
|
#ifndef _OBJECTENTRY_H
|
|
|
|
#define _OBJECTENTRY_H
|
|
|
|
|
|
|
|
class CModel;
|
|
|
|
class CSkeletonAnim;
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "CStr.h"
|
|
|
|
#include "Bound.h"
|
|
|
|
#include "ModelDef.h"
|
|
|
|
|
|
|
|
class CObjectEntry
|
|
|
|
{
|
|
|
|
public:
|
2004-06-08 14:10:51 +02:00
|
|
|
struct Anim {
|
|
|
|
// constructor
|
|
|
|
Anim() : m_Speed(1), m_AnimData(0) {}
|
2004-06-07 22:01:46 +02:00
|
|
|
|
2004-05-30 02:46:58 +02:00
|
|
|
// name of the animation - "Idle", "Run", etc
|
|
|
|
CStr m_AnimName;
|
|
|
|
// filename of the animation - manidle.psa, manrun.psa, etc
|
|
|
|
CStr m_FileName;
|
|
|
|
// animation speed, as specified in XML actor file
|
|
|
|
float m_Speed;
|
|
|
|
// the animation data, specific to the this model
|
|
|
|
CSkeletonAnim* m_AnimData;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Prop {
|
|
|
|
// name of the prop point to attach to - "Prop01", "Prop02", "Head", "LeftHand", etc ..
|
|
|
|
CStr m_PropPointName;
|
|
|
|
// name of the model file - art/actors/props/sword.xml or whatever
|
|
|
|
CStr m_ModelName;
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
CObjectEntry(int type);
|
|
|
|
~CObjectEntry();
|
|
|
|
|
|
|
|
bool BuildModel();
|
|
|
|
|
|
|
|
bool Load(const char* filename);
|
|
|
|
bool Save(const char* filename);
|
|
|
|
|
2004-10-06 20:46:33 +02:00
|
|
|
Prop* FindProp(const char* proppointname);
|
|
|
|
|
2004-05-30 02:46:58 +02:00
|
|
|
// object name
|
|
|
|
CStr m_Name;
|
2004-10-06 20:46:33 +02:00
|
|
|
// file name
|
|
|
|
CStr m_FileName;
|
2004-05-30 02:46:58 +02:00
|
|
|
// texture name
|
|
|
|
CStr m_TextureName;
|
|
|
|
// model name
|
|
|
|
CStr m_ModelName;
|
|
|
|
// list of valid animations for this object
|
|
|
|
std::vector<Anim> m_Animations;
|
|
|
|
CSkeletonAnim* m_IdleAnim;
|
|
|
|
CSkeletonAnim* m_WalkAnim;
|
|
|
|
CSkeletonAnim* m_DeathAnim;
|
|
|
|
CSkeletonAnim* m_MeleeAnim;
|
|
|
|
CSkeletonAnim* m_RangedAnim;
|
|
|
|
CSkeletonAnim* GetNamedAnimation( CStr animationName );
|
|
|
|
// list of props attached to object
|
|
|
|
std::vector<Prop> m_Props;
|
2004-10-06 20:46:33 +02:00
|
|
|
struct {
|
|
|
|
// automatically flatten terrain when applying object
|
|
|
|
bool m_AutoFlatten;
|
|
|
|
// cast shadows from this object
|
|
|
|
bool m_CastShadows;
|
|
|
|
} m_Properties;
|
2004-05-30 02:46:58 +02:00
|
|
|
// corresponding model
|
|
|
|
CModel* m_Model;
|
|
|
|
// type of object; index into object managers types array
|
|
|
|
int m_Type;
|
2004-09-23 07:10:03 +02:00
|
|
|
// the material file
|
|
|
|
CStr m_Material;
|
2004-05-30 02:46:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|