com.ardor3d.scenegraph.Node.setRenderState()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.ardor3d.scenegraph.Node.setRenderState()方法的一些代码示例,展示了Node.setRenderState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setRenderState()方法的具体详情如下:
包路径:com.ardor3d.scenegraph.Node
类名称:Node
方法名:setRenderState

Node.setRenderState介绍

暂无

代码示例

代码示例来源:origin: com.ardor3d/ardor3d-effects

/**
 * 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;
}

代码示例来源:origin: com.ardor3d/ardor3d-core

protected Node clone(final Node original) {
    Node copy = null;
    try {
      copy = original.getClass().newInstance();
    } catch (final InstantiationException e) {
      logger.log(Level.SEVERE, "Could not access final constructor of class "
          + original.getClass().getCanonicalName(), e);
      throw new RuntimeException(e);
    } catch (final IllegalAccessException e) {
      logger.log(Level.SEVERE, "Could not access final constructor of class "
          + original.getClass().getCanonicalName(), e);
      throw new RuntimeException(e);
    }
    copy.setName(original.getName() + "_copy");
    copy.getSceneHints().set(original.getSceneHints());
    copy.setTransform(original.getTransform());

    for (final StateType type : StateType.values()) {
      final RenderState state = original.getLocalRenderState(type);
      if (state != null) {
        copy.setRenderState(state);
      }
    }
    return copy;
  }
}

代码示例来源:origin: Renanse/Ardor3D

protected Node clone(final Node original) {
    Node copy = null;
    try {
      copy = original.getClass().newInstance();
    } catch (final InstantiationException e) {
      logger.log(Level.SEVERE, "Could not access final constructor of class "
          + original.getClass().getCanonicalName(), e);
      throw new RuntimeException(e);
    } catch (final IllegalAccessException e) {
      logger.log(Level.SEVERE, "Could not access final constructor of class "
          + original.getClass().getCanonicalName(), e);
      throw new RuntimeException(e);
    }
    copy.setName(original.getName() + "_copy");
    copy.getSceneHints().set(original.getSceneHints());
    copy.setTransform(original.getTransform());

    for (final StateType type : StateType.values()) {
      final RenderState state = original.getLocalRenderState(type);
      if (state != null) {
        copy.setRenderState(state);
      }
    }
    return copy;
  }
}

代码示例来源:origin: Renanse/Ardor3D

public MoveWidget(final IFilterList filterList) {
  super(filterList);
  _handle = new Node("moveHandle");
  final BlendState blend = new BlendState();
  blend.setBlendEnabled(true);
  _handle.setRenderState(blend);
  final ZBufferState zstate = new ZBufferState();
  zstate.setFunction(TestFunction.LessThanOrEqualTo);
  _handle.setRenderState(zstate);
  _handle.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);
  _handle.updateGeometricState(0);
  if (MoveWidget.DEFAULT_CURSOR != null) {
    setMouseOverCallback(new SetCursorCallback(MoveWidget.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: Renanse/Ardor3D

public MovePlanarWidget(final IFilterList filterList) {
  super(filterList);
  _handle = new Node("moveHandle");
  final BlendState blend = new BlendState();
  blend.setBlendEnabled(true);
  _handle.setRenderState(blend);
  final ZBufferState zstate = new ZBufferState();
  zstate.setFunction(TestFunction.LessThanOrEqualTo);
  _handle.setRenderState(zstate);
  _handle.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);
  _handle.updateGeometricState(0);
  if (MovePlanarWidget.DEFAULT_CURSOR != null) {
    setMouseOverCallback(new SetCursorCallback(MovePlanarWidget.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: Renanse/Ardor3D

public MoveMultiPlanarWidget(final IFilterList filterList, final double extent) {
  super(filterList);
  _handle = new Node("moveHandle");
  final BlendState blend = new BlendState();
  blend.setBlendEnabled(true);
  _handle.setRenderState(blend);
  final ZBufferState zstate = new ZBufferState();
  zstate.setFunction(TestFunction.LessThanOrEqualTo);
  _handle.setRenderState(zstate);
  _handle.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);
  _handle.updateGeometricState(0);
  createDefaultHandle(extent);
  if (MoveMultiPlanarWidget.DEFAULT_CURSOR != null) {
    setMouseOverCallback(new SetCursorCallback(MoveMultiPlanarWidget.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: Renanse/Ardor3D

public SimpleScaleWidget withArrow(final ReadOnlyVector3 arrowDirection, final ReadOnlyColorRGBA color,
    final double lengthGap, final double tipGap) {
  _arrowDirection = new Vector3(arrowDirection);
  _handle = new InteractArrow("scaleHandle", 1.0, 0.125, lengthGap, tipGap);
  if (!_arrowDirection.equals(Vector3.UNIT_Z)) {
    _handle.setRotation(new Quaternion().fromVectorToVector(Vector3.UNIT_Z, _arrowDirection));
  }
  final BlendState blend = new BlendState();
  blend.setBlendEnabled(true);
  _handle.setRenderState(blend);
  ((Arrow) _handle).setDefaultColor(color);
  final ZBufferState zstate = new ZBufferState();
  zstate.setWritable(false);
  zstate.setFunction(TestFunction.Always);
  _handle.setRenderState(zstate);
  _handle.getSceneHints().setRenderBucketType(RenderBucketType.PostBucket);
  _handle.updateGeometricState(0);
  return this;
}

代码示例来源:origin: com.ardor3d/ardor3d-core

public LineGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) {
  super(width, height, renderer, caps);
  // Setup our static horizontal graph lines
  createHLines();
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: Renanse/Ardor3D

public LineGrapher(final int width, final int height, final Renderer renderer) {
  super(width, height, renderer);
  // Setup our static horizontal graph lines
  createHLines();
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: com.ardor3d/ardor3d-core

public TimedAreaGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) {
  super(width, height, renderer, caps);
  // Setup our static horizontal graph lines
  createHLines();
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: Renanse/Ardor3D

public TimedAreaGrapher(final int width, final int height, final Renderer renderer) {
  super(width, height, renderer);
  // Setup our static horizontal graph lines
  createHLines();
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: Renanse/Ardor3D

public RotateWidget(final IFilterList filterList) {
  super(filterList);
  _handle = new Node("rotationHandle");
  final ZBufferState zstate = new ZBufferState();
  zstate.setFunction(TestFunction.LessThanOrEqualTo);
  _handle.setRenderState(zstate);
  _handle.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);
  _handle.updateGeometricState(0);
  if (RotateWidget.DEFAULT_CURSOR != null) {
    setMouseOverCallback(new SetCursorCallback(RotateWidget.DEFAULT_CURSOR));
  }
}

代码示例来源:origin: Renanse/Ardor3D

public TabledLabelGrapher(final int width, final int height, final Renderer renderer) {
  super(width, height, renderer);
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _bgQuad.getSceneHints().setRenderBucketType(RenderBucketType.OrthoOrder);
  _bgQuad.setDefaultColor(new ColorRGBA(ColorRGBA.BLACK));
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: com.ardor3d/ardor3d-core

public TabledLabelGrapher(final int width, final int height, final Renderer renderer, final ContextCapabilities caps) {
  super(width, height, renderer, caps);
  _defBlendState = new BlendState();
  _defBlendState.setEnabled(true);
  _defBlendState.setBlendEnabled(true);
  _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
  _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
  _graphRoot.setRenderState(_defBlendState);
  _bgQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
  _bgQuad.setDefaultColor(new ColorRGBA(ColorRGBA.BLACK));
  _graphRoot.getSceneHints().setCullHint(CullHint.Never);
}

代码示例来源:origin: Renanse/Ardor3D

public void init() {
  if (Constants.stats) {
    Constants.updateGraphs = true;
  }
  rootNode.getSceneHints().setCullHint(CullHint.Dynamic);
  statNode.getSceneHints().setCullHint(CullHint.Never);
  grid = createGrid();
  rootNode.attachChild(grid);
  particleNode = new Node("particles");
  rootNode.attachChild(particleNode);
  final ZBufferState zbuf = new ZBufferState();
  zbuf.setWritable(false);
  zbuf.setEnabled(true);
  zbuf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
  particleNode.setRenderState(zbuf);
  statNode.updateGeometricState(0, true);
};

相关文章