示例#1
0
    //=============================================================================================================================================
    //Draw all the OBBs and the max extents of this Octree
    //=============================================================================================================================================
    void OnDrawGizmos()
    {
        if (Octree.All_OBBs != null)
        {
            Gizmos.color = Color.green;
            for (int i = 0; i < Octree.All_OBBs.Count; ++i)
            {
                Baked_Octree.Draw_OBB(Octree.All_OBBs[i]);
            }
        }

        //Draw the maximum extent of the Octree even if there is no octree
        Gizmos.color = Color.grey;
        Gizmos.DrawWireCube(transform.position, new Vector3(VoxelSize * 2, VoxelSize * 2, VoxelSize * 2));
    }
    public KeyCode DebugNodes   = KeyCode.M;     //Toggel drawing Nodes

    // Use this for initialization
    void Start()
    {
        VoxelGrid = GetComponent <Particle_Flowing>().octree;
    }