本文整理匯總了Java中com.jme3.gde.core.sceneexplorer.nodes.JmeNode類的典型用法代碼示例。如果您正苦於以下問題:Java JmeNode類的具體用法?Java JmeNode怎麽用?Java JmeNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JmeNode類屬於com.jme3.gde.core.sceneexplorer.nodes包,在下文中一共展示了JmeNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setSceneInfo
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
private void setSceneInfo(final JmeNode jmeNode, final boolean active) {
final NavMeshTopComponent inst = this;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if (jmeNode != null) {
} else {
}
if (!active) {
result.removeLookupListener(inst);
close();
} else {
open();
requestActive();
}
}
});
}
示例2: actionPerformed
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void actionPerformed(ActionEvent ev) {
ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
if (pm == null) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
return;
}
Element assetElement = context.getLookup().lookup(Element.class);
com.jme3.scene.Node node = new com.jme3.scene.Node("PreviewRootNode");
Spatial model = null;
model = AssetPackLoader.loadAssetPackModel(pm, new AssetConfiguration(assetElement));
node.attachChild(model);
JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, pm);
try {
request.setDataObject(DataObject.find(context.getLookup().lookup(Project.class).getProjectDirectory()));
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
}
request.setWindowTitle("AssetPack - PreView Model");
app.openScene(request);
}
示例3: openScene
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
request.setHelpCtx(ctx);
this.sentRequest = request;
request.setWindowTitle("SceneComposer - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("SceneComposerToolNode"));
SceneApplication.getApplication().openScene(request);
}
示例4: duplicate
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
private void duplicate() {
Spatial selected = toolController.getSelectedSpatial();
Spatial clone = selected.clone();
clone.move(1, 0, 1);
selected.getParent().attachChild(clone);
actionPerformed(new DuplicateUndo(clone, selected.getParent()));
selected = clone;
final Spatial cloned = clone;
final JmeNode rootNode = toolController.getRootNode();
refreshSelected(rootNode, selected.getParent());
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
if (cloned != null) {
SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{rootNode.getChild(cloned)});
SceneExplorerTopComponent.findInstance().setSelectedNode(rootNode.getChild(cloned));
}
}
});
toolController.updateSelection(selected);
}
示例5: draggedPrimary
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
@Override
public void draggedPrimary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject currentDataObject) {
if (!pressed) {
setDefaultAxisMarkerColors();
pickedMarker = null; // mouse released, reset selection
if (wasDragging) {
actionPerformed(new RotateUndo(toolController.getSelectedSpatial(), startRotate, lastRotate));
wasDragging = false;
}
pickManager.reset();
} else if (wasDragging) {
if (!pickManager.updatePick(camera, screenCoord)) {
return;
}
if (pickedMarker.equals(QUAD_XY) || pickedMarker.equals(QUAD_XZ) || pickedMarker.equals(QUAD_YZ)) {
Quaternion rotation = startRotate.mult(pickManager.getRotation(startWorldRotate.inverse()));
toolController.getSelectedSpatial().setLocalRotation(rotation);
lastRotate = rotation;
}
updateToolsTransformation();
}
}
示例6: sceneOpened
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
@Override
public void sceneOpened(SceneRequest request) {
final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners();
}
if (node != null) {
explorerManager.setRootContext(node);
explorerManager.getRootContext().setDisplayName(node.getName());
setActivatedNodes(new Node[]{node});
requestVisible();
try {
explorerManager.setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex);
}
setTerrainLodCamera(node);
}
}
示例7: handleMouseManipulate
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
/**
* Manipulate the spatial
*/
private void handleMouseManipulate(Vector2f screenCoord,
State state,
Vector3f axis,
JmeNode rootNode,
DataObject currentDataObject,
JmeSpatial selectedSpatial) {
if (state == State.translate) {
doMouseTranslate(axis, screenCoord, rootNode, selectedSpatial);
} else if (state == State.scale) {
doMouseScale(axis, screenCoord, rootNode, selectedSpatial);
} else if (state == State.rotate) {
doMouseRotate(axis, screenCoord, rootNode, selectedSpatial);
}
}
示例8: initSceneViewerWithSpatial
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
/**
* Creates a new {@link SceneRequest} and launches the OGL Window loaded
* with {@link Spatial} spat and {@link CinematicEditorTopComponent}
*
* @param spat
* @param layer
* @throws DataObjectNotFoundException
*/
private void initSceneViewerWithSpatial(Spatial spat,SpatialLayer layer) throws DataObjectNotFoundException {
AssetDataObject dataObject = getSpatialAssetDataObject(layer);
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, dataObject, false);
//assert jmeNode!=null:"see CinematicEditorManager#initSceneViewerWithSpatial";
SceneRequest request = new SceneRequest(this, jmeNode, assetManager);
request.setDataObject(dataObject);
// request.setHelpCtx(ctx);
this.sentRequest = request;
request.setWindowTitle("Cinematic Editor - " + currentDataObject.getName());
request.setToolNode(new Node("CinematicEditorToolNode"));
SceneApplication.getApplication().openScene(request);
}
示例9: actionPerformed
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void actionPerformed(ActionEvent ev) {
ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
if (pm == null) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
return;
}
Element assetElement = context.getLookup().lookup(Element.class);
com.jme3.scene.Node node = new com.jme3.scene.Node("PreviewRootNode");
Spatial model = null;
model = AssetPackLoader.loadAssetPackModel(pm, new AssetConfiguration(assetElement));
node.attachChild(model);
JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, pm);
try {
request.setDataObject(DataObject.find(context.getLookup().lookup(Project.class).getProjectDirectory()));
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
}
request.setWindowTitle("AssetPack - PreView Model");
app.requestScene(request);
}
示例10: openScene
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
result.addLookupListener(this);
//TODO: handle request change
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
request.setHelpCtx(ctx);
// file.setSaveCookie(saveCookie);
if (editorController != null) {
editorController.cleanup();
}
editorController = new SceneEditorController(jmeNode, file);
this.currentRequest = request;
request.setWindowTitle("SceneComposer - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("SceneComposerToolNode"));
SceneApplication.getApplication().requestScene(request);
}
示例11: setSceneInfo
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
private void setSceneInfo(final JmeNode jmeNode, final boolean active) {
final TerrainEditorTopComponent inst = this;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if (jmeNode != null) {
} else {
}
if (!active) {
result.removeLookupListener(inst);
close();
} else {
open();
requestActive();
}
}
});
}
示例12: sceneRequested
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void sceneRequested(SceneRequest request) {
this.request = request;
final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners();
}
if (node != null) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
explorerManager.setRootContext(node);
explorerManager.getRootContext().setDisplayName(node.getName());
requestVisible();
}
});
}
setTerrainLodCamera(node);
}
示例13: openFile
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void openFile(BinaryModelDataObject file, Node spatial) {
JmeNode node = NodeUtility.createNode(spatial, false);
newEditorController = new VehicleEditorController(node, file);
SceneApplication.getApplication().addSceneListener(this);
sentRequest = new SceneRequest(this, node, file.getLookup().lookup(ProjectAssetManager.class));
sentRequest.setWindowTitle("Vehicle Creator");
sentRequest.setDataObject(file);
sentRequest.setToolNode(newEditorController.getToolsNode());
sentRequest.setHelpCtx(ctx);
SceneApplication.getApplication().openScene(sentRequest);
}
示例14: openScene
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
result.addLookupListener(this);
//TODO: handle request change
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
addSaveNode(jmeNode);
Logger.getLogger(NavMeshTopComponent.class.getName()).finer("NavMesh openScene " + file.getName());
if (editorController != null) {
editorController.cleanup();
}
editorController = new NavMeshController(jmeNode, file, this);
this.currentRequest = request;
request.setWindowTitle("NavMesh - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("NavMeshEditorToolNode"));
SceneApplication.getApplication().openScene(request);
}
示例15: pickWorldSpatial
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; //導入依賴的package包/類
/**
* Given the mouse coordinates, pick the geometry that is closest to the
* camera.
*
* @param cam the Camera
* @param mouseLoc the position of the mouse
* @param jmeRootNode to pick from
* @return the selected spatial, or null if nothing
*/
public static Spatial pickWorldSpatial(Camera cam, Vector2f mouseLoc, JmeNode jmeRootNode) {
Node rootNode = jmeRootNode.getLookup().lookup(Node.class);
CollisionResult cr = pick(cam, mouseLoc, rootNode);
if (cr != null) {
return cr.getGeometry();
} else {
return null;
}
}