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

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

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

Node.getWorldBound介绍

暂无

代码示例

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

  1. _frustumIntersects = ((_parent != null && _parent.getWorldBound() != null) ? _parent._frustumIntersects
  2. : Camera.FrustumIntersect.Intersects);

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

  1. _frustumIntersects = ((_parent != null && _parent.getWorldBound() != null) ? _parent._frustumIntersects
  2. : Camera.FrustumIntersect.Intersects);

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

  1. @Override
  2. public void draw(final Renderer r) {
  3. if (_timer != null && _redrawRate > 0) {
  4. _elapsed += _timer.getTimePerFrame();
  5. }
  6. if (_tRenderer == null) {
  7. init(r);
  8. }
  9. if (_cam == null) {
  10. _cam = Camera.getCurrentCamera();
  11. _tRenderer.getCamera().setFrustum(_cam.getFrustumNear(), _cam.getFrustumFar(), _cam.getFrustumLeft(),
  12. _cam.getFrustumRight(), _cam.getFrustumTop(), _cam.getFrustumBottom());
  13. _tRenderer.getCamera().setFrame(_cam.getLocation(), _cam.getLeft(), _cam.getUp(), _cam.getDirection());
  14. }
  15. if (_doUpdate && (!_haveDrawn || shouldDoUpdate(_cam)) && _targetScene.getWorldBound() != null) {
  16. final BoundingVolume b = _targetScene.getWorldBound();
  17. _center.set(b.getCenter());
  18. updateCameraLookat();
  19. calculateImposter();
  20. updateCameraLookat();
  21. updateCameraFrustum();
  22. renderImposter();
  23. _haveDrawn = true;
  24. }
  25. _imposterQuad.draw(r);
  26. }

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

  1. @Override
  2. public void draw(final Renderer r) {
  3. if (_timer != null && _redrawRate > 0) {
  4. _elapsed += _timer.getTimePerFrame();
  5. }
  6. if (_tRenderer == null) {
  7. init(r);
  8. }
  9. if (_cam == null) {
  10. _cam = Camera.getCurrentCamera();
  11. _tRenderer.getCamera().setFrustum(_cam.getFrustumNear(), _cam.getFrustumFar(), _cam.getFrustumLeft(),
  12. _cam.getFrustumRight(), _cam.getFrustumTop(), _cam.getFrustumBottom());
  13. _tRenderer.getCamera().setFrame(_cam.getLocation(), _cam.getLeft(), _cam.getUp(), _cam.getDirection());
  14. }
  15. if (_doUpdate && (!_haveDrawn || shouldDoUpdate(_cam)) && _targetScene.getWorldBound() != null) {
  16. final BoundingVolume b = _targetScene.getWorldBound();
  17. _center.set(b.getCenter());
  18. updateCameraLookat();
  19. calculateImposter();
  20. updateCameraLookat();
  21. updateCameraFrustum();
  22. renderImposter();
  23. _haveDrawn = true;
  24. }
  25. _imposterQuad.draw(r);
  26. }

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

  1. public static void findCollisions(final Spatial spatial, final Spatial scene, final CollisionResults results) {
  2. if (spatial == scene || spatial.getWorldBound() == null
  3. || !spatial.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)
  4. || !scene.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)) {
  5. return;
  6. }
  7. if (spatial instanceof Node) {
  8. final Node node = (Node) spatial;
  9. if (node.getWorldBound().intersects(scene.getWorldBound())) {
  10. // further checking needed.
  11. for (int i = 0; i < node.getNumberOfChildren(); i++) {
  12. PickingUtil.findCollisions(node.getChild(i), scene, results);
  13. }
  14. }
  15. } else if (spatial instanceof Mesh) {
  16. final Mesh mesh = (Mesh) spatial;
  17. if (mesh.getWorldBound().intersects(scene.getWorldBound())) {
  18. if (scene instanceof Node) {
  19. final Node parent = (Node) scene;
  20. for (int i = 0; i < parent.getNumberOfChildren(); i++) {
  21. PickingUtil.findCollisions(mesh, parent.getChild(i), results);
  22. }
  23. } else {
  24. results.addCollision(mesh, (Mesh) scene);
  25. }
  26. }
  27. }
  28. }

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

  1. public static void findCollisions(final Spatial spatial, final Spatial scene, final CollisionResults results) {
  2. if (spatial == scene || spatial.getWorldBound() == null
  3. || !spatial.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)
  4. || !scene.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)) {
  5. return;
  6. }
  7. if (spatial instanceof Node) {
  8. final Node node = (Node) spatial;
  9. if (node.getWorldBound().intersects(scene.getWorldBound())) {
  10. // further checking needed.
  11. for (int i = 0; i < node.getNumberOfChildren(); i++) {
  12. PickingUtil.findCollisions(node.getChild(i), scene, results);
  13. }
  14. }
  15. } else if (spatial instanceof Mesh) {
  16. final Mesh mesh = (Mesh) spatial;
  17. if (mesh.getWorldBound().intersects(scene.getWorldBound())) {
  18. if (scene instanceof Node) {
  19. final Node parent = (Node) scene;
  20. for (int i = 0; i < parent.getNumberOfChildren(); i++) {
  21. PickingUtil.findCollisions(mesh, parent.getChild(i), results);
  22. }
  23. } else {
  24. results.addCollision(mesh, (Mesh) scene);
  25. }
  26. }
  27. }
  28. }

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

  1. final Node node = (Node) spatial;
  2. if (node.getWorldBound().intersects(scene.getWorldBound())) {
  3. if (node.getNumberOfChildren() == 0 && !checkPrimitives) {
  4. return true;

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

  1. final Node node = (Node) spatial;
  2. if (node.getWorldBound().intersects(scene.getWorldBound())) {
  3. if (node.getNumberOfChildren() == 0 && !checkPrimitives) {
  4. return true;

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

  1. private void calculateImposter() {
  2. final BoundingVolume worldBound = _targetScene.getWorldBound();
  3. _center.set(worldBound.getCenter());

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

  1. private void calculateImposter() {
  2. final BoundingVolume worldBound = _targetScene.getWorldBound();
  3. _center.set(worldBound.getCenter());

相关文章