From 82a460ec90b4537926f31603219504bce8817ac2 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 27 Nov 2011 04:31:05 +0200 Subject: Improve luaentity sprite functionality (and add some random stuff) --- src/content_sao.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 74824d573..b013069aa 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1748,6 +1748,11 @@ void LuaEntitySAO::setAcceleration(v3f acceleration) m_acceleration = acceleration; } +v3f LuaEntitySAO::getAcceleration() +{ + return m_acceleration; +} + void LuaEntitySAO::setTextureMod(const std::string &mod) { std::ostringstream os(std::ios::binary); @@ -1760,6 +1765,22 @@ void LuaEntitySAO::setTextureMod(const std::string &mod) m_messages_out.push_back(aom); } +void LuaEntitySAO::setSprite(v2s16 p, int num_frames, float framelength, + bool select_horiz_by_yawpitch) +{ + std::ostringstream os(std::ios::binary); + // command (2 = set sprite) + writeU8(os, 2); + // parameters + writeV2S16(os, p); + writeU16(os, num_frames); + writeF1000(os, framelength); + writeU8(os, select_horiz_by_yawpitch); + // create message and add to list + ActiveObjectMessage aom(getId(), false, os.str()); + m_messages_out.push_back(aom); +} + void LuaEntitySAO::sendPosition(bool do_interpolate, bool is_movement_end) { m_last_sent_move_precision = m_base_position.getDistanceFrom( -- cgit v1.2.3