• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

Revision7513088f18b0a7ff36708fd1f2885f9fdb5f6258 (tree)
Time2003-09-16 07:20:28
Authormojomonkey <mojomonkey@75d0...>
Commitermojomonkey

Log Message

changed animation. Now requires a call to update to match all other models.

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@90 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

Change Summary

Incremental Difference

--- a/src/jme/entity/Entity.java
+++ b/src/jme/entity/Entity.java
@@ -40,6 +40,7 @@ import jme.exception.MonkeyGLException;
4040 import jme.exception.MonkeyRuntimeException;
4141 import jme.geometry.Geometry;
4242 import jme.geometry.bounding.BoundingVolume;
43+import jme.geometry.model.Model;
4344 import jme.math.Vector;
4445 import jme.physics.PhysicsModule;
4546 import jme.entity.camera.Frustum;
@@ -65,7 +66,7 @@ import org.lwjgl.opengl.Window;
6566 * <code>Entity</code> to represent something abstract.
6667 *
6768 * @author Mark Powell
68- * @version $Id: Entity.java,v 1.9 2003-09-10 20:32:59 mojomonkey Exp $
69+ * @version $Id: Entity.java,v 1.10 2003-09-15 22:20:28 mojomonkey Exp $
6970 */
7071 public class Entity implements EntityInterface {
7172
@@ -317,6 +318,12 @@ public class Entity implements EntityInterface {
317318 * <code>update</code> updates the state of the entity.
318319 */
319320 public void update(float time) {
321+ //if the geometry is of type model it should be updated.
322+ if(null != geometry) {
323+ if(geometry instanceof Model) {
324+ ((Model)geometry).update(time);
325+ }
326+ }
320327 if(null != physics) {
321328 physics.update(time);
322329 physics.updatePosition(position);
--- a/src/jme/geometry/model/md3/Md3Model.java
+++ b/src/jme/geometry/model/md3/Md3Model.java
@@ -54,7 +54,7 @@ import jme.utility.LoggingSystem;
5454 import jme.utility.StringUtils;
5555 import jme.exception.MonkeyGLException;
5656 import jme.exception.MonkeyRuntimeException;
57-import jme.geometry.Geometry;
57+import jme.geometry.model.Model;
5858
5959 import org.lwjgl.opengl.GL;
6060 import org.lwjgl.opengl.Window;
@@ -96,9 +96,9 @@ import org.lwjgl.opengl.Window;
9696 *
9797 *
9898 * @author Mark Powell
99- * @version $Id: Md3Model.java,v 1.11 2003-09-10 20:32:59 mojomonkey Exp $
99+ * @version $Id: Md3Model.java,v 1.12 2003-09-15 22:20:27 mojomonkey Exp $
100100 */
101-public class Md3Model implements Geometry {
101+public class Md3Model implements Model {
102102 /**
103103 * LOWER defines the legs section of the model.
104104 */
@@ -275,15 +275,23 @@ public class Md3Model implements Geometry {
275275 //set the desired color
276276 GL.glColor4f(r, g, b, a);
277277
278- //Update the leg and torso animations
279- updateModel(lower);
280- updateModel(upper);
281-
282278 //start rendering with the legs first.
283279 drawLink(lower);
284280 //set culling back to GL.GL_BACK
285281 DisplaySystem.getDisplaySystem().cullMode(GL.GL_BACK, true);
286282 }
283+
284+ /**
285+ * <code>update</code> updates the position of the model's vertices
286+ * to allow for animation.
287+ * @param time the time between frames.
288+ */
289+ public void update(float time) {
290+ updateModel(lower);
291+ updateModel(upper);
292+
293+
294+ }
287295
288296 /**
289297 * <code>setTorsoAnimation</code> sets the current animation of the
@@ -1754,4 +1762,6 @@ public class Md3Model implements Geometry {
17541762 */
17551763 Md3Tag[] tags;
17561764 }
1765+
1766+
17571767 }
\ No newline at end of file
--- a/src/test/general/TestMain.java
+++ b/src/test/general/TestMain.java
@@ -188,8 +188,8 @@ public class TestMain extends AbstractGame {
188188 currentAnimation = 2;
189189 ((Md3Model) e.getGeometry()).setLegsAnimation("LEGS_RUN");
190190 }
191-
192- }
191+
192+ }
193193 protected void render() {
194194 GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
195195 GL.glLoadIdentity();