7 #ifndef CAFU_GAMESYS_COMPONENT_MODEL_HPP_INCLUDED
8 #define CAFU_GAMESYS_COMPONENT_MODEL_HPP_INCLUDED
10 #include "CompBase.hpp"
13 namespace cf {
namespace GuiSys {
class GuiImplT; } }
49 const char*
GetName()
const {
return "Model"; }
54 bool Render(
bool FirstPersonView,
float LodDist)
const;
68 static int GetNumAnims(lua_State* LuaState);
69 static int GetNumSkins(lua_State* LuaState);
70 static int GetGui(lua_State* LuaState);
71 static int toString(lua_State* LuaState);
74 static const char* DocClass;
88 VarModelNameT(
const char* Name,
const std::string& Value,
const char* Flags[],
ComponentModelT& Comp);
92 std::string GetExtraMessage()
const {
return m_ExtraMsg; }
95 void Set(
const std::string& v);
101 std::string m_ExtraMsg;
111 VarModelAnimNrT(
const char* Name,
const int& Value,
const char* Flags[],
ComponentModelT& Comp);
115 void Set(
const int& v);
121 void SetAnimNr(
int AnimNr);
132 VarModelSkinNrT(
const char* Name,
const int& Value,
const char* Flags[],
ComponentModelT& Comp);
147 class VarGuiNameT :
public TypeSys::VarT<std::string>
151 VarGuiNameT(
const char* Name,
const std::string& Value,
const char* Flags[],
ComponentModelT& Comp);
155 void Set(
const std::string& v);
164 void FillMemberVars();
165 void ReInit(std::string* ErrorMsg=NULL);
167 TypeSys::VarT<bool> m_ModelShow;
168 VarModelNameT m_ModelName;
169 VarModelAnimNrT m_ModelAnimNr;
170 VarModelSkinNrT m_ModelSkinNr;
171 TypeSys::VarT<float> m_ModelScale;
172 VarGuiNameT m_GuiName;
174 TypeSys::VarT<bool> m_IsSubmodel;
175 TypeSys::VarT<bool> m_Is1stPerson;
BoundingBox3fT GetCullingBB() const
This method returns a bounding-box that encloses the visual representation of this component...
Definition: CompModel.cpp:570
This class represents a native Cafu model.
Definition: Model_cmdl.hpp:45
AnimPoseT * GetPose() const
Returns the current pose of this model (or NULL if there is no pose (yet)).
Definition: CompModel.cpp:363
unsigned int GetEditorColor() const
Returns a color that the Map Editor can use to render the representation of this component's entity...
Definition: CompModel.hpp:51
void Deserialize(cf::Network::InStreamT &Stream, bool IsIniting)
Reads the state of this component from the given stream, and updates the component accordingly...
Definition: CompBase.cpp:116
void Serialize(cf::Network::OutStreamT &Stream) const
Writes the current state of this component into the given stream.
Definition: CompBase.cpp:98
This class represents game entities, which are the basic elements of a world.
Definition: Entity.hpp:53
This is a "wrapper" around a normal C++ variable.
Definition: SetCompVar.hpp:15
ComponentModelT * Clone() const
The virtual copy constructor.
Definition: CompModel.cpp:488
~ComponentModelT()
The destructor.
Definition: CompModel.cpp:354
This class is used for reading data from a StateT instance (deserialization).
Definition: State.hpp:207
IntrusivePtrT< cf::GuiSys::GuiImplT > GetGui() const
Returns the GUI instance of this model, if it has one (or NULL otherwise).
Definition: CompModel.cpp:376
static const luaL_Reg MethodsList[]
The list of Lua methods for this class.
Definition: CompModel.hpp:73
ComponentModelT()
The constructor.
Definition: CompModel.cpp:299
This class is used for writing data into a StateT instance (serialization).
Definition: State.hpp:81
BoundingBox3fT GetEditorBB() const
Returns a bounding-box that the Map Editor can use to render the representation of this component's e...
Definition: CompModel.cpp:544
void UpdateDependencies(EntityT *Entity)
This method is called whenever something "external" to this component has changed: ...
Definition: CompModel.cpp:536
This class describes a specific pose of an associated model.
Definition: AnimPose.hpp:35
bool Render(bool FirstPersonView, float LodDist) const
This method implements the graphical output of this component.
Definition: CompModel.cpp:576
This component adds a 3D model to its entity.
Definition: CompModel.hpp:27
void DoClientFrame(float t)
Derived classes override this method in order to implement the real work proposed by OnClientFrame()...
Definition: CompModel.cpp:676
const char * GetName() const
Returns the name of this component.
Definition: CompModel.hpp:49
Definition: TypeSys.hpp:52
Definition: TypeSys.hpp:57
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
void DoServerFrame(float t)
Derived classes override this method in order to implement the real work proposed by OnServerFrame()...
Definition: CompModel.cpp:650
Definition: TypeSys.hpp:68
This is the base class for the components that an entity is composed/aggregated of.
Definition: CompBase.hpp:54