summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorTeTpaAka <TeTpaAka@users.noreply.github.com>2015-05-26 14:10:08 +0200
committerest31 <MTest31@outlook.com>2015-05-28 16:46:35 +0200
commitc0335f7d13ee46c6a46d0ceebea96960439ec9fd (patch)
tree20183ec9aac1dd1dfdd6f193430fb331268b92b0 /src/content_sao.cpp
parent990a96578f20244626b6b9f67f8e79a7e2e614ea (diff)
downloadminetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.tar.gz
minetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.tar.bz2
minetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.zip
Add some missing getter functions to the lua API
ObjectRef: get_properties get_armor_groups get_animation get_attach get_bone_position Players: get_physics_override hud_get_hotbar_itemcount hud_get_hotbar_image hud_get_hotbar_selected_image get_sky get_day_night_ratio get_local_animation get_eye_offset Global: minetest.get_gen_notify minetest.get_noiseparams
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index b644bdff7..1a0fce0bb 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -533,6 +533,11 @@ void LuaEntitySAO::setArmorGroups(const ItemGroupList &armor_groups)
m_armor_groups_sent = false;
}
+ItemGroupList LuaEntitySAO::getArmorGroups()
+{
+ return m_armor_groups;
+}
+
void LuaEntitySAO::setAnimation(v2f frame_range, float frame_speed, float frame_blend)
{
m_animation_range = frame_range;
@@ -541,12 +546,25 @@ void LuaEntitySAO::setAnimation(v2f frame_range, float frame_speed, float frame_
m_animation_sent = false;
}
+void LuaEntitySAO::getAnimation(v2f *frame_range, float *frame_speed, float *frame_blend)
+{
+ *frame_range = m_animation_range;
+ *frame_speed = m_animation_speed;
+ *frame_blend = m_animation_blend;
+}
+
void LuaEntitySAO::setBonePosition(const std::string &bone, v3f position, v3f rotation)
{
m_bone_position[bone] = core::vector2d<v3f>(position, rotation);
m_bone_position_sent = false;
}
+void LuaEntitySAO::getBonePosition(const std::string &bone, v3f *position, v3f *rotation)
+{
+ *position = m_bone_position[bone].X;
+ *rotation = m_bone_position[bone].Y;
+}
+
void LuaEntitySAO::setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation)
{
// Attachments need to be handled on both the server and client.
@@ -564,6 +582,15 @@ void LuaEntitySAO::setAttachment(int parent_id, const std::string &bone, v3f pos
m_attachment_sent = false;
}
+void LuaEntitySAO::getAttachment(int *parent_id, std::string *bone, v3f *position,
+ v3f *rotation)
+{
+ *parent_id = m_attachment_parent_id;
+ *bone = m_attachment_bone;
+ *position = m_attachment_position;
+ *rotation = m_attachment_rotation;
+}
+
ObjectProperties* LuaEntitySAO::accessObjectProperties()
{
return &m_prop;
@@ -1133,6 +1160,11 @@ void PlayerSAO::setArmorGroups(const ItemGroupList &armor_groups)
m_armor_groups_sent = false;
}
+ItemGroupList PlayerSAO::getArmorGroups()
+{
+ return m_armor_groups;
+}
+
void PlayerSAO::setAnimation(v2f frame_range, float frame_speed, float frame_blend)
{
// store these so they can be updated to clients
@@ -1142,6 +1174,13 @@ void PlayerSAO::setAnimation(v2f frame_range, float frame_speed, float frame_ble
m_animation_sent = false;
}
+void PlayerSAO::getAnimation(v2f *frame_range, float *frame_speed, float *frame_blend)
+{
+ *frame_range = m_animation_range;
+ *frame_speed = m_animation_speed;
+ *frame_blend = m_animation_blend;
+}
+
void PlayerSAO::setBonePosition(const std::string &bone, v3f position, v3f rotation)
{
// store these so they can be updated to clients
@@ -1149,6 +1188,12 @@ void PlayerSAO::setBonePosition(const std::string &bone, v3f position, v3f rotat
m_bone_position_sent = false;
}
+void PlayerSAO::getBonePosition(const std::string &bone, v3f *position, v3f *rotation)
+{
+ *position = m_bone_position[bone].X;
+ *rotation = m_bone_position[bone].Y;
+}
+
void PlayerSAO::setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation)
{
// Attachments need to be handled on both the server and client.
@@ -1166,6 +1211,15 @@ void PlayerSAO::setAttachment(int parent_id, const std::string &bone, v3f positi
m_attachment_sent = false;
}
+void PlayerSAO::getAttachment(int *parent_id, std::string *bone, v3f *position,
+ v3f *rotation)
+{
+ *parent_id = m_attachment_parent_id;
+ *bone = m_attachment_bone;
+ *position = m_attachment_position;
+ *rotation = m_attachment_rotation;
+}
+
ObjectProperties* PlayerSAO::accessObjectProperties()
{
return &m_prop;