本文整理汇总了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());
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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());
}
示例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);
}
}