Search in sources :

Example 6 with Arrow

use of com.jme3.scene.debug.Arrow in project jmonkeyengine by jMonkeyEngine.

the class TestMousePick method initMark.

/** A red ball that marks the last spot that was "hit" by the "shot". */
protected void initMark() {
    Arrow arrow = new Arrow(Vector3f.UNIT_Z.mult(2f));
    //Sphere sphere = new Sphere(30, 30, 0.2f);
    mark = new Geometry("BOOM!", arrow);
    //mark = new Geometry("BOOM!", sphere);
    Material mark_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mark_mat.getAdditionalRenderState().setLineWidth(3);
    mark_mat.setColor("Color", ColorRGBA.Red);
    mark.setMaterial(mark_mat);
}
Also used : Arrow(com.jme3.scene.debug.Arrow) Geometry(com.jme3.scene.Geometry) Material(com.jme3.material.Material)

Example 7 with Arrow

use of com.jme3.scene.debug.Arrow in project jmonkeyengine by jMonkeyEngine.

the class TerrainGridAlphaMapTest method createAxisMarker.

protected Node createAxisMarker(float arrowSize) {
    Material redMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    redMat.getAdditionalRenderState().setWireframe(true);
    redMat.setColor("Color", ColorRGBA.Red);
    Material greenMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    greenMat.getAdditionalRenderState().setWireframe(true);
    greenMat.setColor("Color", ColorRGBA.Green);
    Material blueMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    blueMat.getAdditionalRenderState().setWireframe(true);
    blueMat.setColor("Color", ColorRGBA.Blue);
    Node axis = new Node();
    // create arrows
    Geometry arrowX = new Geometry("arrowX", new Arrow(new Vector3f(arrowSize, 0, 0)));
    arrowX.setMaterial(redMat);
    Geometry arrowY = new Geometry("arrowY", new Arrow(new Vector3f(0, arrowSize, 0)));
    arrowY.setMaterial(greenMat);
    Geometry arrowZ = new Geometry("arrowZ", new Arrow(new Vector3f(0, 0, arrowSize)));
    arrowZ.setMaterial(blueMat);
    axis.attachChild(arrowX);
    axis.attachChild(arrowY);
    axis.attachChild(arrowZ);
    //axis.setModelBound(new BoundingBox());
    return axis;
}
Also used : Geometry(com.jme3.scene.Geometry) Arrow(com.jme3.scene.debug.Arrow) Node(com.jme3.scene.Node) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material)

Example 8 with Arrow

use of com.jme3.scene.debug.Arrow in project jmonkeyengine by jMonkeyEngine.

the class TerrainTestModifyHeight method createMarker.

private void createMarker() {
    // collision marker
    Sphere sphere = new Sphere(8, 8, 0.5f);
    marker = new Geometry("Marker");
    marker.setMesh(sphere);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", new ColorRGBA(251f / 255f, 130f / 255f, 0f, 0.6f));
    mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    marker.setMaterial(mat);
    rootNode.attachChild(marker);
    // surface normal marker
    Arrow arrow = new Arrow(new Vector3f(0, 1, 0));
    markerNormal = new Geometry("MarkerNormal");
    markerNormal.setMesh(arrow);
    markerNormal.setMaterial(mat);
    rootNode.attachChild(markerNormal);
}
Also used : Sphere(com.jme3.scene.shape.Sphere) Geometry(com.jme3.scene.Geometry) Arrow(com.jme3.scene.debug.Arrow) ColorRGBA(com.jme3.math.ColorRGBA) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material)

Example 9 with Arrow

use of com.jme3.scene.debug.Arrow in project jmonkeyengine by jMonkeyEngine.

the class TestBatchNodeCluster method simpleInitApp.

//protected
//    protected Geometry player;
@Override
public void simpleInitApp() {
    timer = new NanoTimer();
    batchNode = new SimpleBatchNode("BatchNode");
    xPosition.add(0);
    yPosition.add(0);
    zPosition.add(0);
    mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat1.setColor("Color", ColorRGBA.White);
    mat1.setColor("GlowColor", ColorRGBA.Blue.mult(10));
    mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat2.setColor("Color", ColorRGBA.White);
    mat2.setColor("GlowColor", ColorRGBA.Red.mult(10));
    mat3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat3.setColor("Color", ColorRGBA.White);
    mat3.setColor("GlowColor", ColorRGBA.Yellow.mult(10));
    mat4 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat4.setColor("Color", ColorRGBA.White);
    mat4.setColor("GlowColor", ColorRGBA.Orange.mult(10));
    randomGenerator();
    //rootNode.attachChild(SkyFactory.createSky(
    //  assetManager, "Textures/SKY02.zip", false));
    inputManager.addMapping("Start Game", new KeyTrigger(KeyInput.KEY_J));
    inputManager.addListener(al, new String[] { "Start Game" });
    cam.setLocation(new Vector3f(-34.403286f, 126.65158f, 434.791f));
    cam.setRotation(new Quaternion(0.022630932f, 0.9749435f, -0.18736298f, 0.11776358f));
    batchNode.batch();
    terrain = new Node("terrain");
    terrain.setLocalTranslation(50, 0, 50);
    terrain.attachChild(batchNode);
    flyCam.setMoveSpeed(100);
    rootNode.attachChild(terrain);
    Vector3f pos = new Vector3f(-40, 0, -40);
    batchNode.setLocalTranslation(pos);
    Arrow a = new Arrow(new Vector3f(0, 50, 0));
    Geometry g = new Geometry("a", a);
    g.setLocalTranslation(terrain.getLocalTranslation());
    Material m = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    m.setColor("Color", ColorRGBA.Blue);
    g.setMaterial(m);
    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    fpp.addFilter(new BloomFilter(BloomFilter.GlowMode.Objects));
    //        SSAOFilter ssao = new SSAOFilter(8.630104f,22.970434f,2.9299977f,0.2999997f);    
    //        fpp.addFilter(ssao);
    viewPort.addProcessor(fpp);
//   viewPort.setBackgroundColor(ColorRGBA.DarkGray);
}
Also used : Arrow(com.jme3.scene.debug.Arrow) NanoTimer(com.jme3.system.NanoTimer) Quaternion(com.jme3.math.Quaternion) KeyTrigger(com.jme3.input.controls.KeyTrigger) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material) FilterPostProcessor(com.jme3.post.FilterPostProcessor) BloomFilter(com.jme3.post.filters.BloomFilter)

Aggregations

Arrow (com.jme3.scene.debug.Arrow)9 Vector3f (com.jme3.math.Vector3f)7 Geometry (com.jme3.scene.Geometry)6 Material (com.jme3.material.Material)5 VehicleWheel (com.jme3.bullet.objects.VehicleWheel)2 Node (com.jme3.scene.Node)2 KeyTrigger (com.jme3.input.controls.KeyTrigger)1 ColorRGBA (com.jme3.math.ColorRGBA)1 Quaternion (com.jme3.math.Quaternion)1 Vector2f (com.jme3.math.Vector2f)1 FilterPostProcessor (com.jme3.post.FilterPostProcessor)1 BloomFilter (com.jme3.post.filters.BloomFilter)1 Sphere (com.jme3.scene.shape.Sphere)1 NanoTimer (com.jme3.system.NanoTimer)1