aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2012-10-26 18:03:24 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 18:14:15 +0200
commit118285e6babd511c285780b07c275d527d7da9b1 (patch)
tree7a0419626d8ac7fe26d50f851a041a581bd00dcb /src/content_sao.cpp
parentba4d93027f7b1590f303eff2138cae413faf5c34 (diff)
downloaddragonfireclient-118285e6babd511c285780b07c275d527d7da9b1.tar.xz
Get the new animation framework properly working
Store start and end frames as v2f Also move bone animations to their own function instead of object properties
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 9aeb88e71..bb38fa10e 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -644,6 +644,22 @@ void LuaEntitySAO::setArmorGroups(const ItemGroupList &armor_groups)
m_armor_groups_sent = false;
}
+void LuaEntitySAO::setAnimations(v2f frames, float frame_speed, float frame_blend)
+{
+ std::string str = gob_cmd_set_animations(frames, frame_speed, frame_blend);
+ // create message and add to list
+ ActiveObjectMessage aom(getId(), true, str);
+ m_messages_out.push_back(aom);
+}
+
+void LuaEntitySAO::setBonePosRot(std::string bone, v3f position, v3f rotation)
+{
+ std::string str = gob_cmd_set_bone_posrot(bone, position, rotation);
+ // create message and add to list
+ ActiveObjectMessage aom(getId(), true, str);
+ m_messages_out.push_back(aom);
+}
+
ObjectProperties* LuaEntitySAO::accessObjectProperties()
{
return &m_prop;
@@ -706,14 +722,6 @@ void LuaEntitySAO::setSprite(v2s16 p, int num_frames, float framelength,
m_messages_out.push_back(aom);
}
-void LuaEntitySAO::setAnimations(int frame_start, int frame_end, float frame_speed, float frame_blend)
-{
- std::string str = gob_cmd_set_animations(frame_start, frame_end, frame_speed, frame_blend);
- // create message and add to list
- ActiveObjectMessage aom(getId(), true, str);
- m_messages_out.push_back(aom);
-}
-
std::string LuaEntitySAO::getName()
{
return m_init_name;
@@ -1085,6 +1093,22 @@ void PlayerSAO::setArmorGroups(const ItemGroupList &armor_groups)
m_armor_groups_sent = false;
}
+void PlayerSAO::setAnimations(v2f frames, float frame_speed, float frame_blend)
+{
+ std::string str = gob_cmd_set_animations(frames, frame_speed, frame_blend);
+ // create message and add to list
+ ActiveObjectMessage aom(getId(), true, str);
+ m_messages_out.push_back(aom);
+}
+
+void PlayerSAO::setBonePosRot(std::string bone, v3f position, v3f rotation)
+{
+ std::string str = gob_cmd_set_bone_posrot(bone, position, rotation);
+ // create message and add to list
+ ActiveObjectMessage aom(getId(), true, str);
+ m_messages_out.push_back(aom);
+}
+
ObjectProperties* PlayerSAO::accessObjectProperties()
{
return &m_prop;