root/cafu/trunk/CaWE/MapHelperModel.hpp

Revision 469, 3.4 KB (checked in by Carsten, 4 months ago)

Model code:

  • Removed methods from class AnimPoseT that have been obsoleted by the AnimExpressionT classes.
  • Updated all user code accordingly.
Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22#ifndef CAFU_MAP_HELPER_MODEL_HPP_INCLUDED
23#define CAFU_MAP_HELPER_MODEL_HPP_INCLUDED
24
25#include "MapHelper.hpp"
26#include "Models/AnimExpr.hpp"
27#include "Util/Util.hpp"
28
29
30class HelperInfoT;
31class MapEntityT;
32class Renderer2DT;
33class Renderer3DT;
34
35class CafuModelT;
36namespace cf { namespace GuiSys { class GuiImplT; } }
37namespace cf { namespace TypeSys { class TypeInfoT; } }
38namespace cf { namespace TypeSys { class TypeInfoManT; } }
39namespace cf { namespace TypeSys { class CreateParamsT; } }
40
41
42class MapHelperModelT : public MapHelperT
43{
44    public:
45
46    /// The constructor.
47    MapHelperModelT(const MapEntityT* ParentEntity, const HelperInfoT* HelperInfo);
48
49    /// The copy constructor for copying a model.
50    /// @param Model   The model to copy-construct this model from.
51    MapHelperModelT(const MapHelperModelT& Model);
52
53    /// The destructor.
54    ~MapHelperModelT();
55
56
57    // Implementations and overrides for base class methods.
58    MapHelperModelT* Clone() const;
59    void             Assign(const MapElementT* Elem);
60
61    wxString GetDescription() const { return "model"; }
62    BoundingBox3fT GetBB() const;
63
64    void Render2D(Renderer2DT& Renderer) const;
65    void Render3D(Renderer3DT& Renderer) const;
66
67    // The TypeSys related declarations for this class.
68    virtual const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
69    static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
70    static const cf::TypeSys::TypeInfoT TypeInfo;
71
72
73    protected:
74
75    void ClearGuis() const;
76    void UpdateModelCache() const;
77    int  GetSequenceNr() const;
78
79    const HelperInfoT*                       m_HelperInfo;  ///< The HelperInfoT instance that caused the instantiation of this helper.
80    mutable const CafuModelT*                m_Model;       ///< Our model (obtained from the game config's model manager).
81    mutable IntrusivePtrT<AnimExpressionT>   m_AnimExpr;    ///< The current expression used for configuring the pose of the model.
82    mutable IntrusivePtrT<AnimExprStandardT> m_LastStdAE;   ///< The most recent standard expression that we set (as a subexpression of m_AnimExpr).
83    mutable ArrayT<wxString>                 m_GuiNames;    ///< The names of the GUIs in m_Guis.
84    mutable ArrayT<cf::GuiSys::GuiImplT*>    m_Guis;        ///< The GUIs that are rendered where the model has GUI fixtures.
85    mutable TimerT                           m_Timer;
86};
87
88#endif
Note: See TracBrowser for help on using the browser.