public VimSceneNode GetVimNodeFromInstance(IntPtr p) { var index = InstanceToNodeIndex.GetOrDefault(p, -1); if (index <= 0) { return(null); } return(Vim.VimNodes[index]); }
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(); }