Package org.pollux3d.menu

Source Code of org.pollux3d.menu.QuadMarker

package org.pollux3d.menu;

import org.pollux3d.core.Pollux;

import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.material.RenderState.FaceCullMode;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Spatial.CullHint;
import com.jme3.scene.shape.Quad;

public class QuadMarker extends FacingGeometry implements Markable {
 
  public QuadMarker(float size) {
    super("quad_marker", new Quad(size, size));
    init();
  }

  @Override
  public void hideMark() {
    this.setCullHint(CullHint.Always);
  }

  @Override
  public void showMark() {
    this.setCullHint(CullHint.Never);
  }
 
  private void init() {
    //super("planet_marker", new Circle(radius*2));     
    Material mat = new Material(Pollux.get().getAssetManager(), "Common/MatDefs/Misc/ColoredTextured.j3md");
    mat.setColor("Color", ColorRGBA.White);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    //mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    //this.setQueueBucket(Bucket.Transparent);
    this.setMaterial(mat);
  }

}
TOP

Related Classes of org.pollux3d.menu.QuadMarker

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.