⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyframesequence.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Nov 27 13:54:35 EET 2003 -->
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
KeyframeSequence (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.KeyframeSequence,KeyframeSequence class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="KeyframeSequence (Mobile 3D Graphics API (M3G))";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/KeyframeSequence.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">
&nbsp;<A HREF="../../../javax/microedition/m3g/IndexBuffer.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<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>  &nbsp;
&nbsp;<A HREF="KeyframeSequence.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.m3g</FONT>
<BR>
Class KeyframeSequence</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../javax/microedition/m3g/Object3D.html">javax.microedition.m3g.Object3D</A>
        |
        +--<B>javax.microedition.m3g.KeyframeSequence</B>
</PRE>
<HR>
<DL>
<DT>public class <B>KeyframeSequence</B><DT>extends <A HREF="../../../javax/microedition/m3g/Object3D.html">Object3D</A></DL>

<P>
<p>Encapsulates animation data as a sequence of time-stamped, vector-valuedkeyframes. Each keyframe represents the value of an animated quantity at aspecific time instant.</p><p>A KeyframeSequence can be associated with multiple <i>animationtargets</i>, that is, animatable object properties, via multipleAnimationTrack objects. Available animation targets include node andtexture transformations, Material parameters, Camera parameters, andso on. When applying an animation to its target, the actual value forthe target is derived by interpolating the keyframe values in theassociated KeyframeSequence object.</p><p>The number of vector components per keyframe is specified in theconstructor and is the same for all keyframes in the sequence. Theinterpretation of the keyframes is determined by the animationtarget(s) the sequence is attached to. For example, 4-componentkeyframes are interpreted as quaternions when applied to the<code>ORIENTATION</code> target.</p><p>Five different functions are available for interpolating thekeyframe values: <code>LINEAR</code> and <code>SPLINE</code>, theirquaternion equivalents <code>SLERP</code> and <code>SQUAD</code>; andthe simple <code>STEP</code> function. Each of these is described inthe Field Summary. There are also two repeat modes, <code>LOOP</code>and <code>CONSTANT</code>, that affect the interpolation.</p><h3>Sequence time vs. world time</h3><p>The internal <i>sequence time</i> t of a KeyframeSequence is derivedfrom world time by its associated AnimationController(s). The formulafor mapping world times to sequence times is given in the "Timing andspeed control" section of the AnimationController class description.The sequence time is then used for interpolating between keyframe valuesas defined by the chosen interpolation function.</p><p>All (valid) keyframes in a KeyframeSequence must fall within asequence time range of [0, D], where D is the duration of the keyframesequence. The duration can be set with the <code>setDuration</code>method. For sequences using the <code>LOOP</code> repeat mode, thesequence time t is restricted into this range via a modulo operation,that is, by adding or subtracting a multiple of D such that 0 &lt;= t&lt; D. For sequences using the <code>CONSTANT</code> mode, the valueof t is unrestricted.</p><h3>Sequence repeat modes</h3><p>The first valid keyframe in a <code>CONSTANT</code> sequence definesthe interpolated value returned before this point in time. That is, withinitial value <b>v</b><sub>0</sub> at time t<sub>0</sub>, theinterpolated value <b>v</b> = <b>v</b><sub>0</sub> for values of timet such that t &lt; t<sub>0</sub>.</p><p>The final valid keyframe in a <code>CONSTANT</code> sequence definesthe interpolated value returned after this point in time. That is, withfinal value <b>v</b><sub>N-1</sub> at time t<sub>N-1</sub>, the interpolatedvalue <b>v</b> = <b>v</b><sub>N-1</sub> for values of time t suchthat t &gt;= t<sub>N-1</sub>.</p><p>A sequence using the <code>LOOP</code> repeat mode is interpolatedas if the keyframes were replicated backward and forward indefinitelyat a spacing equal to the given duration of the sequence. In thiscase, a keyframe which appears at time t will be treated as if it alsoappeared at time t + nD where n is any positive or negative integerand D is the duration of a single loop of the animation, given in<code>setDuration</code>. Note that this is <i>not</i> achieved byjust the modulo operation on the sequence time described above.</p><p>In a looping sequence with N keyframes numbered [0, N-1], thesuccessor of keyframe N-1 is keyframe 0, and the predecessor tokeyframe 0 is keyframe N-1.</p><h3>Coincident keyframes</h3> <p>The specification allows several keyframes to coexist at the sameposition in time. This allows discontinuities in the animationsequences, which can be useful for example in incorporating cuts tocamera animation. In the case of several keyframes coinciding, the onewith the lowest index is always used for the final value of segmentsending at that position in time; for segments starting at thatposition, the keyframe with the highest index is used for the startingvalue. For sequences in <code>LOOP</code> mode, the keyframes from thenext or previous repeat of the sequence may also coincide with thekeyframes of the current repeat if they are at the very end or verybeginning of the sequence. The keyframes in the previous repeat arethen treated as having lower indices, and the keyframes in the nextrepeat as having higher indices, than the keyframes in the currentrepeat.</p> <p>Note that although any number of coincident keyframes can bespecified, a maximum of four will ever be used in <code>SPLINE</code>or <code>SQUAD</code> interpolation; two in <code>LINEAR</code> or<code>SLERP</code> interpolation; and only the one with the highestindex in <code>STEP</code> interpolation.</p><h3>Deferred exceptions</h3><p>The validity of a keyframe sequence can be fully verified only whenit is applied to an animation target, that is, in the <code>animate</code>method of Object3D. Any of the following conditions in a KeyframeSequencewill then trigger an IllegalStateException:</p><ul><li>Duration of sequence not set;</li><li>Duration less than the time of the last valid keyframe;</li><li>Any keyframe times within the valid range in decreasing order.</li></ul><h3>Implementation guidelines</h3><p>Although independent of the keyframe values as such, the interpolationtype and the repeat mode of a sequence are set here rather than in theAnimationTrack objects using the sequence. This is so that the implementationcan sensibly cache spline tangents or other auxiliary data potentiallyrequired at runtime.</p>
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><a href="../../../file-format.html#KeyframeSequence">Binary format</a>, <a href="AnimationController.html#Example">Example</a>, <A HREF="../../../javax/microedition/m3g/AnimationTrack.html"><CODE>AnimationTrack</CODE></A>, <A HREF="../../../javax/microedition/m3g/AnimationController.html"><CODE>AnimationController</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#CONSTANT">CONSTANT</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setRepeatMode</code>, specifying that this sequence is to be played back just once and not repeated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#LINEAR">LINEAR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor parameter that specifies linear interpolation between keyframes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#LOOP">LOOP</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A parameter to <code>setRepeatMode</code>, specifying that this sequence is to be repeated indefinitely.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#SLERP">SLERP</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor parameter that specifies spherical linear interpolation of quaternions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#SPLINE">SPLINE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor parameter that specifies spline interpolation between keyframes. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#SQUAD">SQUAD</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor parameter that specifies spline interpolation of quaternions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#STEP">STEP</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor parameter that specifies stepping from one keyframe value to the next. </TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#KeyframeSequence(int, int, int)">KeyframeSequence</A></B>(int&nbsp;numKeyframes,                 int&nbsp;numComponents,                 int&nbsp;interpolation)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new keyframe sequence with specified interpolation method, number of components per keyframe, and number of keyframes. </TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#getDuration()">getDuration</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the duration of this sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/KeyframeSequence.html#getRepeatMode()">getRepeatMode</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the current repeat mode of this KeyframeSequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -