2005-03-19 20:10:52 +01:00
|
|
|
#ifndef _OBJECTBASE_H
|
|
|
|
#define _OBJECTBASE_H
|
|
|
|
|
|
|
|
class CModel;
|
|
|
|
class CSkeletonAnim;
|
|
|
|
|
|
|
|
#include <vector>
|
2005-05-18 07:32:09 +02:00
|
|
|
#include <set>
|
2005-03-19 20:10:52 +01:00
|
|
|
#include "CStr.h"
|
|
|
|
|
|
|
|
class CObjectBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct Anim {
|
|
|
|
// constructor
|
2005-05-21 03:40:32 +02:00
|
|
|
Anim() : m_Speed(1), m_ActionPos(0.0), m_ActionPos2(0.0) {}
|
2005-03-19 20:10:52 +01: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;
|
2005-05-03 06:27:07 +02:00
|
|
|
// fraction of the way through the animation that the interesting bit(s)
|
2005-05-27 02:38:30 +02:00
|
|
|
// happens
|
2005-05-01 21:09:13 +02:00
|
|
|
double m_ActionPos;
|
2005-05-03 06:27:07 +02:00
|
|
|
double m_ActionPos2;
|
2005-03-19 20:10:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Variant
|
|
|
|
{
|
|
|
|
Variant() : m_Frequency(0) {}
|
|
|
|
CStr m_VariantName;
|
|
|
|
int m_Frequency;
|
|
|
|
CStr m_ModelFilename;
|
|
|
|
CStr m_TextureFilename;
|
2005-04-07 06:29:07 +02:00
|
|
|
CStr m_Color;
|
2005-03-19 20:10:52 +01:00
|
|
|
|
|
|
|
std::vector<Anim> m_Anims;
|
|
|
|
std::vector<Prop> m_Props;
|
|
|
|
};
|
|
|
|
|
|
|
|
CObjectBase();
|
|
|
|
|
|
|
|
std::vector< std::vector<Variant> > m_Variants;
|
|
|
|
|
2006-03-17 04:59:49 +01:00
|
|
|
std::vector<u8> CalculateVariationKey(const std::vector<std::set<CStrW> >& selections);
|
2005-03-19 20:10:52 +01:00
|
|
|
|
2006-03-17 04:59:49 +01:00
|
|
|
std::set<CStrW> CalculateRandomVariation(const std::set<CStrW>& initialSelections);
|
2005-03-19 20:10:52 +01:00
|
|
|
|
|
|
|
bool Load(const char* filename);
|
|
|
|
|
|
|
|
// object name
|
|
|
|
CStr m_Name;
|
|
|
|
|
2005-03-29 22:50:04 +02:00
|
|
|
// short human-readable name
|
|
|
|
CStr m_ShortName;
|
2005-03-19 20:10:52 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
// automatically flatten terrain when applying object
|
|
|
|
bool m_AutoFlatten;
|
|
|
|
// cast shadows from this object
|
|
|
|
bool m_CastShadows;
|
|
|
|
} m_Properties;
|
|
|
|
|
|
|
|
// the material file
|
|
|
|
CStr m_Material;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|