aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-15 12:17:21 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-15 12:17:21 +0300
commit5341bf59c20c770ab50b80d6b336b47ed509f8d8 (patch)
treedeb77dc90ab68027a8f840096b1419292f110507 /src/content_cao.h
parent43a28f04fa3ddf4b612f58c25a896293a01567e3 (diff)
downloadminetest-5341bf59c20c770ab50b80d6b336b47ed509f8d8.tar.gz
minetest-5341bf59c20c770ab50b80d6b336b47ed509f8d8.tar.bz2
minetest-5341bf59c20c770ab50b80d6b336b47ed509f8d8.zip
Improve mobv2
Diffstat (limited to 'src/content_cao.h')
-rw-r--r--src/content_cao.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/content_cao.h b/src/content_cao.h
index e240d7392..a362b6be5 100644
--- a/src/content_cao.h
+++ b/src/content_cao.h
@@ -33,19 +33,19 @@ class Settings;
struct SmoothTranslator
{
v3f vect_old;
+ v3f vect_show;
+ v3f vect_aim;
f32 anim_counter;
f32 anim_time;
f32 anim_time_counter;
- v3f vect_show;
- v3f vect_aim;
SmoothTranslator():
vect_old(0,0,0),
+ vect_show(0,0,0),
+ vect_aim(0,0,0),
anim_counter(0),
anim_time(0),
- anim_time_counter(0),
- vect_show(0,0,0),
- vect_aim(0,0,0)
+ anim_time_counter(0)
{}
void init(v3f vect)
@@ -53,6 +53,14 @@ struct SmoothTranslator
vect_old = vect;
vect_show = vect;
vect_aim = vect;
+ anim_counter = 0;
+ anim_time = 0;
+ anim_time_counter = 0;
+ }
+
+ void sharpen()
+ {
+ init(vect_show);
}
void update(v3f vect_new)
@@ -329,11 +337,17 @@ public:
//{return m_position;}
bool doShowSelectionBox(){return false;}
+ // If returns true, punch will not be sent to the server
+ bool directReportPunch(const std::string &toolname, v3f dir);
+
private:
+ void setLooks(const std::string &looks);
+
IntervalLimiter m_attack_interval;
core::aabbox3d<f32> m_selection_box;
scene::MyBillboardSceneNode *m_node;
v3f m_position;
+ std::string m_texture_name;
float m_yaw;
SmoothTranslator pos_translator;
bool m_walking;
@@ -345,7 +359,7 @@ private:
bool m_shooting;
float m_shooting_unset_timer;
v2f m_sprite_size;
- v3f m_sprite_pos;
+ float m_sprite_y;
bool m_bright_shooting;
std::string m_sprite_type;
int m_simple_anim_frames;