Search in sources :

Example 6 with BlenderKey

use of com.jme3.asset.BlenderKey in project jmonkeyengine by jMonkeyEngine.

the class TestBlenderAnim method simpleInitApp.

@Override
public void simpleInitApp() {
    flyCam.setMoveSpeed(10f);
    cam.setLocation(new Vector3f(6.4013605f, 7.488437f, 12.843031f));
    cam.setRotation(new Quaternion(-0.060740203f, 0.93925786f, -0.2398315f, -0.2378785f));
    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
    dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
    rootNode.addLight(dl);
    BlenderKey blenderKey = new BlenderKey("Blender/2.4x/BaseMesh_249.blend");
    Spatial scene = (Spatial) assetManager.loadModel(blenderKey);
    rootNode.attachChild(scene);
    Spatial model = this.findNode(rootNode, "BaseMesh_01");
    model.center();
    control = model.getControl(AnimControl.class);
    channel = control.createChannel();
    channel.setAnim("run_01");
}
Also used : ColorRGBA(com.jme3.math.ColorRGBA) Quaternion(com.jme3.math.Quaternion) Spatial(com.jme3.scene.Spatial) Vector3f(com.jme3.math.Vector3f) DirectionalLight(com.jme3.light.DirectionalLight) BlenderKey(com.jme3.asset.BlenderKey) AnimControl(com.jme3.animation.AnimControl)

Example 7 with BlenderKey

use of com.jme3.asset.BlenderKey in project jmonkeyengine by jMonkeyEngine.

the class TestBlenderObjectAnim method simpleInitApp.

@Override
public void simpleInitApp() {
    flyCam.setMoveSpeed(10f);
    cam.setLocation(new Vector3f(6.4013605f, 7.488437f, 12.843031f));
    cam.setRotation(new Quaternion(-0.060740203f, 0.93925786f, -0.2398315f, -0.2378785f));
    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
    dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
    rootNode.addLight(dl);
    BlenderKey blenderKey = new BlenderKey("Blender/2.4x/animtest.blend");
    Spatial scene = (Spatial) assetManager.loadModel(blenderKey);
    rootNode.attachChild(scene);
    Spatial model = this.findNode(rootNode, "TestAnim");
    model.center();
    control = model.getControl(AnimControl.class);
    channel = control.createChannel();
    channel.setAnim("TestAnim");
}
Also used : ColorRGBA(com.jme3.math.ColorRGBA) Quaternion(com.jme3.math.Quaternion) Spatial(com.jme3.scene.Spatial) Vector3f(com.jme3.math.Vector3f) DirectionalLight(com.jme3.light.DirectionalLight) BlenderKey(com.jme3.asset.BlenderKey) AnimControl(com.jme3.animation.AnimControl)

Aggregations

BlenderKey (com.jme3.asset.BlenderKey)6 ArrayList (java.util.ArrayList)4 Spatial (com.jme3.scene.Spatial)3 AnimControl (com.jme3.animation.AnimControl)2 AssetNotFoundException (com.jme3.asset.AssetNotFoundException)2 DirectionalLight (com.jme3.light.DirectionalLight)2 ColorRGBA (com.jme3.math.ColorRGBA)2 Quaternion (com.jme3.math.Quaternion)2 Vector3f (com.jme3.math.Vector3f)2 AnimationHelper (com.jme3.scene.plugins.blender.animations.AnimationHelper)2 ConstraintHelper (com.jme3.scene.plugins.blender.constraints.ConstraintHelper)2 FileBlockHeader (com.jme3.scene.plugins.blender.file.FileBlockHeader)2 Structure (com.jme3.scene.plugins.blender.file.Structure)2 LandscapeHelper (com.jme3.scene.plugins.blender.landscape.LandscapeHelper)2 MaterialHelper (com.jme3.scene.plugins.blender.materials.MaterialHelper)2 MeshHelper (com.jme3.scene.plugins.blender.meshes.MeshHelper)2 ObjectHelper (com.jme3.scene.plugins.blender.objects.ObjectHelper)2 TextureHelper (com.jme3.scene.plugins.blender.textures.TextureHelper)2 Texture (com.jme3.texture.Texture)2 Map (java.util.Map)2