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

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

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

Node.getChildren介绍

[英]Returns all children to this node.
[中]将所有子节点返回到此节点。

代码示例

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

  1. node.getChildren().forEach(child -> {
  2. final String material = processSpatialMaterial(child, replaceExisting);
  3. if (material != null) {
  4. node.getChildren().forEach(child -> {
  5. final String material = kidMaterials.get(child);
  6. if (!mostUsed.equals(material)) {

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

  1. private static Spatial makeCopy(final Spatial source, final Spatial parent, final CopyLogic logic) {
  2. final AtomicBoolean recurse = new AtomicBoolean();
  3. final Spatial result = logic.copy(source, recurse);
  4. if (recurse.get() && source instanceof Node && result instanceof Node
  5. && ((Node) source).getNumberOfChildren() > 0) {
  6. for (final Spatial child : ((Node) source).getChildren()) {
  7. final Spatial copy = makeCopy(child, result, logic);
  8. if (copy != null) {
  9. ((Node) result).attachChild(copy);
  10. }
  11. }
  12. }
  13. return result;
  14. }

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

  1. @Override
  2. public Node makeInstanced() {
  3. // get copy of basic spatial info
  4. final Node node = (Node) super.makeInstanced();
  5. // add copy of children
  6. for (final Spatial child : getChildren()) {
  7. final Spatial copy = child.makeInstanced();
  8. node.attachChild(copy);
  9. }
  10. return node;
  11. }

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

  1. private static Spatial makeCopy(final Spatial source, final Spatial parent, final CopyLogic logic) {
  2. final AtomicBoolean recurse = new AtomicBoolean();
  3. final Spatial result = logic.copy(source, recurse);
  4. if (recurse.get() && source instanceof Node && result instanceof Node
  5. && ((Node) source).getNumberOfChildren() > 0) {
  6. for (final Spatial child : ((Node) source).getChildren()) {
  7. final Spatial copy = makeCopy(child, result, logic);
  8. if (copy != null) {
  9. ((Node) result).attachChild(copy);
  10. }
  11. }
  12. }
  13. return result;
  14. }

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

  1. @Override
  2. public Node makeCopy(final boolean shareGeometricData) {
  3. // get copy of basic spatial info
  4. final Node node = (Node) super.makeCopy(shareGeometricData);
  5. // add copy of children
  6. for (final Spatial child : getChildren()) {
  7. final Spatial copy = child.makeCopy(shareGeometricData);
  8. node.attachChild(copy);
  9. }
  10. // return
  11. return node;
  12. }

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

  1. @Override
  2. public Node makeInstanced() {
  3. // get copy of basic spatial info
  4. final Node node = (Node) super.makeInstanced();
  5. // add copy of children
  6. for (final Spatial child : getChildren()) {
  7. final Spatial copy = child.makeInstanced();
  8. node.attachChild(copy);
  9. }
  10. return node;
  11. }

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

  1. @Override
  2. public Node makeCopy(final boolean shareGeometricData) {
  3. // get copy of basic spatial info
  4. final Node node = (Node) super.makeCopy(shareGeometricData);
  5. // add copy of children
  6. for (final Spatial child : getChildren()) {
  7. final Spatial copy = child.makeCopy(shareGeometricData);
  8. node.attachChild(copy);
  9. }
  10. // return
  11. return node;
  12. }

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

  1. /**
  2. * creates a new collision tree for the provided spatial. If the spatial is a node, it recursively calls
  3. * generateCollisionTree for each child. If it is a Mesh, a call to generateCollisionTree is made for each mesh. If
  4. * this tree(s) is to be protected, i.e. not deleted by the CollisionTreeController, set protect to true.
  5. *
  6. * @param type
  7. * the type of collision tree to generate.
  8. * @param object
  9. * the Spatial to generate tree(s) for.
  10. * @param protect
  11. * true to keep these trees from being removed, false otherwise.
  12. */
  13. public void generateCollisionTree(final CollisionTree.Type type, final Spatial object, final boolean protect) {
  14. if (object instanceof Mesh) {
  15. generateCollisionTree(type, (Mesh) object, protect);
  16. }
  17. if (object instanceof Node) {
  18. if (((Node) object).getNumberOfChildren() > 0) {
  19. for (final Spatial sp : ((Node) object).getChildren()) {
  20. generateCollisionTree(type, sp, protect);
  21. }
  22. }
  23. }
  24. }

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

  1. /**
  2. * creates a new collision tree for the provided spatial. If the spatial is a node, it recursively calls
  3. * generateCollisionTree for each child. If it is a Mesh, a call to generateCollisionTree is made for each mesh. If
  4. * this tree(s) is to be protected, i.e. not deleted by the CollisionTreeController, set protect to true.
  5. *
  6. * @param type
  7. * the type of collision tree to generate.
  8. * @param object
  9. * the Spatial to generate tree(s) for.
  10. * @param protect
  11. * true to keep these trees from being removed, false otherwise.
  12. */
  13. public void generateCollisionTree(final CollisionTree.Type type, final Spatial object, final boolean protect) {
  14. if (object instanceof Mesh) {
  15. generateCollisionTree(type, (Mesh) object, protect);
  16. }
  17. if (object instanceof Node) {
  18. if (((Node) object).getNumberOfChildren() > 0) {
  19. for (final Spatial sp : ((Node) object).getChildren()) {
  20. generateCollisionTree(type, sp, protect);
  21. }
  22. }
  23. }
  24. }

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

  1. for (final Spatial spat : meshNode.getChildren()) {
  2. if (spat instanceof Mesh && ((Mesh) spat).getMeshData().getVertexCount() > 0) {
  3. final Mesh sourceMesh = (Mesh) spat;

相关文章