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

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

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

Spatial.getShadowMode介绍

暂无

代码示例

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

/**
 * Helper function used to recursively populate the outputGeometryList 
 * with geometry children of scene node
 * 
 * @param camera
 * @param scene
 * @param outputGeometryList 
 */
private static void addGeometriesInCamFrustumFromNode(Camera camera, Node scene, RenderQueue.ShadowMode mode, GeometryList outputGeometryList) {
  if (scene.getCullHint() == Spatial.CullHint.Always) return;
  camera.setPlaneState(0);
  if (camera.contains(scene.getWorldBound()) != Camera.FrustumIntersect.Outside) {
    for (Spatial child: scene.getChildren()) {
      if (child instanceof Node) addGeometriesInCamFrustumFromNode(camera, (Node)child, mode, outputGeometryList);
      else if (child instanceof Geometry && child.getCullHint() != Spatial.CullHint.Always) {
        camera.setPlaneState(0);
        if (checkShadowMode(child.getShadowMode(), mode) &&
            !((Geometry)child).isGrouped() &&
            camera.contains(child.getWorldBound()) != Camera.FrustumIntersect.Outside) {
         outputGeometryList.add((Geometry)child);
        }
      }
    }
  }
}

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

if (checkShadowMode(scene.getShadowMode(), mode) && !((Geometry)scene).isGrouped() ) {
  outputGeometryList.add((Geometry)scene);

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

private void process(Spatial scene) {
  if (scene.getCullHint() == Spatial.CullHint.Always) return;
  RenderQueue.ShadowMode shadowMode = scene.getShadowMode();
  if ( scene instanceof Geometry )

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

/**
 * If a spatial is not inside the eye frustum, it
 * is still rendered in the shadow frustum (shadow casting queue)
 * through this recursive method.
 */
private void renderShadow(Spatial s, RenderQueue rq) {
  if (s instanceof Node) {
    Node n = (Node) s;
    List<Spatial> children = n.getChildren();
    for (int i = 0; i < children.size(); i++) {
      renderShadow(children.get(i), rq);
    }
  } else if (s instanceof Geometry) {
    Geometry gm = (Geometry) s;
    RenderQueue.ShadowMode shadowMode = s.getShadowMode();
    if (shadowMode != RenderQueue.ShadowMode.Off && shadowMode != RenderQueue.ShadowMode.Receive) {
      //forcing adding to shadow cast mode, culled objects doesn't have to be in the receiver queue
      rq.addToShadowQueue(gm, RenderQueue.ShadowMode.Cast);
    }
  }
}

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

if ((scene.getShadowMode() != RenderQueue.ShadowMode.Off || scene instanceof Node) && scene.getCullHint()!=Spatial.CullHint.Always) {
  renderShadow(scene, vp.getQueue());
RenderQueue.ShadowMode shadowMode = scene.getShadowMode();
if (shadowMode != RenderQueue.ShadowMode.Off) {
  vp.getQueue().addToShadowQueue(gm, shadowMode);

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

if (checkShadowMode(scene.getShadowMode(), mode) && !((Geometry)scene).isGrouped() ) {
  outputGeometryList.add((Geometry)scene);

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

/**
 * Helper function used to recursively populate the outputGeometryList 
 * with geometry children of scene node
 * 
 * @param camera
 * @param scene
 * @param outputGeometryList 
 */
private static void addGeometriesInCamFrustumFromNode(Camera camera, Node scene, RenderQueue.ShadowMode mode, GeometryList outputGeometryList) {
  if (scene.getCullHint() == Spatial.CullHint.Always) return;
  camera.setPlaneState(0);
  if (camera.contains(scene.getWorldBound()) != Camera.FrustumIntersect.Outside) {
    for (Spatial child: scene.getChildren()) {
      if (child instanceof Node) addGeometriesInCamFrustumFromNode(camera, (Node)child, mode, outputGeometryList);
      else if (child instanceof Geometry && child.getCullHint() != Spatial.CullHint.Always) {
        camera.setPlaneState(0);
        if (checkShadowMode(child.getShadowMode(), mode) &&
            !((Geometry)child).isGrouped() &&
            camera.contains(child.getWorldBound()) != Camera.FrustumIntersect.Outside) {
         outputGeometryList.add((Geometry)child);
        }
      }
    }
  }
}

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

private void process(Spatial scene) {
  if (scene.getCullHint() == Spatial.CullHint.Always) return;
  RenderQueue.ShadowMode shadowMode = scene.getShadowMode();
  if ( scene instanceof Geometry )

相关文章

Spatial类方法