1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
MirceaKitsune 2012-10-27 15:14:24 +03:00 committed by Perttu Ahola
parent e42eeec8f6
commit 948b5a8be7
6 changed files with 270 additions and 152 deletions

View file

@ -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;