Beispiel #1
0
        public VimSceneNode GetVimNodeFromInstance(IntPtr p)
        {
            var index = InstanceToNodeIndex.GetOrDefault(p, -1);

            if (index <= 0)
            {
                return(null);
            }
            return(Vim.VimNodes[index]);
        }
Beispiel #2
0
        public VimHelper(IRenderApi api, VimScene vim)
        {
            (Vim, Api) = (vim, api);
            Api.Scene.GetNodeToInstanceTable(ref NodeIndices, ref Instances);
            Debug.Assert(NodeIndices.Length == Instances.Length);
            Flags = new bool[NodeIndices.Length];
            for (var i = 0; i < NodeIndices.Length; ++i)
            {
                NodeIndexToInstanceIndex.Add(NodeIndices[i], i);
                InstanceToNodeIndex.Add(Instances[i], NodeIndices[i]);
            }

            ElementIndexToSceneNode = Vim.GetElementIndexToSceneNodeMap();
        }