Examples of Terrain


Examples of com.jme3.terrain.Terrain

    @Override
    public Material getMaterial(Vector3f worldLocation) {
        if (worldLocation == null)
            return null;
        Vector3f tileCell = getTileCell(worldLocation);
        Terrain terrain = cache.get(tileCell);
        if (terrain == null)
            return null; // terrain not loaded for that cell yet!
        return terrain.getMaterial(worldLocation);
    }
View Full Code Here

Examples of ds.moteur.Terrain

 
  public void paint(Graphics g){
    super.paint(g);
    Graphics2D g2d = (Graphics2D)g;
    if (scene != null){
      Terrain terrain = scene.getTerrain();
      for (Section section : terrain.getSections()){
        paintFrontiere(g2d, section.getFrontiere().getSommets());
        for (CourbeConduite cc : section.getCourbesConduites()){
          paintCourbe(g2d, cc);
        }
        for (PointEntree entree : section.getEntrees()){
View Full Code Here

Examples of game.entities.Terrain

            }
        } catch( Exception e) {e.printStackTrace();}

          for( int row = 0; row < currLevel.length; row++ ) {
            for( int col = 0; col < currLevel[row].length; col++ ) {
              map[row][col] = new Terrain(
                col*GameSettings.BLOCK_SIZE,
                row*GameSettings.BLOCK_SIZE,
                GameSettings.BLOCK_SIZE,
                GameSettings.BLOCK_SIZE,
                TerrainType.getType(currLevel[row][col]));
View Full Code Here

Examples of game.entities.Terrain

     
      return rowAndCol;
    }
   
    public void drawMap(Graphics2D g) {
      Terrain t;
      for( int row = 0; row < map.length; row++ ) {
        for( int col = 0; col < map[row].length; col++ ) {
          t = map[row][col];
          g.setColor(t.color);
          g.fillRect(col*GameSettings.BLOCK_SIZE,
View Full Code Here

Examples of gov.nasa.worldwind.terrain.Terrain

    }

    @Override
    protected void _assembleVertexControlPoints_(DrawContext dc)
    {
        Terrain terrain = dc.getTerrain();
        Path pol = (Path) super._pol_;

        Position refPos = pol.getReferencePosition();
        Vec4 refPoint = terrain.getSurfacePoint(refPos.getLatitude(), refPos.getLongitude(), 0);

        int altitudeMode = pol.getAltitudeMode();
        double height = 1000; // pol.getHeight();

        Vec4 vaa = null;
        double vaaLength = 0; // used to compute independent length of each cap vertex
        double vaLength = 0;

        int i = 0;
       
        for (LatLon location : pol.getPositions())
        {
            Vec4 vert;

            // Compute the top/cap point.
            if (altitudeMode == WorldWind.CONSTANT || !(location instanceof Position))
            {
                if (vaa == null)
                {
                    // Compute the vector lengths of the top and bottom points at the reference position.
                    vaa = refPoint.multiply3(height / refPoint.getLength3());
                    vaaLength = vaa.getLength3();
                    vaLength = refPoint.getLength3();
                }

                // Compute the bottom point, which is on the terrain.
                vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(), 0);

                double delta = vaLength - vert.dot3(refPoint) / vaLength;
                vert = vert.add3(vaa.multiply3(1d + delta / vaaLength));
            }
            else if (altitudeMode == WorldWind.RELATIVE_TO_GROUND)
            {
                vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(),
                    ((Position) location).getAltitude());
            }
            else // WorldWind.ABSOLUTE
            {
                vert = terrain.getGlobe().computePointFromPosition(location.getLatitude(), location.getLongitude(),
                    ((Position) location).getAltitude() * terrain.getVerticalExaggeration());
            }

            Position vertexPosition = super._wwd.getModel().getGlobe().computePositionFromPoint(vert);
           
            GfrMrkMoveHoriz pnt = new GfrMrkMoveHoriz(vertexPosition, vert,
View Full Code Here

Examples of gov.nasa.worldwind.terrain.Terrain

    }

    @Override
    protected void _assembleVertexControlPoints_(DrawContext dc)
    {
        Terrain terrain = dc.getTerrain();
        ExtrudedPolygon pol = (ExtrudedPolygon) super._pol_;

        Position refPos = pol.getReferencePosition();
        Vec4 refPoint = terrain.getSurfacePoint(refPos.getLatitude(), refPos.getLongitude(), 0);

        int altitudeMode = pol.getAltitudeMode();
        double height = pol.getHeight();

        Vec4 vaa = null;
        double vaaLength = 0; // used to compute independent length of each cap vertex
        double vaLength = 0;

        int i = 0;
        for (LatLon location : pol.getOuterBoundary())
        {
            Vec4 vert;

            // Compute the top/cap point.
            if (altitudeMode == WorldWind.CONSTANT || !(location instanceof Position))
            {
                if (vaa == null)
                {
                    // Compute the vector lengths of the top and bottom points at the reference position.
                    vaa = refPoint.multiply3(height / refPoint.getLength3());
                    vaaLength = vaa.getLength3();
                    vaLength = refPoint.getLength3();
                }

                // Compute the bottom point, which is on the terrain.
                vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(), 0);

                double delta = vaLength - vert.dot3(refPoint) / vaLength;
                vert = vert.add3(vaa.multiply3(1d + delta / vaaLength));
            }
            else if (altitudeMode == WorldWind.RELATIVE_TO_GROUND)
            {
                vert = terrain.getSurfacePoint(location.getLatitude(), location.getLongitude(),
                    ((Position) location).getAltitude());
            }
            else // WorldWind.ABSOLUTE
            {
                vert = terrain.getGlobe().computePointFromPosition(location.getLatitude(), location.getLongitude(),
                    ((Position) location).getAltitude() * terrain.getVerticalExaggeration());
            }

            Position vertexPosition = super._wwd.getModel().getGlobe().computePositionFromPoint(vert);
          
           
View Full Code Here

Examples of gov.nasa.worldwind.terrain.Terrain

    {
        try
        {
            // Compute the intersection using whatever terrain is available. This calculation does not need to be very
            // precise, it just needs to place the balloon close to the shape.
            Terrain terrain = this.wwd.getSceneController().getDrawContext().getTerrain();

            // Compute a line through the pick point.
            Line line = this.wwd.getView().computeRayFromScreenPoint(screenPoint.x, screenPoint.y);

            // Find the intersection of the line and the shape.
View Full Code Here

Examples of gov.nasa.worldwind.terrain.Terrain

         buffer = Buffers.newDirectFloatBuffer(FLOATS_PER_ARROWHEAD * numPositions);
      pathData.setValue(ARROWS_KEY, buffer);

      buffer.clear();

      Terrain terrain = dc.getTerrain();

      double arrowBase = this.getArrowLength() * this.getArrowAngle().tanHalfAngle();

      // Step through polePositions to find the original path locations.
      int thisPole = polePositions.get(0) / 2;
View Full Code Here

Examples of graphics.model.terrain.Terrain

  @Override
  public void init() {
    setClearColor(new Vector3f(1.0f, 0.866f, 0.698f));
   
    map = new Map();
    terrain = new Terrain(Map.mapWidth*10, Map.mapHeight*10);
    terrain.setPosition(0, -0.137f,0);
   
    gameCameraMultipliers = new Vector2f((float) (-Math.PI/4.0), 3f);

    passengerTimer = elapsedAppTime();
View Full Code Here

Examples of megamek.common.Terrain

                    if ((damageAtRange >= 3000) && (myHex.containsTerrain(Terrains.WATER))) {
                        int numCleared = damageAtRange / 3000;
                        int oldLevel = myHex.terrainLevel(Terrains.WATER);
                        myHex.removeTerrain(Terrains.WATER);
                        if (oldLevel > numCleared) {
                            myHex.addTerrain(new Terrain(Terrains.WATER, oldLevel - numCleared));
                        }
                    }

                    // ANY non-water hex that takes 200 becomes rough.
                    if ((damageAtRange >= 200) && (!myHex.containsTerrain(Terrains.WATER))) {
                        myHex.removeAllTerrains();
                        myHex.clearExits();
                        myHex.addTerrain(new Terrain(Terrains.ROUGH, 1));
                    } else if ((damageAtRange >= 20) && ((myHex.containsTerrain(Terrains.WOODS)) || (myHex.containsTerrain(Terrains.JUNGLE)))) {
                        // Each 20 clears woods by 1 level.
                        int numCleared = damageAtRange / 20;
                        int terrainType = (myHex.containsTerrain(Terrains.WOODS) ? Terrains.WOODS : Terrains.JUNGLE);
                        int oldLevel = myHex.terrainLevel(terrainType);
                        myHex.removeTerrain(terrainType);
                        if (oldLevel > numCleared) {
                            myHex.addTerrain(new Terrain(terrainType, oldLevel - numCleared));
                        }
                    }

                    sendChangedHex(myHexCoords);
                }
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.