示例#1
0
文件: Engine.cs 项目: pirho/RaySharp
        public Engine()
        {
            _scene = new Scene();

            _mod = new int[64];
            _stack = new KdStackItem[64];
            for (int i = 0; i < 64; i++)
                _stack[i] = new KdStackItem();
        }
示例#2
0
文件: KdTree.cs 项目: pirho/RaySharp
        public void Build(Scene scene)
        {
            foreach (Primitive p in scene.Primitives) {
                Root.Add(p);
            }

            int prims = scene.Primitives.Count;
            AxisAlignedBox sBox = scene.Extends;
            _list = null;
            _sortedList = null;
            Subdivide(Root, sBox, 0, prims);
        }