Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 82b5b9ff85e9905e91f8803dc47bf339 > files > 61

cal3d-devel-0.11.0-9.fc12.i686.rpm

<html>
  <head>
    <title>Cal3D: CalAbstractMixer Class Reference</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
<body bgcolor="#ffffff">
  <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
    <tr>
      <td class="md" align="center">
        <small>
          <b>- Cal3D 0.11 API Reference -</b>
        </small>
      </td>
    </tr>
  </table>
  <br>

<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CalAbstractMixer Class Reference</h1><!-- doxytag: class="CalAbstractMixer" --><a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a> defines the API that CalModel relies on for blending and scheduling animations.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="mixer_8h_source.html">mixer.h</a>&gt;</code>
<p>
Inherited by CalMixer.
<p>

<p>
<a href="classCalAbstractMixer-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCalAbstractMixer.html#ca9e2de46a513da6722e4e7d0056bc50">isDefaultMixer</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the object an instance of the default mixer (i.e.  <a href="#ca9e2de46a513da6722e4e7d0056bc50"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCalAbstractMixer.html#6b50c54dcd5341d7a1ab41cc0a77b377">updateAnimation</a> (float deltaTime)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Notifies the instance that updateAnimation was last called deltaTime seconds ago.  <a href="#6b50c54dcd5341d7a1ab41cc0a77b377"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCalAbstractMixer.html#dff9c8c0110853b3e29c6c5fe4a31cbd">updateSkeleton</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Updates the skeleton of the corresponding CalModel (as provided to the create method) to match the current animation state (as updated by the last call to updateAnimation).  <a href="#dff9c8c0110853b3e29c6c5fe4a31cbd"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a> defines the API that CalModel relies on for blending and scheduling animations. 
<p>
A third party mixer must implement this API in order to register itself with the CalModel::setAbstractMixer method. The default mixer (CalMixer) is an example of such implementation.<p>
cal3d expects a mixer to handle two tasks : scheduling and blending. Scheduling refers to everything related to time such as when an animation must run or when it must stop. Blending defines how concurrent animations influence each other: for instance walking and waving.<p>
If CalMixer proves to be insufficient for the applications needs, an alternate mixer can be implemented and used without notifying cal3d in any way. It is not mandatory to subclass <a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a>. However, when chosing this path, one must also avoid using the CalModel::update method because it would use the default mixer instantiated by the CalModel::create method with undesirable side effects. In addition libraries based on cal3d (think NebulaDevice or OpenSceneGraph adapters) are not aware of these constraints and will keep calling the CalModel::update method of CalModel regardless.<p>
Subclassing <a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a> when implementing an alternate mixer therefore provides a better integration with cal3d and libraries that rely on CalModel. However, an additional effort is required in order to achieve compatibility with libraries or applications that rely on the CalMixer API (i.e. that use methods such as blendCycle or executeAction). The CalMixer API is not meant to be generic and there is no reason to define an abstract class that specifies it. For historical reasons and because CalMixer is the default mixer, some applications and libraries (think Soya or CrystalSpace) depend on it. If they want to switch to a scheduler with extended capabilities it might be painfull for them to learn a completely different API. A scheduler with the ambition to obsolete CalMixer should therefore provide an API compatible with it to ease the migration process.<p>
Short summary, if you want to write a new mixer:<p>
1) An external mixer: ignore <a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a> and implement a mixer of your own. Avoid calling CalModel::update and any library or application that will call it behind your back. Avoid libraries and applications that rely on the default mixer CalMixer, as returned by CalModel::getMixer.<p>
2) A mixer registered in cal3d : subclass <a class="el" href="classCalAbstractMixer.html" title="CalAbstractMixer defines the API that CalModel relies on for blending and scheduling...">CalAbstractMixer</a>, register it with CalModel::setAbstractMixer. Avoid libraries and applications that rely on the default mixer CalMixer, as returned by CalModel::getMixer. CalModel::getMixer will return a null pointer if CalModel::setAbstractMixer was called to set a mixer that is not an instance of CalMixer.<p>
3) A CalMixer replacement : same as 2) and provide a subclass of your own mixer that implements the CalMixer API so that existing applications can switch to it by calling CalModel::getAbstractMixer instead of CalModel::getMixer. The existing code using the CalMixer methods will keep working and the developper will be able to switch to a new API when convenient. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ca9e2de46a513da6722e4e7d0056bc50"></a><!-- doxytag: member="CalAbstractMixer::isDefaultMixer" ref="ca9e2de46a513da6722e4e7d0056bc50" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CalAbstractMixer::isDefaultMixer           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Is the object an instance of the default mixer (i.e. 
<p>
an instance of CalMixer) ?<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><ul>
<li><b>true</b> if an instance of CalMixer </li>
<li><b>false</b> if not an instance of CalMixer </li>
</ul>
</dd></dl>

</div>
</div><p>
<a class="anchor" name="6b50c54dcd5341d7a1ab41cc0a77b377"></a><!-- doxytag: member="CalAbstractMixer::updateAnimation" ref="6b50c54dcd5341d7a1ab41cc0a77b377" args="(float deltaTime)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CalAbstractMixer::updateAnimation           </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>deltaTime</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Notifies the instance that updateAnimation was last called deltaTime seconds ago. 
<p>
The internal scheduler of the instance should terminate animations or update the timing information of active animations accordingly. It should not blend animations together or otherwise modify the CalModel associated to these animations.<p>
The CalModel::update method will call updateSkeleton immediately after updateAnimation if the instance was allocated by CalModel::create (in which case it is a CalMixer instance) or if the instance was set via CalModel::setAbstractMixer.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>deltaTime</em>&nbsp;</td><td>The elapsed time in seconds since the last call. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="dff9c8c0110853b3e29c6c5fe4a31cbd"></a><!-- doxytag: member="CalAbstractMixer::updateSkeleton" ref="dff9c8c0110853b3e29c6c5fe4a31cbd" args="()=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void CalAbstractMixer::updateSkeleton           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Updates the skeleton of the corresponding CalModel (as provided to the create method) to match the current animation state (as updated by the last call to updateAnimation). 
<p>
The tracks of each active animation are blended to compute the position and orientation of each bone of the skeleton. The updateAnimation method should be called just before calling updateSkeleton to define the set of active animations.<p>
The CalModel::update method will call updateSkeleton immediately after updateAnimation if the instance was allocated by CalModel::create (in which case it is a CalMixer instance) or if the instance was set via CalModel::setAbstractMixer. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="mixer_8h_source.html">mixer.h</a></ul>
</div>
  <hr>
  <center>
    <small>
      Generated at Fri Jul 24 21:14:57 2009 by
      <a href="http://gna.org/projects/cal3d/">The Cal3D Team</a>
      with
      <a href="http://www.doxygen.org/index.html">
      Doxygen 1.5.9
      </a>
    </small>
  </center>
</body>
</html>