/// <summary> /// Creates a new V2Renderer and starts all the threads /// </summary> /// <param name="minNodeSize">Minimum Node Size</param> /// <param name="pointBudget">Point Budget</param> /// <param name="nodesLoadedPerFrame">Maximum number of nodes loaded per frame</param> /// <param name="nodesGOsperFrame">Maximum number of nodes for which GameObjects should be created per frame</param> /// <param name="camera">User Camera</param> /// <param name="config">MeshConfiguration, defining how the points should be rendered</param> /// <param name="cacheSize">Size of cache in points</param> public V2Renderer(int minNodeSize, uint pointBudget, uint nodesLoadedPerFrame, uint nodesGOsperFrame, Camera camera, MeshConfiguration config, uint cacheSize) { rootNodes = new List <Node>(); this.camera = camera; this.config = config; cache = new V2Cache(cacheSize); loadingThread = new V2LoadingThread(cache); loadingThread.Start(); traversalThread = new V2TraversalThread(this, loadingThread, rootNodes, minNodeSize, pointBudget, nodesLoadedPerFrame, nodesGOsperFrame, cache); traversalThread.Start(); }
/// <summary> /// Creates the object, but does not start the thread yet /// </summary> public V2TraversalThread(V2Renderer mainThread, V2LoadingThread loadingThread, List <Node> rootNodes, double minNodeSize, uint pointBudget, uint nodesLoadedPerFrame, uint nodesGOsPerFrame, V2Cache cache) { this.mainThread = mainThread; this.loadingThread = loadingThread; this.rootNodes = rootNodes; this.minNodeSize = minNodeSize; this.pointBudget = pointBudget; visibleNodes = new HashSet <Node>(); this.cache = cache; this.nodesLoadedPerFrame = nodesLoadedPerFrame; this.nodesGOsPerFrame = nodesGOsPerFrame; }
/// <summary> /// Creates a new V2Renderer and starts all the threads /// </summary> /// <param name="minNodeSize">Minimum Node Size</param> /// <param name="pointBudget">Point Budget</param> /// <param name="nodesLoadedPerFrame">Maximum number of nodes loaded per frame</param> /// <param name="nodesGOsperFrame">Maximum number of nodes for which GameObjects should be created per frame</param> /// <param name="camera">User Camera</param> /// <param name="config">MeshConfiguration, defining how the points should be rendered</param> /// <param name="cacheSize">Size of cache in points</param> public V2Renderer(int minNodeSize, uint pointBudget, uint nodesLoadedPerFrame, uint nodesGOsperFrame, Camera camera, MeshConfiguration config, uint cacheSize) { rootNodes = new List <Node>(); holders = GameObject.FindGameObjectWithTag("MeshConfig").GetComponent <GeoQuadMeshConfiguration>().holders; this.camera = camera; this.config = config; cache = new V2Cache(cacheSize); loadingThread = new V2LoadingThread(cache, holders); loadingThread.Start(); traversalThread = new V2TraversalThread(this, loadingThread, rootNodes, minNodeSize, pointBudget, nodesLoadedPerFrame, nodesGOsperFrame, cache); traversalThread.Start(); }
public V2LoadingThread(V2Cache cache) { loadingQueue = new ThreadSafeQueue <Node>(); this.cache = cache; }
public V2LoadingThread(V2Cache cache, List <GameObject> container) { loadingQueue = new ThreadSafeQueue <Node>(); this.cache = cache; holders = container; }