From 948b5a8be7b13a346c873c157567a72b4e7e320a Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 27 Oct 2012 15:14:24 +0300 Subject: Complete the attachment framework. The child ID can now be checked against the parent ID in content_cao.cpp so the parent can be detected. Actual attachment code to come Divide attachment system between server attachments and client attachments, neither coded right now. As explained in the code comment: // Attachments need to be handled on both the server and client. // If we attach only on the server, models (which are client-side) // can't be read so we don't know the origin and orientation of bones. // If we attach only on the client, the real position of attachments is // not updated and you can't click them for example. --- src/scriptapi.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 9c5bbcc5b..3c505c881 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -2737,7 +2737,7 @@ private: return 0; } - // setboneposrot(std::string bone, v3f position, v3f rotation) + // setboneposrot(self, std::string bone, v3f position, v3f rotation) static int l_set_bone_posrot(lua_State *L) { ObjectRef *ref = checkobject(L, 1); @@ -2758,8 +2758,7 @@ private: return 0; } -// Part of the attachment structure, not used yet! - // set_attachment() // <- parameters here + // set_attachment(self, parent, bone, position, rotation) static int l_set_attachment(lua_State *L) { ObjectRef *ref = checkobject(L, 1); @@ -2778,8 +2777,6 @@ private: if(!lua_isnil(L, 5)) rotation = read_v3f(L, 5); // Do it - -//lua_pushnumber(L, cobj->getId()); // Push id co->setAttachment(parent, bone, position, rotation); return 0; -- cgit v1.2.3