From e42eeec8f626acbaa54ae31c10ca06c868c7931c Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 27 Oct 2012 01:49:01 +0300 Subject: Framework for the attachment system, new object property which allows changing the color and alpha of mesh materials New object property which allows changing the color and alpha of mesh materials. Due to the current lighting systems it doesn't work yet, but the full implementation is there Framework for the attachment system, with no actual functionality yet Send bone and player object to the setAttachment function in content_sao.cpp, but we need a way to translate it there and send it to the client I will also want position and rotation offsets to be possible to apply to attachments Network object ID from server to client. This will be used to identify the parent client-side and know what to attach to --- src/content_sao.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index bb38fa10e..b23d287f4 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -504,6 +504,7 @@ std::string LuaEntitySAO::getClientInitializationData() std::ostringstream os(std::ios::binary); writeU8(os, 0); // version os<getName()); // name writeU8(os, 1); // is_player + writeS16(os, getId()); //id writeV3F1000(os, m_player->getPosition() + v3f(0,BS*1,0)); writeF1000(os, m_player->getYaw()); writeS16(os, getHP()); @@ -1109,6 +1126,15 @@ void PlayerSAO::setBonePosRot(std::string bone, v3f position, v3f rotation) m_messages_out.push_back(aom); } +// Part of the attachment structure, not used yet! +void PlayerSAO::setAttachment(ServerActiveObject *parent, std::string bone, v3f position, v3f rotation) +{ + std::string str = gob_cmd_set_attachment(); // <- parameters here + // create message and add to list + ActiveObjectMessage aom(getId(), true, str); + m_messages_out.push_back(aom); +} + ObjectProperties* PlayerSAO::accessObjectProperties() { return &m_prop; -- cgit v1.2.3