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

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

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

Node.detachChildAt介绍

[英]detachChildAt removes a child at a given index. That child is returned for saving purposes.
[中]detachChildAt删除给定索引处的子项。那孩子是为了省钱才被送回的。

代码示例

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

  1. @Override
  2. public Spatial detachChildAt(final int index) {
  3. return _targetScene.detachChildAt(index);
  4. }

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

  1. @Override
  2. public Spatial detachChildAt(final int index) {
  3. return _targetScene.detachChildAt(index);
  4. }

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

  1. /**
  2. *
  3. * <code>detachAllChildren</code> removes all children attached to this node.
  4. */
  5. public void detachAllChildren() {
  6. for (int i = getNumberOfChildren() - 1; i >= 0; i--) {
  7. detachChildAt(i);
  8. }
  9. logger.fine("All children removed.");
  10. }

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

  1. /**
  2. *
  3. * <code>detachAllChildren</code> removes all children attached to this node.
  4. */
  5. public void detachAllChildren() {
  6. for (int i = getNumberOfChildren() - 1; i >= 0; i--) {
  7. detachChildAt(i);
  8. }
  9. logger.fine("All children removed.");
  10. }

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

  1. /**
  2. * <code>detachChild</code> removes a given child from the node's list. This child will no longe be maintained.
  3. *
  4. * @param child
  5. * the child to remove.
  6. * @return the index the child was at. -1 if the child was not in the list.
  7. */
  8. public int detachChild(final Spatial child) {
  9. if (child == null) {
  10. return -1;
  11. }
  12. if (child.getParent() == this) {
  13. final int index = _children.indexOf(child);
  14. if (index != -1) {
  15. detachChildAt(index);
  16. }
  17. return index;
  18. }
  19. return -1;
  20. }

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

  1. /**
  2. * <code>detachChild</code> removes a given child from the node's list. This child will no longe be maintained.
  3. *
  4. * @param child
  5. * the child to remove.
  6. * @return the index the child was at. -1 if the child was not in the list.
  7. */
  8. public int detachChild(final Spatial child) {
  9. if (child == null) {
  10. return -1;
  11. }
  12. if (child.getParent() == this) {
  13. final int index = _children.indexOf(child);
  14. if (index != -1) {
  15. detachChildAt(index);
  16. }
  17. return index;
  18. }
  19. return -1;
  20. }

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

  1. /**
  2. * <code>detachChild</code> removes a given child from the node's list. This child will no longe be maintained. Only
  3. * the first child with a matching name is removed.
  4. *
  5. * @param childName
  6. * the child to remove.
  7. * @return the index the child was at. -1 if the child was not in the list.
  8. */
  9. public int detachChildNamed(final String childName) {
  10. if (childName == null) {
  11. return -1;
  12. }
  13. for (int i = getNumberOfChildren() - 1; i >= 0; i--) {
  14. final Spatial child = _children.get(i);
  15. if (childName.equals(child.getName())) {
  16. detachChildAt(i);
  17. return i;
  18. }
  19. }
  20. return -1;
  21. }

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

  1. /**
  2. * <code>detachChild</code> removes a given child from the node's list. This child will no longe be maintained. Only
  3. * the first child with a matching name is removed.
  4. *
  5. * @param childName
  6. * the child to remove.
  7. * @return the index the child was at. -1 if the child was not in the list.
  8. */
  9. public int detachChildNamed(final String childName) {
  10. if (childName == null) {
  11. return -1;
  12. }
  13. for (int i = getNumberOfChildren() - 1; i >= 0; i--) {
  14. final Spatial child = _children.get(i);
  15. if (childName.equals(child.getName())) {
  16. detachChildAt(i);
  17. return i;
  18. }
  19. }
  20. return -1;
  21. }

相关文章