class Camera;
class Client;
struct Nametag;
+struct MinimapMarker;
/*
SmoothTranslator
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;
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);
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
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;
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,
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();
{
return m_prop.infotext;
}
+
+ void updateMeshCulling();
};