BetterCharacterControl
+ * You might want to try BetterCharacterControl
as well.
* @author normenhansen
*/
-@Deprecated
public class CharacterControl extends PhysicsCharacter implements PhysicsControl {
protected Spatial spatial;
diff --git a/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java b/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java
index 24b7e55c7..a2de023ef 100644
--- a/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java
+++ b/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java
@@ -31,16 +31,16 @@ public class FixWikiLinks extends Task {
String line = rdr.readLine();
while (line != null) {
//internal links
- line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html");
- line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html");
- line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html");
- line = line.replaceAll("wiki/doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html");
+ line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html");
+ line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html");
+ line = line.replaceAll("doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html");
+ line = line.replaceAll("doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html");
//images
- line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\"");
- line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\"");
- line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\"");
- line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\"");
-// line = line.replaceAll("/wiki/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_");
+ line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\"");
+ line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\"");
+ line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\"");
+ line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\"");
+// line = line.replaceAll("/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_");
line = line.replaceAll("]*)>]*)>", "");
line = line.replaceAll("]*)\\?([^>]*)\">", "");
diff --git a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java
index 834d2205e..12f824bbc 100644
--- a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java
+++ b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java
@@ -37,11 +37,12 @@ public class LoadWikiImages extends Task {
int endIdx = line.indexOf("\"", idx + 10);
if (endIdx >= 0) {
String link = line.substring(idx + 10, endIdx);
- int wikidx = link.indexOf("/wiki/lib/exe/fetch.php/");
- //int extidx = link.indexOf("/wiki/lib/exe/fetch.php?");
+ link = link.replace("&", "&");
+ int wikidx = link.indexOf("/lib/exe/fetch.php/");
+ //int extidx = link.indexOf("/lib/exe/fetch.php?");
int extidx = -1;
if (wikidx >= 0) {
- String name = link.replaceAll("/wiki/lib/exe/fetch\\.php/", "");
+ String name = link.replaceAll("/lib/exe/fetch\\.php/", "");
int markIdx = name.indexOf("?");
if (markIdx >= 0) {
name = name.substring(0, markIdx);
@@ -75,7 +76,7 @@ public class LoadWikiImages extends Task {
}
}
} else if (extidx >= 0) {
- String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
+ String name = link.replaceAll("/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
int markIdx = name.indexOf("?");
if (markIdx >= 0) {
name = name.substring(0, markIdx);
diff --git a/sdk/ant-lib/ant-jme.jar b/sdk/ant-lib/ant-jme.jar
index 449997c07..9998d4a78 100644
Binary files a/sdk/ant-lib/ant-jme.jar and b/sdk/ant-lib/ant-jme.jar differ
diff --git a/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
index 4941aef18..af4bb4fac 100644
--- a/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
+++ b/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
@@ -4,6 +4,6 @@ currentVersion=jMonkeyEngine SDK 3.1-snapshot-github
LBL_splash_window_title=Starting jMonkeyEngine SDK
SPLASH_HEIGHT=350
SPLASH_WIDTH=500
-SplashProgressBarBounds=0,344,500,6
-SplashRunningTextBounds=3,330,497,12
-SplashRunningTextFontSize=12
+SplashProgressBarBounds=0,347,500,6
+SplashRunningTextBounds=3,335,497,12
+SplashRunningTextFontSize=10
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java
index 6c33d362e..aafd77fc6 100644
--- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java
@@ -19,7 +19,7 @@ import org.w3c.dom.Element;
*/
public class AssetPackBrowserFolder extends AbstractNode {
- Image icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/assets.gif");
+ Image icon = ImageUtilities.loadImage("com/jme3/gde/assetpack/icons/assets.gif");
Project proj;
public AssetPackBrowserFolder(Element[] elem, Project lib, String[] categories, String[] tags) {
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java
index 7aa0a4e89..12f2b8d08 100644
--- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java
@@ -63,7 +63,7 @@ public class AssetPackBrowserItem extends AbstractNode {
private void setImage() {
try {
String add = item.getAttribute("type");
- icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/" + add + ".gif");
+ icon = ImageUtilities.loadImage("com/jme3/gde/assetpack/icons/" + add + ".gif");
} catch (Exception e) {
}
}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java
index a8d007530..795fc8b1f 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java
@@ -48,12 +48,21 @@ public class AssetNode extends FilterNode {
private Node node;
public AssetNode(ProjectAssetManager manager, Node node) {
- super(node, new AssetChildren(manager, node), createLookupProxy(manager, node));
+ super(node, isFile(node) ? Children.LEAF : new AssetChildren(manager, node), createLookupProxy(manager, node));
this.node = node;
enableDelegation(DELEGATE_GET_ACTIONS);
enableDelegation(DELEGATE_GET_CONTEXT_ACTIONS);
}
+ public static boolean isFile(Node node) {
+ DataObject obj = null;
+ obj = node.getLookup().lookup(DataObject.class);
+ if (obj != null) {
+ return !obj.getPrimaryFile().isFolder();
+ }
+ return false;
+ }
+
public static Lookup createLookupProxy(ProjectAssetManager manager, Node node) {
//TODO: This is causing the most silly exception for the most silly problem
// due to the most silly warning in netbeans platform
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java b/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java
index 14de215e8..5f8d64936 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java
@@ -47,6 +47,9 @@ import org.netbeans.api.project.ProjectManager;
import org.netbeans.api.project.ui.OpenProjects;
import org.openide.DialogDisplayer;
import org.openide.WizardDescriptor;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionRegistration;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
@@ -54,9 +57,13 @@ import org.openide.util.Exceptions;
import org.openide.util.HelpCtx;
import org.openide.util.actions.CallableSystemAction;
-// An example action demonstrating how the wizard could be called from within
-// your code. You can copy-paste the code below wherever you need.
@SuppressWarnings({"unchecked", "rawtypes"})
+@ActionID(id = "com.jme3.gde.core.codeless.CodelessProjectWizardAction", category = "CodelessProjects")
+@ActionRegistration(iconBase = "com/jme3/gde/core/assets/actions/jme-logo.png",
+ displayName = "#CTL_Codeless_Project",
+ lazy = false,
+ iconInMenu = true)
+@ActionReference(path = "Menu/File/Import", name = "CodelessProject", position = 0)
public final class CodelessProjectWizardAction extends CallableSystemAction {
private static final Logger logger = Logger.getLogger(CodelessProjectWizardAction.class.getName());
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java b/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java
index 8868da619..bf0925e11 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java
@@ -34,7 +34,13 @@ package com.jme3.gde.core.errorreport;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionRegistration;
+@ActionID(id = "com.jme3.gde.core.errorreport.RendererInfoAction", category = "jMonkeyPlatform")
+@ActionRegistration(displayName = "#CTL_RendererInfoAction", iconInMenu = true)
+@ActionReference(path = "Menu/Help", position = 1225)
public final class RendererInfoAction implements ActionListener {
RendererInfo info;
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java
index 28310a151..3fc09fa8b 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java
@@ -51,6 +51,7 @@ import org.openide.explorer.view.BeanTreeView;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
+import org.openide.util.actions.SystemAction;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
@@ -84,8 +85,8 @@ public final class FilterExplorerTopComponent extends TopComponent implements Ex
setToolTipText(NbBundle.getMessage(FilterExplorerTopComponent.class, "HINT_FilterExplorerTopComponent"));
ActionMap map = getActionMap();
map.put("delete", ExplorerUtils.actionDelete(explorerManager, true));
- map.put("moveup", new MoveUpAction());
- map.put("movedown", new MoveDownAction());
+ map.put("moveup", SystemAction.get(MoveUpAction.class));
+ map.put("movedown", SystemAction.get(MoveDownAction.class));
associateLookup(ExplorerUtils.createLookup(explorerManager, map));
}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml
index 3a9b7b143..35e537791 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml
+++ b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml
@@ -2,26 +2,6 @@
- Like Shapes, 3D models are also made up of Meshes, but models are more complex than Shapes. While Shapes are built into jME3, you typically create models in external 3D Mesh Editors.
- To use 3D models in a jME3 application:
assets
directory.- To create 3D models and scenes, you need a 3D Mesh Editor such as , with an OgreXML Exporter plugin.
@@ -45,7 +42,6 @@ To create 3D models and scenes, you need a 3D Mesh Editor such as- In 3D games, you do not only load static 3D models, you also want to be able to trigger animations in the model from the Java code.
- JME3 only loads and plays animated models, it does not create them.
-What is required for an animated model? (See also: Animation terminology) +What is required for an animated model? (See also: Animation terminology)
-
Create one com.jme3.animation.AnimControl
object in your JME3 application for each animated model that you want to control. You have to register each animated model to one of these Animation Controls. The control object gives you access to the available animation sequences in the model.
AnimControl playerControl; // you need one Control per model
@@ -101,16 +96,15 @@ Create one com.jme3.animation.AnimControl
object in your JME3 appli
-
An Animation Control has several Animation Channels (com.jme3.animation.AnimChannel
). Each channel can play one animation sequence at a time.
-There often are situations where you want to run several animation sequences at the same time, e.g. "shooting while walking" or "boxing while jumping". In this case, you create several channels, assign an animation to each, and play them in parallel. +There often are situations where you want to run several animation sequences at the same time, e.g. “shooting while walking” or “boxing while jumping”. In this case, you create several channels, assign an animation to each, and play them in parallel.
AnimChannel channel_walk = playerControl.createChannel();
AnimChannel channel_jump = playerControl.createChannel();
@@ -122,18 +116,18 @@ To reset a Control, call control.clearChannels();
- The following information is available for an AnimControl. -
AnimControl Property | Usage |
---|---|
createChannel() | Returns a new channel, controlling all bones by default. | Adds or removes listeners to receive animation related |
AnimControl Property | Usage | ||
---|---|---|---|
setAnimations(aniHashMap) | Sets the animations that this AnimControl is capable of playing. The animations must be compatible with the skeleton given in the constructor. | Adds or removes an animation from this Control. | getAnimationNames()A String Collection of names of all animations that this Control can play for this model. |
getAnim("anim") | Retrieve an animation from the list of animations. | +getAnim(“anim”) | Retrieve an animation from the list of animations. |
getAnimationLength("anim") | Returns the length of the given named animation in seconds | +getAnimationLength(“anim”) | Returns the length of the given named animation in seconds |
AnimControl Property | Usage | ||
---|---|---|---|
getSkeleton() | The Skeleton object controlled by this Control. | Adds or removes an animation from this Control. | getTargets()The Skin objects controlled by this Control, as Mesh array. |
getAttachmentsNode("bone") | Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone's motions. | +getAttachmentsNode(“bone”) | Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone's motions. |
- The following properties are set per AnimChannel. -
AnimChannel Property | Usage |
---|---|
setLoopMode(LoopMode.Loop); | From now on, the animation on this channel will repeat from the beginning when it ends. |
- The following information is available for a channel. -
AnimChannel Property | Usage |
---|---|
getAnimationName() | The name of the animation playing on this channel. Returns null when no animation is playing. |
- Use the following methods to add or remove individual bones to an AnimChannel. This is useful when you play two animations in parallel on two channels, and each controls a subset of the bones (e.g. one the arms, and the other the legs). -
AnimChannel Methods | Usage | |
---|---|---|
addAllBones() | Add all the bones of the model's skeleton to be influenced by this animation channel. (default) | |
addBone("bone1") + | addBone(“bone1”) addBone(bone1) | Add a single bone to be influenced by this animation channel. |
addToRootBone("bone1") + | addToRootBone(“bone1”) addToRootBone(bone1) | Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given bone, to the root bone. |
addFromRootBone("bone1") + | addFromRootBone(“bone1”) addFromRootBone(bone1) | Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given root bone, going towards the children bones. |
- Animations are played by channel. Note: Whether the animation channel plays continuously or only once, depends on the Loop properties you have set. -
Channel Method | Usage | ||
---|---|---|---|
channel_walk.setAnim("Walk",0.50f); | Start the animation named "Walk" on channel channel_walk. + | channel_walk.setAnim(“Walk”,0.50f); | Start the animation named “Walk” on channel channel_walk. The float value specifies the time how long the animation should overlap with the previous one on this channel. If set to 0f, then no blending will occur and the new animation will be applied instantly. |
- Tip: Use the AnimEventLister below to react at the end or start of an animation cycle.
- -In this short example, we define the space key to trigger playing the "Walk" animation on channel2. +In this short example, we define the space key to trigger playing the “Walk” animation on channel2.
public void simpleInitApp() { ... @@ -312,7 +308,7 @@ In this short example, we define the space key to trigger playing the "Walk ... } - private ActionListener actionListener = new ActionListener() { + private ActionListener() { public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("Walk") && !keyPressed) { if (!channel2.getAnimationName().equals("Walk")) { @@ -325,11 +321,10 @@ In this short example, we define the space key to trigger playing the "Walk
-
A jME3 application that contains animations can implement the com.jme3.animation.AnimEventListener
interface.
public class HelloAnimation extends SimpleApplication @@ -341,11 +336,10 @@ This optional Listener enables you to respond to animation start and end events,
- The onAnimCycleDone() event is invoked when an animation cycle has ended. For non-looping animations, this event is invoked when the animation is finished playing. For looping animations, this event is invoked each time the animation loop is restarted.
@@ -370,11 +364,10 @@ You have access to the following objects:
-
The onAnimChange() event is invoked every time before an animation is set by the user to be played on a given channel (channel.setAnim()
).
-
The com.jme3.app.state.AppState
class is a customizable jME3 interface that allows you to control the global game logic, the overall game mechanics. (To control the behaviour of a Spatial, see Custom Controls instead. Controls and AppStates can be used together.)
- There are situations during your game development where you think:
- You can! This is what AppStates are there for. An AppState class is subset of (or an extension to) your application. Every AppState class has access to all fields in your main application (AssetManager, ViewPort, StateManager, InputManager, RootNode, GuiNode, etc) and hooks into the main update loop. An AppState can contain:
- Each AppState lets you define what happens to it in the following situations:
!isEnabled()
, and write code that skips the running sections of this AppState's update()
loop. - -
- To implement game logic:
- When you add several AppStates to one Application and activate them, their initialize() methods and update() loops are executed in the order in which the AppStates were added to the AppStateManager.
- JME3 comes with a BulletAppState that implements Physical behaviour (using the jBullet library). You, for example, could write an Artificial Intelligence AppState to control all your enemy units. Existing examples in the code base include:
- The AppState interface lets you initialize sets of objects, and hook a set of continously executing code into the main loop. -