The Cal3D developers are proud to release version 0.10.0 of the Open Source 3D character animation library. About 13 months after version 0.9.1 hit the road, this release is a major update and adds many new features. The list of these features is long and some minor changes are needed to convert to Cal3D 0.10.0
Previously, Cal3D used create/destroy functions for all the classes. These functions have been removed because they were redundant with constructor/destructor functions.
Because of this, applications using Cal3D need be updated. All calls to create/destroy need to be removed and arguments of the create function need to be passed to the constructor.
Core objects (coreAnimation, coreSkeleton, coreMesh...) can be shared between several models. But with the old API it's impossible to correctly release memory. A counter has been added to each of the core objects to prevent the deletion of an object that is still used. Objects can now be shared between several coremodel correctly.
The Renderer object allows retrieving geometry data during the rendering of the model. Since 3D APIs like Direct3D have evolved and now use flexible vertex buffers, it's now easy to fill the vertex buffer directly with the new (optional) argument :
pCalRenderer->getTangentSpaces(bumpId,&pVertex->Tangents.x,sizeof(VERTEX));
Rem: Be careful with these functions because it can be slower.
The old XML file format wasn't legal XML. This is now fixed.
For compatibility, the old format can still be loaded. But be careful to not try to load a new file with an old version of Cal3D
You can use the static function CalLoader::setLoadingMode(int flags). Possible flags are LOADER_ROTATE_X_AXIS and LOADER_INVERT_V_COORD.
In previous versions of Cal3D, the face orientation wasn't always correct and for some model it was necessary to set the cull mode to none. It's now not necessary anymore.
You can use the following Functions :
static CalCoreAnimation *loadCoreAnimation(std::istream& inputStream, CalCoreSkeleton *skel=NULL);Note : only binary formats are supported
Since version 0.9.0 of Cal3D there was a sample to show how to use vertex shader to animate with Cal3D. In this new release, a set of functions can now be used to do this easily : the class CalHardwareModel has been added. You can look at the code source of the two new miniviewers (one OpenGL and one Direct3D) for more information. Note : the spring system needs to be disabled when using this feature.
A time factor allows playback of several animations at different speeds. You can use CalMixer::setTimeFactor(float timeFactor) for cycle animations or CalAnimation::setTimeFactor(float timeFactor) for action animations.
Rem : negative time factor to allow reverse animation is supported
The CalMixer class is now based on an abstract class (CalAbstractMixer) from which the application can implement a different mixer. The new mixer can be registered using the CalModel::setAbstractMixer method. The mixer currently in use for a given CalModel instance can be retrieved with the CalModel::getAbstractMixer method. This addition is backward compatible.
The new class CalAnimationCallback and the functions :
void CalCoreAnimation::registerCallback(CalAnimationCallback *callback,float min_interval)can be used to set functions that will be called when the animation is active.
An new parameter has been added to the CalMixer::executeAction() function :
bool CalMixer::executeAction(int id, float delayIn, float delayOut, float weightTarget, bool autoLock=false)
A few functions have been added to provide easy access to core objects :
int CalCoreModel::getCoreAnimationId(const std::string& strAnimationName);The function void CalCoreModel::scale(float factor) can be used to scale a model.
This function directly modifies all the meshes, skeletons and animations. You can use it only before creating the CalModel. Spring systems are also disabled.
The gravity vector and the force vector can now be set
void CalSpringSystem::setGravityVector(const CalVector & vGravity);As previous version of Cal3D, the vector force is set to (0.0f, 0.5f, 0.0f) by default (to simulate some movement)
This new feature can be enabled with the function :
void CalSpringSystem::setCollisionDetection(bool collision);
Note : Bounding box calculation need to be actived for this feature. You can uncomment a few lines in Model::onRender() to test.
The bounding box of the model can be retrieved with the CalBoundingBox & CalModel::getBoundingBox(bool precision) function
There are now six sample applications. Three new miniviewers have been added to the main distribution:
Cal3D 0.10.0 is the first version to provide a maya exporter. This version is still beta and is probably not bug-free. Try it and let us know!
The 3DSMax exporter has been improved :
Export_cal3D is an all-in-one export maxscript based on the 0.9.2+ 'maxscript-extended' version of the exporter plugin for Max6.
Define the objects that compose your character, specify the root bone(s), create a list of the animations segments, tune original export parameters then click Export. Additional features include automatic cal3d.cfg creation, post-export mini-viewer, animations definition and per-scene configuration.