• 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

Revision0a55da2cbe4719e8fbe5711c63c3f56a956343c6 (tree)
Time2004-01-07 11:49:38
Authormojomonkey <mojomonkey@75d0...>
Commitermojomonkey

Log Message

documentation

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

Change Summary

Incremental Difference

--- a/src/com/jme/curve/Curve.java
+++ b/src/com/jme/curve/Curve.java
@@ -36,18 +36,37 @@ import com.jme.math.Vector3f;
3636 import com.jme.system.JmeException;
3737
3838 /**
39- * <code>Curve</code>
39+ * <code>Curve</code> defines a collection of points that make up a curve.
40+ * How this curve is constructed is undefined, and the job of a subclass.
41+ * <code>Curve</code> is abstract only maintaining the point collection. It
42+ * defines <code>getPoint</code> and <code>getOrientation</code>. Extending
43+ * classes are responsible for implementing these methods in the appropriate
44+ * way.
4045 * @author Mark Powell
41- * @version $Id: Curve.java,v 1.4 2004-01-06 20:54:22 mojomonkey Exp $
46+ * @version $Id: Curve.java,v 1.5 2004-01-07 02:49:38 mojomonkey Exp $
4247 */
4348 public abstract class Curve {
4449
50+ /**
51+ * The array of control points.
52+ */
4553 protected Vector3f[] controlPoints;
4654
55+ /**
56+ * Constructor creates a default <code>Curve</code> object with a
57+ * zero size array for the points.
58+ *
59+ */
4760 public Curve() {
4861 controlPoints = new Vector3f[0];
4962 }
5063
64+ /**
65+ * Constructor creates a <code>Curve</code> object. The control
66+ * point list is set during creation. If the control point list is
67+ * null or has fewer than 2 points, an exception is thrown.
68+ * @param controlPoints the points that define the curve.
69+ */
5170 public Curve(Vector3f[] controlPoints) {
5271 if (null == controlPoints) {
5372 throw new JmeException("Control Points may not be null.");
@@ -60,6 +79,13 @@ public abstract class Curve {
6079 this.controlPoints = controlPoints;
6180 }
6281
82+ /**
83+ *
84+ * <code>setControlPoints</code> sets the control point list that
85+ * defines the curve. If the control point list is null or has
86+ * fewer than 2 points, an exception is thrown.
87+ * @param controlPoints the points that define the curve.
88+ */
6389 public void setControlPoints(Vector3f[] controlPoints) {
6490 if (null == controlPoints) {
6591 throw new JmeException("Control Points may not be null.");
@@ -72,12 +98,52 @@ public abstract class Curve {
7298 this.controlPoints = controlPoints;
7399 }
74100
101+ /**
102+ *
103+ * <code>getControlPoints</code> retrieves the list of points that
104+ * defines the curve.
105+ * @return the point list that defines the curve.
106+ */
75107 public Vector3f[] getControlPoints() {
76108 return controlPoints;
77109 }
78110
111+ /**
112+ *
113+ * <code>getPoint</code> calculates a point on the curve based on
114+ * the time, where time is [0, 1]. How the point is calculated is
115+ * defined by the subclass.
116+ * @param time the time frame on the curve, [0, 1].
117+ * @return the point on the curve at a specified time.
118+ */
79119 public abstract Vector3f getPoint(float time);
80120
121+ /**
122+ *
123+ * <code>getOrientation</code> calculates a rotation matrix that
124+ * defines the orientation along a curve. How the matrix is
125+ * calculated is defined by the subclass.
126+ * @param time the time frame on the curve, [0, 1].
127+ * @param precision the accuracy of the orientation (lower is more
128+ * precise). Recommended (0.1).
129+ * @return the rotational matrix that defines the orientation of
130+ * along a curve.
131+ */
81132 public abstract Matrix3f getOrientation(float time, float precision);
133+
134+ /**
135+ *
136+ * <code>getOrientation</code> calculates a rotation matrix that
137+ * defines the orientation along a curve. The up vector is provided
138+ * keeping the orientation from "rolling" along the curve. This is
139+ * useful for camera tracks. How the matrix is calculated is defined
140+ * by the subclass.
141+ * @param time the time frame on the curve, [0, 1].
142+ * @param precision the accuracy of the orientation (lower is more
143+ * precise). Recommended (0.1).
144+ * @param up the up vector to lock.
145+ * @return the rotational matrix that defines the orientation of
146+ * along a curve.
147+ */
82148 public abstract Matrix3f getOrientation(float time, float precision, Vector3f up);
83149 }