Browse Source

more java doc

Fabio Arnold 10 years ago
parent
commit
e084ebb650

+ 20 - 5
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/AnimatedMesh.java

@@ -40,7 +40,13 @@ public class AnimatedMesh {
 	private int currentFrame;
 	private boolean loopAction = false;
 	private boolean reverseAction = false;
-	
+
+	/**
+	 * start play an animation (action)
+	 * @param actionName name in the AMSH file
+	 * @param loop loop the animation
+	 * @param reverse play the animation backwards
+	 */
 	public void startAction(String actionName, boolean loop, boolean reverse) {
 		if (!(currentAction != null && currentAction.name.equals(actionName) && reverse)) // keep the current frame
 			currentFrame = 0;
@@ -58,7 +64,10 @@ public class AnimatedMesh {
 			if (!(currentAction != null && currentAction.name.equals(actionName) && reverse)) // keep the current frame
 				currentFrame = currentAction.numFrames - 1;
 	}
-	
+
+	/**
+	 * @return true if completed OR hasn't started yet.
+	 */
 	public boolean isActionDone() {
 		if (currentAction == null)
 			return true;
@@ -70,7 +79,9 @@ public class AnimatedMesh {
 			return currentFrame >= currentAction.numFrames - 1;
 			*/
 	}
-	
+
+	// private classes. don't use these.
+
 	private class Bone {
 		@SuppressWarnings("unused")
 		public String name; // 15 bytes
@@ -194,7 +205,11 @@ public class AnimatedMesh {
 			return matrix;
 		}
 	}
-	
+
+	/**
+	 * create an animmesh from an inputstream
+	 * @param is the inputstream
+	 */
 	public AnimatedMesh(InputStream is) {
 		ByteArrayOutputStream out = new ByteArrayOutputStream();
 		try {
@@ -281,7 +296,7 @@ public class AnimatedMesh {
 	}
 
 	/**
-	 * animate the mesh for one frame
+	 * update the bone transforms of the mesh and advance one frame
 	 */
 	public void tick() {
 		// empty pose

+ 4 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/HomeGLSurfaceView.java

@@ -6,6 +6,10 @@ import android.util.AttributeSet;
 import android.util.Log;
 import android.view.MotionEvent;
 
+/**
+ * the gl surface view used in the homefragment layout
+ * creates the threat indicator renderer
+ */
 public class HomeGLSurfaceView extends GLSurfaceView {
 	public HomeGLSurfaceView(Context context) { // won't be called
 		super(context);

+ 3 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/Quaternion.java

@@ -1,5 +1,8 @@
 package de.tudarmstadt.informatik.hostage.ui2.fragment.opengl;
 
+/**
+ * some basic quaternion class because android doesn't provide any
+ */
 public class Quaternion {
 	public float w, x, y, z;