Exemple #1
0
 public ZoomLevelViewer(ChunkedSpace space, Transform observer, float ratio = 1f)
 {
     this.space         = space;
     this.observer      = observer;
     this.ratio         = ratio;
     this.updateDistace = space.GetChunkScale() / 10f;
 }
 public FalloffViewer(
     ChunkedSpace space,
     Transform observer,
     SortedList <MeshLod, float> visibilityLodPlanes = null,
     SortedList <MeshLod, float> collisionLodPlanes  = null
     )
 {
     this.space               = space;
     this.observer            = observer;
     this.visibilityLodPlanes = visibilityLodPlanes ?? GetDefaultVisibilityLodPlanes();
     this.collisionLodPlanes  = collisionLodPlanes ?? GetDefaultCollisionLodPlanes();
     this.updateDistace       = space.GetChunkScale() / 10f;
 }
 public CutoffViewer(
     ChunkedSpace space,
     Transform observer,
     float clipDistace,
     MeshLod?visibleLod  = null,
     MeshLod?tangibleLod = null
     )
 {
     this.space         = space;
     this.observer      = observer;
     this.clipDistace   = clipDistace;
     this.visibleLod    = visibleLod ?? new MeshLod(0);
     this.tangibleLod   = tangibleLod;
     this.updateDistace = space.GetChunkScale() / 10f;
 }
Exemple #4
0
    private ViewChunk[] GetVisible(Point observerPoint)
    {
        Vector3 pointOnGround = observerPoint.GetPosition();
        float   distanceFromObserverToGround = Vector3.Distance(
            observer.position,
            pointOnGround
            );
        float   clipRadius = ratio * distanceFromObserverToGround;
        MeshLod visibleLod = GetLod(space.GetChunkScale(), clipRadius);

        return(space
               .GetChunksWithin(observerPoint, clipRadius)
               .Select(chunk => new ViewChunk(chunk, visibleLod))
               .ToArray());
    }