]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_cao.h
Cavegen: Minor misc. fixes
[dragonfireclient.git] / src / content_cao.h
index bf1ac5b3fa02db8d7e03d8a78bb6ae2d1468ad63..bf99fd3bafd0b323cbdb71d41918cb4ca92772f9 100644 (file)
@@ -22,11 +22,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include <map>
 #include "irrlichttypes_extrabloated.h"
-#include "content_object.h"
 #include "clientobject.h"
 #include "object_properties.h"
 #include "itemgroup.h"
 
+class Camera;
+struct Nametag;
+
 /*
        SmoothTranslator
 */
@@ -61,17 +63,18 @@ class GenericCAO : public ClientActiveObject
        std::string m_name;
        bool m_is_player;
        bool m_is_local_player;
-       int m_id;
        // Property-ish things
        ObjectProperties m_prop;
        //
        scene::ISceneManager *m_smgr;
        IrrlichtDevice *m_irr;
-       core::aabbox3d<f32> m_selection_box;
+       IGameDef *m_gamedef;
+       aabb3f m_selection_box;
        scene::IMeshSceneNode *m_meshnode;
        scene::IAnimatedMeshSceneNode *m_animated_meshnode;
+       WieldMeshSceneNode *m_wield_meshnode;
        scene::IBillboardSceneNode *m_spritenode;
-       scene::ITextSceneNode* m_textnode;
+       Nametag* m_nametag;
        v3f m_position;
        v3f m_velocity;
        v3f m_acceleration;
@@ -86,6 +89,7 @@ class GenericCAO : public ClientActiveObject
        v2s32 m_animation_range;
        int m_animation_speed;
        int m_animation_blend;
+       bool m_animation_loop;
        std::map<std::string, core::vector2d<v3f> > m_bone_position; // stores position and rotation for each bone name
        std::string m_attachment_bone;
        v3f m_attachment_position;
@@ -114,7 +118,7 @@ class GenericCAO : public ClientActiveObject
                return new GenericCAO(gamedef, env);
        }
 
-       inline u8 getType() const
+       inline ActiveObjectType getType() const
        {
                return ACTIVEOBJECT_TYPE_GENERIC;
        }
@@ -127,14 +131,18 @@ class GenericCAO : public ClientActiveObject
 
        bool collideWithObjects();
 
-       core::aabbox3d<f32>* getSelectionBox();
+       aabb3f *getSelectionBox();
 
        v3f getPosition();
 
+       scene::ISceneNode *getSceneNode();
+
        scene::IMeshSceneNode *getMeshSceneNode();
 
        scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode();
 
+       WieldMeshSceneNode *getWieldMeshSceneNode();
+
        scene::IBillboardSceneNode *getSpriteSceneNode();
 
        inline bool isPlayer() const
@@ -157,6 +165,8 @@ class GenericCAO : public ClientActiveObject
                m_is_visible = toset;
        }
 
+       void setChildrenVisible(bool toset);
+
        void setAttachments();
 
        void removeFromScene(bool permanent);
@@ -171,6 +181,8 @@ class GenericCAO : public ClientActiveObject
 
        void updateLight(u8 light_at_pos);
 
+       void updateLightNoCheck(u8 light_at_pos);
+
        v3s16 getLightPosition();
 
        void updateNodePos();
@@ -193,6 +205,11 @@ class GenericCAO : public ClientActiveObject
                        float time_from_last_punch=1000000);
 
        std::string debugInfoText();
+
+       std::string infoText()
+       {
+               return m_prop.infotext;
+       }
 };