当前位置: 首页>>代码示例>>Java>>正文


Java Node.detachChild方法代码示例

本文整理汇总了Java中com.jme3.scene.Node.detachChild方法的典型用法代码示例。如果您正苦于以下问题:Java Node.detachChild方法的具体用法?Java Node.detachChild怎么用?Java Node.detachChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.scene.Node的用法示例。


在下文中一共展示了Node.detachChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: controlUpdate

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
protected void controlUpdate(final float tpf) {

    final PhysicsCharacter body = getBody();
    final CollisionShape shape = body.getCollisionShape();

    if (currentShape != shape) {
        final Node node = (Node) getSpatial();
        node.detachChild(geom);
        geom = getDebugShape(shape);
        geom.setMaterial(debugAppState.getDebugPink());
        node.attachChild(geom);
        currentShape = shape;
    }

    final Vector3f physicsLocation = body.getPhysicsLocation(physicalLocation);

    applyPhysicsTransform(physicsLocation, Quaternion.IDENTITY);

    geom.setLocalScale(shape.getScale());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:22,代码来源:BulletCharacterDebugControl.java

示例2: showObject

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * Show a j3o object.
 *
 * @param path     the path to object.
 * @param external true if the object is external object.
 */
@JMEThread
private void showObject(@NotNull final String path, final boolean external) {
    prepareProcessor();

    final Editor editor = Editor.getInstance();
    final AssetManager assetManager = editor.getAssetManager();
    final Spatial model;

    FolderAssetLocator.setIgnore(external);
    try {
        model = assetManager.loadModel(path);

        if (external && EDITOR_CONFIG.isAutoTangentGenerating()) {
            TangentGenerator.useMikktspaceGenerator(model);
        }

    } finally {
        FolderAssetLocator.setIgnore(false);
    }

    tryToLoad(model);

    final Node rootNode = editor.getPreviewNode();
    rootNode.detachChild(modelNode);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:32,代码来源:JMEFilePreviewManager.java

示例3: updateLightShowedImpl

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * The process to change light showing.
 */
@JMEThread
private void updateLightShowedImpl(final boolean showed) {
    if (showed == isLightShowed()) return;

    final Node lightNode = getLightNode();
    final Node modelNode = getModelNode();

    if (showed) {
        modelNode.attachChild(lightNode);
    } else {
        modelNode.detachChild(lightNode);
    }

    setLightShowed(showed);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:SceneEditor3DState.java

示例4: updateAudioShowedImpl

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * The process to change audio showing.
 */
@JMEThread
private void updateAudioShowedImpl(final boolean showed) {
    if (showed == isAudioShowed()) return;

    final Node audioNode = getAudioNode();
    final Node modelNode = getModelNode();

    if (showed) {
        modelNode.attachChild(audioNode);
    } else {
        modelNode.detachChild(audioNode);
    }

    setAudioShowed(showed);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:SceneEditor3DState.java

示例5: changeFastSkyImpl

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * The process of changing the fast sky.
 */
@JMEThread
private void changeFastSkyImpl(@Nullable final Spatial fastSky) {

    final Node stateNode = getStateNode();
    final Spatial currentFastSky = getCurrentFastSky();

    if (currentFastSky != null) {
        stateNode.detachChild(currentFastSky);
    }

    if (fastSky != null) {
        stateNode.attachChild(fastSky);
    }

    stateNode.detachChild(getModelNode());
    stateNode.detachChild(getToolNode());

    setCurrentFastSky(fastSky);

    frame = 0;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:ModelEditor3DState.java

示例6: cleanup

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
@JMEThread
public void cleanup() {
    super.cleanup();

    final TonegodTranslucentBucketFilter translucentBucketFilter = EDITOR.getTranslucentBucketFilter();
    translucentBucketFilter.setEnabled(false);

    final Node rootNode = EDITOR.getRootNode();
    rootNode.detachChild(getStateNode());

    final EditorCamera editorCamera = getEditorCamera();
    final InputManager inputManager = EDITOR.getInputManager();
    inputManager.removeListener(actionListener);
    inputManager.removeListener(analogListener);

    if (editorCamera != null) {
        editorCamera.setEnabled(false);
        editorCamera.unregisterInput(inputManager);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:AdvancedAbstractEditor3DState.java

示例7: removeAudioNode

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * Remove the current audio node.
 */
@JMEThread
private void removeAudioNode() {

    final AudioNode currentAudioNode = getAudioNode();
    if (currentAudioNode == null) return;

    final Node stateNode = getStateNode();
    final Status status = currentAudioNode.getStatus();

    if (status == Status.Playing || status == Status.Paused) {
        currentAudioNode.stop();
    }

    stateNode.detachChild(currentAudioNode);

    setAudioNode(null);
    setPrevStatus(null);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:AudioViewer3DState.java

示例8: controlUpdate

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
protected void controlUpdate(float tpf) {
    if (myShape != body.getCollisionShape()) {
        Node node = (Node) this.spatial;
        node.detachChild(geom);
        geom = DebugShapeFactory.getDebugShape(body.getCollisionShape());
        //  geom.setMaterial(debugAppState.DEBUG_YELLOW);
        node.attachChild(geom);
    }
    applyPhysicsTransform(body.getPhysicsLocation(location), body.getPhysicsRotation(rotation));
    geom.setLocalScale(body.getCollisionShape()
                           .getScale());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:14,代码来源:BulletGhostObjectDebugControl.java

示例9: controlUpdate

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
protected void controlUpdate(final float tpf) {

    final PhysicsRigidBody body = getBody();
    final CollisionShape shape = body.getCollisionShape();

    if (currentShape != shape) {
        final Node node = (Node) getSpatial();
        node.detachChild(geom);
        geom = getDebugShape(shape);
        node.attachChild(geom);
        currentShape = shape;
    }

    if (body.isActive()) {
        geom.setMaterial(debugAppState.getDebugMagenta());
    } else {
        geom.setMaterial(debugAppState.getDebugBlue());
    }

    final Vector3f physicsLocation = body.getPhysicsLocation(physicalLocation);
    final Quaternion physicsRotation = body.getPhysicsRotation(physicalRotation);

    applyPhysicsTransform(physicsLocation, physicsRotation);

    geom.setLocalScale(shape.getScale());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:28,代码来源:BulletRigidBodyDebugControl.java

示例10: cleanup

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
public void cleanup() {
    super.cleanup();

    final Node rootNode = requireNonNull(getRootNode());
    rootNode.detachChild(debugRootNode);

    application = null;
    assetManager = null;
    setRootNode(null);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:12,代码来源:BulletDebugAppState.java

示例11: cleanup

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
@JMEThread
public void cleanup() {
    super.cleanup();

    final Node modelNode = getModelNode();
    modelNode.detachAllChildren();

    final Node stateNode = getStateNode();
    stateNode.detachChild(modelNode);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:AdvancedPBR3DEditorState.java

示例12: showMaterial

import com.jme3.scene.Node; //导入方法依赖的package包/类
/**
 * Show a j3m material.
 *
 * @param path the path to material.
 */
@JMEThread
private void showMaterial(@NotNull final String path) {
    prepareProcessor();

    final Editor editor = Editor.getInstance();
    final AssetManager assetManager = editor.getAssetManager();
    final Material material = assetManager.loadMaterial(path);

    testBox.setMaterial(material);
    tryToLoad(testBox);

    final Node rootNode = editor.getPreviewNode();
    rootNode.detachChild(modelNode);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:20,代码来源:JMEFilePreviewManager.java

示例13: clearImpl

import com.jme3.scene.Node; //导入方法依赖的package包/类
@JMEThread
private void clearImpl() {

    final Editor editor = Editor.getInstance();
    final Node rootNode = editor.getPreviewNode();
    rootNode.detachChild(modelNode);

    if (processor != null) {
        processor.setEnabled(false);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:JMEFilePreviewManager.java

示例14: cleanup

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
@JMEThread
public void cleanup() {
    super.cleanup();

    final Node stateNode = getStateNode();
    stateNode.detachChild(getModelNode());
    stateNode.detachChild(getToolNode());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:10,代码来源:ModelEditor3DState.java

示例15: remove

import com.jme3.scene.Node; //导入方法依赖的package包/类
@Override
public void remove(@NotNull final TreeNode<?> child) {
    super.remove(child);

    final Node node = getElement();
    final Object toRemove = child.getElement();

    if (toRemove instanceof Spatial) {
        node.detachChild((Spatial) toRemove);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:NodeTreeNode.java


注:本文中的com.jme3.scene.Node.detachChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。