Search in sources :

Example 31 with AL

use of com.jme3.audio.openal.AL in project jmonkeyengine by jMonkeyEngine.

the class TestSceneLoading method simpleInitApp.

public void simpleInitApp() {
    this.flyCam.setMoveSpeed(10);
    // load sky
    rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false));
    File file = new File("wildhouse.zip");
    if (!file.exists()) {
        useHttp = true;
    }
    // load the level from zip or http zip
    if (useHttp) {
        assetManager.registerLocator("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jmonkeyengine/wildhouse.zip", HttpZipLocator.class);
    } else {
        assetManager.registerLocator("wildhouse.zip", ZipLocator.class);
    }
    Spatial scene = assetManager.loadModel("main.scene");
    AmbientLight al = new AmbientLight();
    scene.addLight(al);
    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(0.69077975f, -0.6277887f, -0.35875428f).normalizeLocal());
    sun.setColor(ColorRGBA.White.clone().multLocal(2));
    scene.addLight(sun);
    rootNode.attachChild(scene);
}
Also used : Spatial(com.jme3.scene.Spatial) DirectionalLight(com.jme3.light.DirectionalLight) Vector3f(com.jme3.math.Vector3f) File(java.io.File) AmbientLight(com.jme3.light.AmbientLight)

Aggregations

AmbientLight (com.jme3.light.AmbientLight)26 DirectionalLight (com.jme3.light.DirectionalLight)19 Vector3f (com.jme3.math.Vector3f)19 Geometry (com.jme3.scene.Geometry)18 Material (com.jme3.material.Material)12 Spatial (com.jme3.scene.Spatial)12 Node (com.jme3.scene.Node)10 Box (com.jme3.scene.shape.Box)10 Sphere (com.jme3.scene.shape.Sphere)9 KeyTrigger (com.jme3.input.controls.KeyTrigger)8 Quaternion (com.jme3.math.Quaternion)8 FilterPostProcessor (com.jme3.post.FilterPostProcessor)8 ActionListener (com.jme3.input.controls.ActionListener)7 ColorRGBA (com.jme3.math.ColorRGBA)7 SpotLight (com.jme3.light.SpotLight)5 Vector2f (com.jme3.math.Vector2f)5 Texture (com.jme3.texture.Texture)5 AL (com.jme3.audio.openal.AL)3 ALAudioRenderer (com.jme3.audio.openal.ALAudioRenderer)3 ALC (com.jme3.audio.openal.ALC)3