|
From: <tre...@us...> - 2007-09-17 23:35:23
|
Revision: 410
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=410&view=rev
Author: trevorolio
Date: 2007-09-17 16:35:27 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
Refactored the way user animations are referenced so as to reduce duplicate code and allow for easy addition.
Now avatars can /wave /clap /point and /laugh in addition to the usual standing and walking animations.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-09-17 22:39:50 UTC (rev 409)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-09-17 23:35:27 UTC (rev 410)
@@ -58,13 +58,12 @@
import com.ogoglio.client.model.User;
import com.ogoglio.client.model.Space.Context;
import com.ogoglio.util.BodyConstants;
-import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.viewer.j3d.J3DCamera;
import com.ogoglio.viewer.j3d.J3DCanvas;
import com.ogoglio.viewer.j3d.J3DUniverse;
import com.ogoglio.viewer.j3d.J3DUserRenderable;
-import com.ogoglio.viewer.j3d.bvh.Bvh;
import com.ogoglio.viewer.j3d.bvh.BvhParser;
+import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.BodyDocument;
@@ -124,14 +123,7 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- if (animationID == 1) {
- return UIConstants.getResource("avatar/avatar.bvh");
- } else if (animationID == 2) {
- return UIConstants.getResource("avatar/avatar-walk.bvh");
- } else if (animationID == 3) {
- return UIConstants.getResource("avatar/avatar-wave.bvh");
- }
- return null;
+ return UIConstants.getUserAnimation((int) animationID);
}
public InputStream getUserSkinMapStream(String username) throws IOException {
@@ -199,11 +191,8 @@
public boolean addUserRenderable() {
try {
- renderable = new J3DUserRenderable(user, true, new BvhParser(user, 1).parse());
+ renderable = new J3DUserRenderable(user, true, new BvhParser(user, 0).parse());
userGroup.addChild(renderable);
- BvhParser bvhParser = new BvhParser(user, 1);
- Bvh bvh = bvhParser.parse();
- renderable.playAnimation(bvh, false);
return true;
} catch (Exception e) {
e.printStackTrace();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|