本文整理了Java中com.ardor3d.scenegraph.Node.getChildren()
方法的一些代码示例,展示了Node.getChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getChildren()
方法的具体详情如下:
包路径:com.ardor3d.scenegraph.Node
类名称:Node
方法名:getChildren
[英]Returns all children to this node.
[中]将所有子节点返回到此节点。
代码示例来源:origin: Renanse/Ardor3D
node.getChildren().forEach(child -> {
final String material = processSpatialMaterial(child, replaceExisting);
if (material != null) {
node.getChildren().forEach(child -> {
final String material = kidMaterials.get(child);
if (!mostUsed.equals(material)) {
代码示例来源:origin: com.ardor3d/ardor3d-core
private static Spatial makeCopy(final Spatial source, final Spatial parent, final CopyLogic logic) {
final AtomicBoolean recurse = new AtomicBoolean();
final Spatial result = logic.copy(source, recurse);
if (recurse.get() && source instanceof Node && result instanceof Node
&& ((Node) source).getNumberOfChildren() > 0) {
for (final Spatial child : ((Node) source).getChildren()) {
final Spatial copy = makeCopy(child, result, logic);
if (copy != null) {
((Node) result).attachChild(copy);
}
}
}
return result;
}
代码示例来源:origin: com.ardor3d/ardor3d-core
@Override
public Node makeInstanced() {
// get copy of basic spatial info
final Node node = (Node) super.makeInstanced();
// add copy of children
for (final Spatial child : getChildren()) {
final Spatial copy = child.makeInstanced();
node.attachChild(copy);
}
return node;
}
代码示例来源:origin: Renanse/Ardor3D
private static Spatial makeCopy(final Spatial source, final Spatial parent, final CopyLogic logic) {
final AtomicBoolean recurse = new AtomicBoolean();
final Spatial result = logic.copy(source, recurse);
if (recurse.get() && source instanceof Node && result instanceof Node
&& ((Node) source).getNumberOfChildren() > 0) {
for (final Spatial child : ((Node) source).getChildren()) {
final Spatial copy = makeCopy(child, result, logic);
if (copy != null) {
((Node) result).attachChild(copy);
}
}
}
return result;
}
代码示例来源:origin: com.ardor3d/ardor3d-core
@Override
public Node makeCopy(final boolean shareGeometricData) {
// get copy of basic spatial info
final Node node = (Node) super.makeCopy(shareGeometricData);
// add copy of children
for (final Spatial child : getChildren()) {
final Spatial copy = child.makeCopy(shareGeometricData);
node.attachChild(copy);
}
// return
return node;
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public Node makeInstanced() {
// get copy of basic spatial info
final Node node = (Node) super.makeInstanced();
// add copy of children
for (final Spatial child : getChildren()) {
final Spatial copy = child.makeInstanced();
node.attachChild(copy);
}
return node;
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public Node makeCopy(final boolean shareGeometricData) {
// get copy of basic spatial info
final Node node = (Node) super.makeCopy(shareGeometricData);
// add copy of children
for (final Spatial child : getChildren()) {
final Spatial copy = child.makeCopy(shareGeometricData);
node.attachChild(copy);
}
// return
return node;
}
代码示例来源:origin: com.ardor3d/ardor3d-core
/**
* creates a new collision tree for the provided spatial. If the spatial is a node, it recursively calls
* generateCollisionTree for each child. If it is a Mesh, a call to generateCollisionTree is made for each mesh. If
* this tree(s) is to be protected, i.e. not deleted by the CollisionTreeController, set protect to true.
*
* @param type
* the type of collision tree to generate.
* @param object
* the Spatial to generate tree(s) for.
* @param protect
* true to keep these trees from being removed, false otherwise.
*/
public void generateCollisionTree(final CollisionTree.Type type, final Spatial object, final boolean protect) {
if (object instanceof Mesh) {
generateCollisionTree(type, (Mesh) object, protect);
}
if (object instanceof Node) {
if (((Node) object).getNumberOfChildren() > 0) {
for (final Spatial sp : ((Node) object).getChildren()) {
generateCollisionTree(type, sp, protect);
}
}
}
}
代码示例来源:origin: Renanse/Ardor3D
/**
* creates a new collision tree for the provided spatial. If the spatial is a node, it recursively calls
* generateCollisionTree for each child. If it is a Mesh, a call to generateCollisionTree is made for each mesh. If
* this tree(s) is to be protected, i.e. not deleted by the CollisionTreeController, set protect to true.
*
* @param type
* the type of collision tree to generate.
* @param object
* the Spatial to generate tree(s) for.
* @param protect
* true to keep these trees from being removed, false otherwise.
*/
public void generateCollisionTree(final CollisionTree.Type type, final Spatial object, final boolean protect) {
if (object instanceof Mesh) {
generateCollisionTree(type, (Mesh) object, protect);
}
if (object instanceof Node) {
if (((Node) object).getNumberOfChildren() > 0) {
for (final Spatial sp : ((Node) object).getChildren()) {
generateCollisionTree(type, sp, protect);
}
}
}
}
代码示例来源:origin: Renanse/Ardor3D
for (final Spatial spat : meshNode.getChildren()) {
if (spat instanceof Mesh && ((Mesh) spat).getMeshData().getVertexCount() > 0) {
final Mesh sourceMesh = (Mesh) spat;
内容来源于网络,如有侵权,请联系作者删除!