Horde3D
http://horde3d.org/forums/

NodeHandles don't match [SOLVED]
http://horde3d.org/forums/viewtopic.php?f=2&t=759
Page 1 of 1

Author:  Siavash [ 29.05.2009, 02:46 ]
Post subject:  NodeHandles don't match [SOLVED]

I'm trying to generate the scene node names through the Lua then get the node handles from the Horde, something similar to this :
Code:
function Init ()
   scene = {}
   for i=1, 12 do
      scene[i]={}
      scene[i].handle=findNodeHandle(envRoot, 2, "item" .. i)
   end
end

Where findNodeHandle is :
Code:
   int findNodeHandle (lua_State *L)
   {
      int StartNode=luaL_checkint(L, 1);
      int SceneNodeType=luaL_checkint(L, 2);
      const char *NodeName=luaL_checkstring(L, 3);

      if (Horde3D::findNodes(StartNode, NodeName, SceneNodeType) == 1)
         lua_pushinteger(L, Horde3D::getNodeFindResult(0));
      else Error("unable to find the node");

      return 1;
   }

This piece of code works correctly and I'm happy with that, but when I'm trying to pick the scene items and send their node handles to the Lua, node handle returned from the Horde3DUtils::pickNode differs with the ones that they were found using findNodeHandle.

For ex: If the node handle returned from findNodeHandle is 68, node handle returned from the Horde3DUtils::pickNode is 69. And here is the relation of the node handles :
Code:
new node handles = old node handles + 1

Perhaps this is a bug or something similar.

Author:  Volker [ 29.05.2009, 06:33 ]
Post subject:  Re: NodeHandles don't match

Not sure what "item" stands for, but pickNode may return the Mesh Node of a model, while you are searching for a model node.

Author:  Siavash [ 29.05.2009, 07:53 ]
Post subject:  Re: NodeHandles don't match

Thanks for help, was searching for models [2]. Is it possible to name the meshes [3] through the Horde3D Editor to get the exact node handles?

Author:  Volker [ 29.05.2009, 08:07 ]
Post subject:  Re: NodeHandles don't match

You can change the name of the mesh nodes in the .scene.xml files. If you want to use your favorite text editor or the Horde3D Editor is up to you. Both is possible (but take note, that there is currently no stable editor version for Beta3)

Author:  Siavash [ 29.05.2009, 08:26 ]
Post subject:  Re: NodeHandles don't match

Thanks a lot dear Volker for help ^_^

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/