Package com.jme3.terrain.geomipmap.lodcalc

Examples of com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator


    }

    @Override
    public void start() {
     
        setSettings(new AppSettings(true));
        PolluxSettingsDialog.show(settings);
       
        super.start();
    }
View Full Code Here


           * The total size is up to you. At 1025 it ran fine for me (200+FPS), however at
           * size=2049, it got really slow. But that is a jump from 2 million to 8 million triangles...
           */
          terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
          TerrainLodControl control = new TerrainLodControl(terrain, getCamera());
          control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier
          terrain.addControl(control);
          terrain.setMaterial(material);
          terrain.setLocalTranslation(0, -100, 0);
          terrain.setLocalScale(2f, 0.5f, 2f);
          rootNode.attachChild(terrain);
View Full Code Here

    public TerrainLodControl(Terrain terrain, Camera camera) {
        List<Camera> cams = new ArrayList<Camera>();
        cams.add(camera);
        this.terrain = terrain;
        this.cameras = cams;
        lodCalculator = new DistanceLodCalculator(65, 2.7f); // a default calculator
    }
View Full Code Here

     * @param cameras one or more cameras to reference for LOD calc
     */
    public TerrainLodControl(Terrain terrain, List<Camera> cameras) {
        this.terrain = terrain;
        this.cameras = cameras;
        lodCalculator = new DistanceLodCalculator(65, 2.7f); // a default calculator
    }
View Full Code Here

    @Override
    public void read(JmeImporter im) throws IOException {
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        terrain = (Terrain) ic.readSavable("terrain", null);
        lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator());
    }
View Full Code Here

    private List<TerrainQuad> addedTerrains = new ArrayList<TerrainQuad>();
    private List<TerrainQuad> removedTerrains = new ArrayList<TerrainQuad>();

    public MultiTerrainLodControl(List<Camera> cameras) {
        this.cameras = cameras;
        lodCalculator = new DistanceLodCalculator(65, 2.7f);
    }
View Full Code Here

    public MultiTerrainLodControl(Camera camera) {
        List<Camera> cams = new ArrayList<Camera>();
        cams.add(camera);
        this.cameras = cams;
        lodCalculator = new DistanceLodCalculator(65, 2.7f);
    }
View Full Code Here

    */
    Geometry g = new Geometry("Bubble", b);
    g.rotate(FastMath.HALF_PI, 0, FastMath.HALF_PI);
    //g.scale(1, 1, -1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Texture tex = assetManager.loadTexture("Textures/test3.png");
    mat.setTexture("ColorMap", tex);
    //mat.setColor("Color", ColorRGBA.Blue);
    //mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
   
View Full Code Here

    sphere.setQueueBucket(Bucket.Sky);
    Material sky = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
    TextureKey key = new TextureKey("Textures/Sky/Stars.dds", true);
    key.setGenerateMips(true);
    key.setAsCube(true);
    Texture tex = assetManager.loadTexture(key);
    sky.setTexture("m_Texture", tex);
    sky.setVector3("m_NormalScale", Vector3f.UNIT_XYZ);
    sphere.setMaterial(sky);
    sphere.setCullHint(Spatial.CullHint.Never);
    bgNode.attachChild(sphere);
View Full Code Here

  public void initialize(AppStateManager stateManager, Application app){
    super.initialize(stateManager, app);
    assetManager = app.getAssetManager();
    settings = app.getContext().getSettings();
   
    Picture pic = new Picture("HUD Picture");
    pic.setImage(assetManager, "Hud/InfoBox2.png", true);
    pic.setHeight(settings.getHeight());
    pic.setWidth(settings.getHeight()/2);
    pic.setPosition(settings.getWidth()-settings.getHeight()/2, 0);
    menuNode.attachChild(pic);
   
   
    /*Quad q = new Quad(6, 3);
        Geometry g = new Geometry("quad", q);
View Full Code Here

TOP

Related Classes of com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator

Copyright © 2018 www.massapicom. 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.