]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/content_cao.h
Shaders for Android (GLES 2) (#10506)
[dragonfireclient.git] / src / client / content_cao.h
index aef1f1296afa3f1d44301716f35f51cd96437345..435fc2931656f4a553cfbcf784caa9be11a59180 100644 (file)
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class Camera;
 class Client;
 struct Nametag;
+struct MinimapMarker;
 
 /*
        SmoothTranslator
@@ -84,6 +85,7 @@ class GenericCAO : public ClientActiveObject
        scene::IBillboardSceneNode *m_spritenode = nullptr;
        scene::IDummyTransformationSceneNode *m_matrixnode = nullptr;
        Nametag *m_nametag = nullptr;
+       MinimapMarker *m_marker = nullptr;
        v3f m_position = v3f(0.0f, 10.0f * BS, 0);
        v3f m_velocity;
        v3f m_acceleration;
@@ -124,7 +126,14 @@ class GenericCAO : public ClientActiveObject
        float m_step_distance_counter = 0.0f;
        u8 m_last_light = 255;
        bool m_is_visible = false;
+       bool m_force_visible = false;
        s8 m_glow = 0;
+       // Material
+       video::E_MATERIAL_TYPE m_material_type;
+       // Settings
+       bool m_enable_shaders = false;
+
+       bool visualExpiryRequired(const ObjectProperties &newprops) const;
 
 public:
        GenericCAO(Client *client, ClientEnvironment *env);
@@ -154,18 +163,20 @@ class GenericCAO : public ClientActiveObject
 
        virtual bool getSelectionBox(aabb3f *toset) const;
 
-       v3f getPosition();
+       const v3f getPosition() const;
 
-       inline const v3f &getRotation()
+       void setPosition(const v3f &pos)
        {
-               return m_rotation;
+               pos_translator.val_current = pos;
        }
 
+       inline const v3f &getRotation() const { return m_rotation; }
+
        const bool isImmortal();
 
-       scene::ISceneNode *getSceneNode();
+       scene::ISceneNode *getSceneNode() const;
 
-       scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode();
+       scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode() const;
 
        // m_matrixnode controls the position and rotation of the child node
        // for all scene nodes, as a workaround for an Irrlicht problem with
@@ -180,6 +191,13 @@ class GenericCAO : public ClientActiveObject
                return m_matrixnode->getRelativeTransformationMatrix();
        }
 
+       inline const core::matrix4 *getAbsolutePosRotMatrix() const
+       {
+               if (!m_matrixnode)
+                       return nullptr;
+               return &m_matrixnode->getAbsoluteTransformation();
+       }
+
        inline f32 getStepHeight() const
        {
                return m_prop.stepheight;
@@ -200,6 +218,11 @@ class GenericCAO : public ClientActiveObject
                m_is_visible = toset;
        }
 
+       inline bool isForcedVisible() const
+       {
+               return m_force_visible;
+       }
+
        void setChildrenVisible(bool toset);
        void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation);
        void getAttachment(int *parent_id, std::string *bone, v3f *position,
@@ -222,11 +245,18 @@ class GenericCAO : public ClientActiveObject
                m_visuals_expired = true;
        }
 
-       void updateLight(u8 light_at_pos);
+       void updateLight(u32 day_night_ratio);
+
+       void setNodeLight(u8 light);
 
-       void updateLightNoCheck(u8 light_at_pos);
+       /* Get light position(s).
+        * returns number of positions written into pos[], which must have space
+        * for at least 3 vectors. */
+       u16 getLightPosition(v3s16 *pos);
 
-       v3s16 getLightPosition();
+       void updateNametag();
+
+       void updateMarker();
 
        void updateNodePos();
 
@@ -255,4 +285,6 @@ class GenericCAO : public ClientActiveObject
        {
                return m_prop.infotext;
        }
+
+       void updateMeshCulling();
 };