private ViewChunk[] GetVisible(Point observerPoint)
 {
     return(space
            .GetChunksWithin(observerPoint, clipDistace)
            .Select(chunk => new ViewChunk(chunk, visibleLod, tangibleLod))
            .ToArray());
 }
    public FixedViewer(ChunkedSpace space, Vector3 origin, float distace, MeshLod?visibleLod = null)
    {
        Point originPoint = space.GetPointFromPosition(origin);

        Chunk[] chunks = space.GetChunksWithin(originPoint, distace);
        view = chunks
               .Select(chunk => new ViewChunk(chunk, visibleLod ?? new MeshLod(0)))
               .ToArray();
    }
    private ViewChunk[] GetVisible(Point observerPoint)
    {
        float furthestVisiblePlane   = visibilityLodPlanes.Last().Value;
        float furthestCollisionPlane = collisionLodPlanes.Last().Value;
        float furthestPlane          = Mathf.Max(furthestVisiblePlane, furthestCollisionPlane);

        Chunk[] chunks = space.GetChunksWithin(observerPoint, furthestPlane);
        return(chunks
               .Select(chunk => {
            MeshLod lod = GetMaxLod(visibilityLodPlanes, chunk);
            MeshLod colliderLod = GetMaxLod(collisionLodPlanes, chunk);
            return new ViewChunk(chunk, lod, colliderLod);
        })
               .ToArray());
    }
Esempio n. 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());
    }