Examples of ChunkView


Examples of org.terasology.world.ChunkView

        }

        @Override
        public void run() {
            ChunkMesh[] newMeshes = new ChunkMesh[WorldRendererLwjgl.VERTICAL_SEGMENTS];
            ChunkView chunkView = worldProvider.getLocalView(c.getPosition());
            if (chunkView != null) {
                c.setDirty(false);
                int meshHeight = ChunkConstants.SIZE_Y / WorldRendererLwjgl.VERTICAL_SEGMENTS;
                for (int seg = 0; seg < WorldRendererLwjgl.VERTICAL_SEGMENTS; seg++) {
                    newMeshes[seg] = tessellator.generateMesh(chunkView, meshHeight, seg * (ChunkConstants.SIZE_Y / WorldRendererLwjgl.VERTICAL_SEGMENTS));
View Full Code Here

Examples of org.terasology.world.ChunkView

        for (Vector3i pos : Region3i.createFromCenterExtents(newChunkPos, new Vector3i(viewingDistance.x / 2, viewingDistance.y / 2, viewingDistance.z / 2))) {
            RenderableChunk chunk = chunkProvider.getChunk(pos);
            if (chunk == null) {
                complete = false;
            } else if (chunk.isDirty()) {
                ChunkView view = worldProvider.getLocalView(chunk.getPosition());
                if (view == null) {
                    continue;
                }
                chunk.setDirty(false);
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

    // NB lock the lock ordering here is critical!
    // we access ChunkMap via Chunky but here we also need to lock Chunky
    synchronized (chunky) {
    synchronized (this) {
      ChunkView mapView = chunky.getMapView();

      WorldRenderer renderer = chunky.getWorldRenderer();
      World world = chunky.getWorld();
      ChunkSelectionTracker selection = chunky.getChunkSelection();
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

      Graphics g = buffer.getGraphics();
      renderEmpty(g, width, height);
      return;
    }

    ChunkView view = buffer.getView();

    for (ChunkPosition pos: buffer) {
      int x = pos.x;
      int z = pos.z;
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

      Graphics g, MapBuffer renderBuffer) {

    boolean loadIndicator = chunky.isLoading();
    Chunk.Renderer renderer = chunky.getChunkRenderer();

    ChunkView view = renderBuffer.getView();

    if (loadIndicator) {
      g.drawImage(MiscImages.clock, view.width-32, 0, 32, 32, null);
    }
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

   * @param cx
   * @param cz
   */
  @Override
  final public void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, getAvgColor());
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

      if (!selectRect) {
        if (!dragging) {
          int x = e.getX();
          int y = e.getY();
          ChunkView theView = chunky.getMapView();
          double scale = theView.scale;
          int cx = (int) QuickMath.floor(theView.x + (x - getWidth()/2) / scale);
          int cz = (int) QuickMath.floor(theView.z + (y - getHeight()/2) / scale);

          if (theView.scale >= 16) {
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

        repaint();
      }
    }

    private ChunkPosition getChunk(MouseEvent e) {
      ChunkView theView = view;
      double scale = theView.scale;
      double x = theView.x + (e.getX() - getWidth()/2) / scale;
      double z = theView.z + (e.getY() - getHeight()/2) / scale;
      int cx = (int) QuickMath.floor(x);
      int cz = (int) QuickMath.floor(z);
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

   * @param cx
   * @param cz
   */
  @Override
  public synchronized void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, getAvgColor());
View Full Code Here

Examples of se.llbit.chunky.world.ChunkView

   */
  @Override
  public synchronized void renderHighlight(MapBuffer rbuff, int cx, int cz,
      Block hlBlock, java.awt.Color highlight) {

    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (blocks == null)
      return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.