📄 keyframesequence.html
字号:
<PRE>
public static final int <B>STEP</B></PRE>
<DL>
<DD><p>A constructor parameter that specifies stepping from one keyframe value to the next. The actual value of each keyframe is used, without further interpolation, from the time position of that keyframe until the time of the next keyframe.</p> <p>For a keyframe with value <b>v</b> at time t<sub>i</sub>, where the following keyframe is at time t<sub>i+1</sub>, the value <b>v</b> is valid for all values of time t such that t<sub>i</sub> <= t < t<sub>i+1</sub>.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.KeyframeSequence.STEP">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CONSTANT"><!-- --></A><H3>
CONSTANT</H3>
<PRE>
public static final int <B>CONSTANT</B></PRE>
<DL>
<DD><p>A parameter to <code>setRepeatMode</code>, specifying that this sequence is to be played back just once and not repeated.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.KeyframeSequence.CONSTANT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="LOOP"><!-- --></A><H3>
LOOP</H3>
<PRE>
public static final int <B>LOOP</B></PRE>
<DL>
<DD><p>A parameter to <code>setRepeatMode</code>, specifying that this sequence is to be repeated indefinitely.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.KeyframeSequence.LOOP">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="KeyframeSequence(int, int, int)"><!-- --></A><H3>
KeyframeSequence</H3>
<PRE>
public <B>KeyframeSequence</B>(int numKeyframes, int numComponents, int interpolation)</PRE>
<DL>
<DD><p>Constructs a new keyframe sequence with specified interpolation method, number of components per keyframe, and number of keyframes. All keyframes are initialized to the zero vector, with a time stamp of zero. The repeat mode is initially <code>CONSTANT</code> (not looping), with an undefined duration and the valid range spanning all keyframes.</p> <p>A newly constructed sequence cannot be used in animation until the duration of the sequence has been set. The valid range, that is, the range of keyframes that are included in the animation, can be set with <code>setValidRange</code>. This may be desirable if keyframes are generated dynamically or streamed over the network.</p> <p>The interpolation method is one of the symbolic constants defined above. The method must be compatible with the number of components in the keyframes. <code>STEP</code>, <code>LINEAR</code> and <code>SPLINE</code> can be specified for any type of keyframes. On the other hand, <code>SLERP</code> and <code>SQUAD</code> can only be specified for 4-component keyframes, which are then interpreted as quaternions.</p>
<P>
<DT><B>Parameters:</B><DD><CODE>numKeyframes</CODE> - number of keyframes to allocate for this sequence<DD><CODE>numComponents</CODE> - number of components in each keyframe vector<DD><CODE>interpolation</CODE> - one of the interpolation modes listed above<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>numKeyframes < 1</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>numComponents < 1</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>interpolation</code> is not one of <code>LINEAR, SLERP, SPLINE, SQUAD, STEP</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>interpolation</code> is not a valid interpolation mode for keyframes of size <code>numComponents</code></DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setKeyframe(int, int, float[])"><!-- --></A><H3>
setKeyframe</H3>
<PRE>
public void <B>setKeyframe</B>(int index, int time, float[] value)</PRE>
<DL>
<DD><p>Sets the time position and value of the specified keyframe. The keyframe value is copied in from the given array. The length of the array must be at least equal to the size of a keyframe (<code>numComponents</code>). Refer to AnimationTrack documention for the order in which the keyframe components should be stored in the array for a particular target property.</p> <p>If the interpolation type is <code>SLERP</code> or <code>SQUAD</code>, the keyframes are automatically normalized to yield unit quaternions for interpolation.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - index of the keyframe to set<DD><CODE>time</CODE> - time position of the keyframe, in sequence time units<DD><CODE>value</CODE> - float array containing the keyframe value vector<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>value</code> is null<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if <code>(index < 0) || (index >= numKeyframes)</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>value.length < numComponents</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>time < 0</code></DL>
</DD>
</DL>
<HR>
<A NAME="setValidRange(int, int)"><!-- --></A><H3>
setValidRange</H3>
<PRE>
public void <B>setValidRange</B>(int first, int last)</PRE>
<DL>
<DD><p>Selects the range of keyframes that are included in the animation. Keyframes outside of that range are ignored by the <code>animate</code> method in Object3D.</p> <p>Setting the valid range shorter than the whole sequence enables the application to use the sequence as a circular buffer when generating new keyframe data on the fly, for example. In a typical case, however, the valid range would span the whole sequence.</p> <p>The valid keyframe range is always interpreted in the direction of ascending indices. If <code>first <= last</code>, the valid keyframes are those at the indices:</p> <blockquote><code>first, first+1, ..., last</code></blockquote> <p>If <code>last < first</code>, the valid range wraps around and the valid keyframe indices are:</p> <blockquote><code> first, first+1, ..., numKeyframes-1, 0, 1, ..., last </code>,</blockquote> <p>where <code>numKeyframes</code> is the total number of keyframes allocated for this sequence.</p> <p>The time position of each keyframe in the active range must be greater than or equal to that of the preceding keyframe; if this is not the case, <A HREF="../../../javax/microedition/m3g/Object3D.html#animate(int)"><CODE>Object3D.animate</CODE></A> will throw an exception. The time stamps must be in non-decreasing order, because otherwise the interpolated values between keyframes would be undefined. Note that having two or more keyframes with the same time stamp is specifically allowed.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>first</CODE> - index of the first valid keyframe<DD><CODE>last</CODE> - index of the last valid keyframe<DT><B>Throws:</B><DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if <code>(first < 0) || (first >= numKeyframes)</code><DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if <code>(last < 0) || (last >= numKeyframes)</code></DL>
</DD>
</DL>
<HR>
<A NAME="setDuration(int)"><!-- --></A><H3>
setDuration</H3>
<PRE>
public void <B>setDuration</B>(int duration)</PRE>
<DL>
<DD><p>Sets the duration of this sequence in sequence time units. The duration of a keyframe sequence, as used in animation playback, is determined by the value set here, irrespective of the time stamps of individual keyframes, and irrespective of which keyframes happen to be in the valid range at any given time.</p> <p>The duration D is also used when interpolating looping keyframe sequences. The time interval from the last valid keyframe to the first valid keyframe of the next cycle is calculated as follows:</p> <blockquote> D - (t<sub>last</sub> - t<sub>first</sub>) </blockquote> <p>where t<sub>first</sub> and t<sub>last</sub> are the time stamps of the first and last keyframe, respectively, in the valid range (see <code>setValidRange</code>). Note that they are not necessarily the first and last keyframe of the whole sequence.</p> <p>The duration of the sequence must not be less than the time stamp of the last valid keyframe (t<sub>last</sub>), as otherwise the above formula would yield a negative time interval. Since the duration and the valid range can both be changed at any time, this condition is only enforced by the <code>animate</code> method in Object3D.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>duration</CODE> - duration of the valid range of the sequence<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>duration <= 0</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#getDuration()"><CODE>getDuration</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getDuration()"><!-- --></A><H3>
getDuration</H3>
<PRE>
public int <B>getDuration</B>()</PRE>
<DL>
<DD><p>Gets the duration of this sequence.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the duration of this sequence in sequence time units<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#setDuration(int)"><CODE>setDuration</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setRepeatMode(int)"><!-- --></A><H3>
setRepeatMode</H3>
<PRE>
public void <B>setRepeatMode</B>(int mode)</PRE>
<DL>
<DD><p>Sets the repeat mode of this KeyframeSequence. There are two alternatives, <code>LOOP</code> and <code>CONSTANT</code>.</p> <p>A looping sequence always loops back to the beginning from the end and has an interpolated segment from the last valid keyframe to the first.</p> <p>A constant sequence maintains the first valid keyframe value from the beginning of the sequence to the actual time of that keyframe, and the last valid keyframe value from that keyframe to the end time of the sequence and beyond.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mode</CODE> - the repeat mode to set<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>mode</code> is not one of <code>CONSTANT, LOOP</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#getRepeatMode()"><CODE>getRepeatMode</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getRepeatMode()"><!-- --></A><H3>
getRepeatMode</H3>
<PRE>
public int <B>getRepeatMode</B>()</PRE>
<DL>
<DD><p>Retrieves the current repeat mode of this KeyframeSequence.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current repeat mode; <code>CONSTANT</code> or <code>LOOP</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#setRepeatMode(int)"><CODE>setRepeatMode</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/KeyframeSequence.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<EM><B>Nov 19, 2003</B></EM></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/m3g/IndexBuffer.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/Light.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="KeyframeSequence.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<EM>Copyright © 2003 Nokia Corporation. See the <a href="../../../overview-summary.html#Copyright">Copyright Notice</a> for details.</EM>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -