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

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

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

Spatial.setParent介绍

[英]Called by Node#attachChild(Spatial) and Node#detachChild(Spatial) - don't call directly. setParent sets the parent of this node.
[中]由节点#attachChild(空间)和节点#detachChild(空间)调用-不要直接调用。setParent设置此节点的父节点。

代码示例

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

@Override
protected void setParent(Node parent) {
  if( this.parent == null && parent != null ) {
    // We were a root before and now we aren't... make sure if
    // we had an updateList then we clear it completely to
    // avoid holding the dead array.
    updateList = null;
    updateListValid = false;
  }
  super.setParent(parent);
}

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

@Override
protected void setParent(Node parent) {
  super.setParent(parent);
  // If the geometry is managed by group node we need to unassociate.
  if (parent == null && isGrouped()) {
    unassociateFromGroupNode();
  }
}

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

/**
 *
 * <code>detachChildAt</code> removes a child at a given index. That child
 * is returned for saving purposes.
 *
 * @param index
 *            the index of the child to be removed.
 * @return the child at the supplied index.
 */
public Spatial detachChildAt(int index) {
  Spatial child =  children.remove(index);
  if ( child != null ) {
    child.setParent( null );
    logger.log(Level.FINE, "{0}: Child removed.", this.toString());
    // since a child with a bound was detached;
    // our own bound will probably change.
    setBoundRefresh();
    // our world transform no longer influences the child.
    // XXX: Not necessary? Since child will have transform updated
    // when attached anyway.
    child.setTransformRefresh();
    // lights are also inherited from parent
    child.setLightListRefresh();
    child.setMatParamOverrideRefresh();
    
    invalidateUpdateList();
  }
  return child;
}

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

child.getParent().detachChild(child);
child.setParent(this);
children.add(index, child);

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

@Override
protected void setParent(Node parent) {
  if( this.parent == null && parent != null ) {
    // We were a root before and now we aren't... make sure if
    // we had an updateList then we clear it completely to
    // avoid holding the dead array.
    updateList = null;
    updateListValid = false;
  }
  super.setParent(parent);
}

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

@Override
protected void setParent(Node parent) {
  super.setParent(parent);
  //if the geometry is batched we also have to unbatch it
  if (parent == null && isBatched()) {
    unBatch();
  }
}

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

@Override
protected void setParent(Node parent) {
  super.setParent(parent);
  // If the geometry is managed by group node we need to unassociate.
  if (parent == null && isGrouped()) {
    unassociateFromGroupNode();
  }
}

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

/**
 * 
 * <code>detachChildAt</code> removes a child at a given index. That child
 * is returned for saving purposes.
 * 
 * @param index
 *            the index of the child to be removed.
 * @return the child at the supplied index.
 */
public Spatial detachChildAt(int index) {
  Spatial child =  children.remove(index);
  if ( child != null ) {
    child.setParent( null );
    logger.log(Level.INFO, "{0}: Child removed.", this.toString());
    // since a child with a bound was detached;
    // our own bound will probably change.
    setBoundRefresh();
    // our world transform no longer influences the child.
    // XXX: Not neccessary? Since child will have transform updated
    // when attached anyway.
    child.setTransformRefresh();
    // lights are also inherited from parent
    child.setLightListRefresh();
  }
  return child;
}

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

child.getParent().detachChild(child);
child.setParent(this);
children.add(index, child);
child.setTransformRefresh();

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

child.getParent().detachChild(child);
child.setParent(this);
children.add(child);

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

/**
 *
 * <code>detachChildAt</code> removes a child at a given index. That child
 * is returned for saving purposes.
 *
 * @param index
 *            the index of the child to be removed.
 * @return the child at the supplied index.
 */
public Spatial detachChildAt(int index) {
  Spatial child =  children.remove(index);
  if ( child != null ) {
    child.setParent( null );
    logger.log(Level.FINE, "{0}: Child removed.", this.toString());
    // since a child with a bound was detached;
    // our own bound will probably change.
    setBoundRefresh();
    // our world transform no longer influences the child.
    // XXX: Not necessary? Since child will have transform updated
    // when attached anyway.
    child.setTransformRefresh();
    // lights are also inherited from parent
    child.setLightListRefresh();
    child.setMatParamOverrideRefresh();
    
    invalidateUpdateList();
  }
  return child;
}

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

child.getParent().detachChild(child);
child.setParent(this);
children.add(index, child);

相关文章

Spatial类方法