示例#1
0
文件: Grid.java 项目: nasa/DERT
  /**
   * Constructor
   *
   * @param state
   */
  public Grid(GridState state) {
    super(state.name);
    this.state = state;
    this.cellSize = state.size;
    this.color = state.color;
    this.lineWidth = state.lineWidth;
    offset = new Vector3();
    setLocation(state.location, false);

    lattice = new HiddenLine("_lattice", IndexMode.Lines);
    SpatialUtil.setPickHost(lattice, this);
    lattice.setColor(color);
    lattice.setModelBound(new BoundingBox());

    MaterialState ms = new MaterialState();
    ms.setColorMaterial(ColorMaterial.Emissive);
    ms.setColorMaterialFace(MaterialState.MaterialFace.FrontAndBack);
    ms.setEnabled(true);
    text = new Node("_text");
    text.getSceneHints().setLightCombineMode(LightCombineMode.Off);
    text.getSceneHints().setPickingHint(PickingHint.Pickable, false);
    text.setRenderState(ms);
    setLabelVisible(state.labelVisible);

    attachChild(lattice);
    attachChild(text);

    setVisible(state.visible);
    setPinned(state.pinned);

    state.setMapElement(this);
  }
示例#2
0
  /**
   * Sets up a node to be transformed and clipped for skybox usage
   *
   * @param skyBox Handle to a node to use as skybox
   */
  public void setSkybox(final Node skyBox) {
    if (skyBox != null) {
      final ClipState skyboxClipState = new ClipState();
      skyboxClipState.setEnabled(false);
      skyBox.setRenderState(skyboxClipState);
    }

    this.skyBox = skyBox;
  }