Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- namespace Assets.Scripts._CoreLibaryCode
- {
- public class OctreeComponent : MonoBehaviour
- {
- public float size = 1;
- public int depth = 1;
- private void Update()
- {
- if (Input.GetMouseButtonDown(0))
- {
- var octree = new Octree<GameObject>(gameObject.transform.position, size, depth);
- VoxelizeObject(octree.GetRoot());
- }
- }
- void VoxelizeObject(Octree<GameObject>.OctreeNode<GameObject> node, int nodeDepth = 0)
- {
- if (!node.IsLeaf())
- {
- // Looping code goes here for activating pool of voxels
- // DrawCall(subnode, nodeDepth + 1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement