|
@@ -5,6 +5,7 @@
|
|
:keywords: beginner, intro, animation, documentation, keyinput, input, node, model
|
|
:keywords: beginner, intro, animation, documentation, keyinput, input, node, model
|
|
:relfileprefix: ../../
|
|
:relfileprefix: ../../
|
|
:imagesdir: ../..
|
|
:imagesdir: ../..
|
|
|
|
+:experimental:
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
|
|
|
|
|
|
|
|
@@ -20,7 +21,7 @@ image::jme3/beginner/beginner-animation.png[beginner-animation.png,width="",heig
|
|
|
|
|
|
[TIP]
|
|
[TIP]
|
|
====
|
|
====
|
|
-To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties, go to “Libraries, press “Add Library and add the “jme3-test-data library.
|
|
|
|
|
|
+To use the example assets in a new jMonkeyEngine SDK project, btn:[RMB] select your project, select menu:Properties[Libraries] and in the `Compile` tab press `Add Library` and add the `jme3-test-data` library.
|
|
====
|
|
====
|
|
|
|
|
|
|
|
|
|
@@ -157,6 +158,19 @@ After you load the animated model, you register it to the Animation Controller.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
|
|
+This line of code will return NULL if the AnimeControl is not in the main node of your model.
|
|
|
|
+
|
|
|
|
+[source,java]
|
|
|
|
+----
|
|
|
|
+control = player.getControl(AnimControl.class);
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+To check this, btn:[RMB] select your model and click `"Edit in SceneComposer"` if the models file extension ends in .j3o, or `"View"` if not. You can then see the tree for the model so you can locate the node the control resides in. You can then access the subnode with the following code.
|
|
|
|
+
|
|
|
|
+[source,java]
|
|
|
|
+----
|
|
|
|
+player.getChild("Subnode").getControl(AnimControl.class);
|
|
|
|
+----
|
|
|
|
|
|
[NOTE]
|
|
[NOTE]
|
|
====
|
|
====
|
|
@@ -173,32 +187,6 @@ In your case, where you want animations to chain for the whole skeleton, you jus
|
|
====
|
|
====
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-[NOTE]
|
|
|
|
-====
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-[source]
|
|
|
|
-----
|
|
|
|
-
|
|
|
|
-control = player.getControl(AnimControl.class);
|
|
|
|
-
|
|
|
|
-----
|
|
|
|
-
|
|
|
|
-This line of code will return NULL if the AnimeControl is not in the main node of your model. To check this, right click your model and click “Edit in SceneComposer You can then see the tree for the model. You can then move everything to the main node. You can also access a subnode with the following code.
|
|
|
|
-
|
|
|
|
-[source]
|
|
|
|
-----
|
|
|
|
-
|
|
|
|
-player.getChild("Subnode").getControl(AnimControl.class);
|
|
|
|
-
|
|
|
|
-----
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-====
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
== Responding to Animation Events
|
|
== Responding to Animation Events
|
|
|
|
|
|
Add `implements AnimEventListener` to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a `Walk` cycle is done.
|
|
Add `implements AnimEventListener` to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a `Walk` cycle is done.
|