com.jme3.scene.Spatial.runControlRender()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(106)

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

Spatial.runControlRender介绍

[英]Called when the Spatial is about to be rendered, to notify controls attached to this Spatial using the Control.render() method.
[中]在即将渲染空间时调用,以通知使用该控件附加到此空间的控件。render()方法。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private void renderSubScene(Spatial scene, ViewPort vp) {
  // check culling first.
  if (!scene.checkCulling(vp.getCamera())) {
    return;
  }
  scene.runControlRender(this, vp);
  if (scene instanceof Node) {
    // Recurse for all children
    Node n = (Node) scene;
    List<Spatial> children = n.getChildren();
    // Saving cam state for culling
    int camState = vp.getCamera().getPlaneState();
    for (int i = 0; i < children.size(); i++) {
      // Restoring cam state before proceeding children recursively
      vp.getCamera().setPlaneState(camState);
      renderSubScene(children.get(i), vp);
    }
  } else if (scene instanceof Geometry) {
    // add to the render queue
    Geometry gm = (Geometry) scene;
    if (gm.getMaterial() == null) {
      throw new IllegalStateException("No material is set for Geometry: " + gm.getName());
    }
    vp.getQueue().addToQueue(gm, scene.getQueueBucket());
  }
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

private void renderSubScene(Spatial scene, ViewPort vp) {
  // check culling first.
  if (!scene.checkCulling(vp.getCamera())) {
    return;
  }
  scene.runControlRender(this, vp);
  if (scene instanceof Node) {
    // Recurse for all children
    Node n = (Node) scene;
    List<Spatial> children = n.getChildren();
    // Saving cam state for culling
    int camState = vp.getCamera().getPlaneState();
    for (int i = 0; i < children.size(); i++) {
      // Restoring cam state before proceeding children recursively
      vp.getCamera().setPlaneState(camState);
      renderSubScene(children.get(i), vp);
    }
  } else if (scene instanceof Geometry) {
    // add to the render queue
    Geometry gm = (Geometry) scene;
    if (gm.getMaterial() == null) {
      throw new IllegalStateException("No material is set for Geometry: " + gm.getName());
    }
    vp.getQueue().addToQueue(gm, scene.getQueueBucket());
  }
}

代码示例来源:origin: info.projectkyoto/mms-engine

scene.runControlRender(this, vp);
if (scene instanceof Node) {

相关文章

Spatial类方法