public void Execute(int i_arrayIndex)
            {
                Entity octreeBoundsEntity = a_collisionChecksEntities [i_arrayIndex];


                // Its value should be 0, if no collision is detected.
                // And >= 1, if instance collision is detected, or there is more than one collision,
                // indicating number of collisions.
                IsCollidingData isCollidingData = a_isCollidingData [octreeBoundsEntity];
                // Stores reference to detected colliding instance.
                DynamicBuffer <CollisionInstancesBufferElement> a_collisionInstancesBuffer = collisionInstancesBufferElement [octreeBoundsEntity];

                isCollidingData.i_collisionsCount = 0;                    // Reset colliding instances counter.
                // isCollidingData.i_nearestInstanceCollisionIndex  = 0 ; // Unused
                // isCollidingData.f_nearestDistance                = float.PositiveInfinity ; // Unused



                OctreeEntityPair4CollisionData octreeEntityPair4CollisionData = a_octreeEntityPair4CollisionData [octreeBoundsEntity];
                BoundsData checkBounds = a_boundsData [octreeBoundsEntity];


                // Octree entity pair, for collision checks

                Entity octreeRootNodeEntity = octreeEntityPair4CollisionData.octree2CheckEntity;

                // Is target octree active
                if (a_isActiveTag.Exists(octreeRootNodeEntity))
                {
                    RootNodeData octreeRootNodeData = a_octreeRootNodeData [octreeRootNodeEntity];

                    DynamicBuffer <NodeBufferElement> a_nodesBuffer = nodeBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <NodeInstancesIndexBufferElement> a_nodeInstancesIndexBuffer = nodeInstancesIndexBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <NodeChildrenBufferElement>       a_nodeChildrenBuffer       = nodeChildrenBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <InstanceBufferElement>           a_instanceBuffer           = instanceBufferElement [octreeRootNodeEntity];


                    // To even allow instances collision checks, octree must have at least one instance.
                    if (octreeRootNodeData.i_totalInstancesCountInTree > 0)
                    {
                        if (GetCollidingBoundsInstances_Common._GetNodeColliding(octreeRootNodeData, octreeRootNodeData.i_rootNodeIndex, checkBounds.bounds, ref a_collisionInstancesBuffer, ref isCollidingData, a_nodesBuffer, a_nodeChildrenBuffer, a_nodeInstancesIndexBuffer, a_instanceBuffer))
                        {
                            /*
                             * // Debug
                             * Debug.Log ( "Is colliding." ) ;
                             */
                        }
                    }
                }

                a_isCollidingData [octreeBoundsEntity] = isCollidingData;  // Set back.
            }
            public void Execute(int i_arrayIndex)
            {
                Entity octreeRayEntity = a_collisionChecksEntities [i_arrayIndex];


                // Its value should be 0, if no collision is detected.
                // And >= 1, if instance collision is detected, or there is more than one collision,
                // indicating number of collisions.
                IsCollidingData isCollidingData = a_isCollidingData [octreeRayEntity];
                // Stores reference to detected colliding instance.
                DynamicBuffer <CollisionInstancesBufferElement> a_collisionInstancesBuffer = collisionInstancesBufferElement [octreeRayEntity];


                isCollidingData.i_nearestInstanceCollisionIndex = 0;
                isCollidingData.f_nearestDistance = float.PositiveInfinity;

                isCollidingData.i_collisionsCount = 0;                // Reset colliding instances counter.


                OctreeEntityPair4CollisionData octreeEntityPair4CollisionData = a_octreeEntityPair4CollisionData [octreeRayEntity];
                RayData            rayData            = a_rayData [octreeRayEntity];
                RayMaxDistanceData rayMaxDistanceData = a_rayMaxDistanceData [octreeRayEntity];


                // Octree entity pair, for collision checks

                Entity octreeRootNodeEntity = octreeEntityPair4CollisionData.octree2CheckEntity;

                // Is target octree active
                if (a_isActiveTag.Exists(octreeRootNodeEntity))
                {
                    RootNodeData octreeRootNodeData = a_octreeRootNodeData [octreeRootNodeEntity];

                    DynamicBuffer <NodeBufferElement> a_nodesBuffer = nodeBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <NodeInstancesIndexBufferElement> a_nodeInstancesIndexBuffer = nodeInstancesIndexBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <NodeChildrenBufferElement>       a_nodeChildrenBuffer       = nodeChildrenBufferElement [octreeRootNodeEntity];
                    DynamicBuffer <InstanceBufferElement>           a_instanceBuffer           = instanceBufferElement [octreeRootNodeEntity];



                    // To even allow instances collision checks, octree must have at least one instance.
                    if (octreeRootNodeData.i_totalInstancesCountInTree > 0)
                    {
                        if (GetCollidingRayInstances_Common._GetNodeColliding(octreeRootNodeData, octreeRootNodeData.i_rootNodeIndex, rayData.ray, ref a_collisionInstancesBuffer, ref isCollidingData, a_nodesBuffer, a_nodeChildrenBuffer, a_nodeInstancesIndexBuffer, a_instanceBuffer, rayMaxDistanceData.f))
                        {
                            /*
                             * // Debug
                             * string s_collidingIDs = "" ;
                             * int i_collisionsCount = isCollidingData.i_collisionsCount ;
                             *
                             * for ( int i = 0; i < i_collisionsCount; i ++ )
                             * {
                             *  CollisionInstancesBufferElement collisionInstancesBuffer = a_collisionInstancesBuffer [i] ;
                             *  s_collidingIDs += collisionInstancesBuffer.i_ID + ", " ;
                             * }
                             *
                             * Debug.Log ( "Is colliding with #" + i_collisionsCount + " instances of IDs: " + s_collidingIDs + "; Nearest collided instance is at " + isCollidingData.f_nearestDistance + "m, with index #" + isCollidingData.i_nearestInstanceCollisionIndex ) ;
                             */
                        }
                    }
                }

                a_isCollidingData [octreeRayEntity] = isCollidingData;  // Set back.
            }