17 : _name(name), _lengthSec(duration)
47 it.second->getKeyframesAtTime(time, &kf1, &kf2);
48 if (kf2->
time() < result && kf2->
time() >= time)
72 it.second->getKeyframesAtTime(time, &kf1, &kf2);
73 if (kf1->
time() > result && kf1->
time() <= time)
86 if (it.second->animatedNode() == node)
99 for (; it !=
_nodeAnimTracks.end() && freeIndex == it->first; ++it, ++freeIndex)
124 it.second->apply(time, weight, scale);
135 it.second->applyToNode(node, time, weight, scale);
148 it.second->applyToNode(joint, time, weight, scale);
157 it.second->drawVisuals(
sv);
165 it.second->animatedNode()->resetToInitialState();
315 assert(axisA != axisB && radiusA > 0 && radiusB > 0);
334 A.
comp[axisA] = radiusA;
336 B.
comp[axisB] = radiusB;
338 C.
comp[axisA] = -radiusA;
340 D.
comp[axisB] = -radiusB;
347 for (
SLuint i = 0; i < controls.size(); ++i)
348 controls[i].
set(0, 0, 0);
349 controls[0].comp[axisA] = radiusA;
350 controls[0].comp[axisB] = k * radiusB;
351 controls[1].comp[axisB] = radiusB;
352 controls[1].comp[axisA] = k * radiusA;
353 controls[2].comp[axisB] = radiusB;
354 controls[2].comp[axisA] = k * -radiusA;
355 controls[3].comp[axisA] = -radiusA;
356 controls[3].comp[axisB] = k * radiusB;
357 controls[4].comp[axisA] = -radiusA;
358 controls[4].comp[axisB] = k * -radiusB;
359 controls[5].comp[axisB] = -radiusB;
360 controls[5].comp[axisA] = k * -radiusA;
361 controls[6].comp[axisB] = -radiusB;
362 controls[6].comp[axisA] = k * radiusA;
363 controls[7].comp[axisA] = radiusA;
364 controls[7].comp[axisB] = k * -radiusB;
SLAxis
Coordinate axis enumeration.
SLQuat4< SLfloat > SLQuat4f
vector< SLVec3f > SLVVec3f
vector< SLVec4f > SLVVec4f
Base class for all animation keyframes.
SLAnimSkeleton keeps track of a skeletons joints and animations.
SLJoint * getJoint(SLuint id)
SLAnimKeyframe * keyframe(SLint index)
SLint numKeyframes() const
SLNodeAnimTrack * createNodeAnimTrackForRotation(SLNode *target, SLfloat angleDeg1, const SLVec3f &axis)
void drawNodeVisuals(SLSceneView *sv)
SLAnimation(const SLstring &name, SLfloat duration)
SLNodeAnimTrack * createNodeAnimTrackForRotation360(SLNode *target, const SLVec3f &axis)
SLMNodeAnimTrack _nodeAnimTracks
map of all the node tracks in this animation
SLNodeAnimTrack * createNodeAnimTrack()
SLfloat _lengthSec
duration of the animation in seconds
SLfloat lengthSec() const
SLfloat prevKeyframeTime(SLfloat time)
SLNodeAnimTrack * createNodeAnimTrackForRotation3(SLNode *target, SLfloat angleDeg0, SLfloat angleDeg1, SLfloat angleDeg2, const SLVec3f &axis)
SLbool affectsNode(SLNode *node)
SLNodeAnimTrack * createNodeAnimTrackForTranslation(SLNode *target, const SLVec3f &endPos)
SLNodeAnimTrack * createNodeAnimTrackForRotation4(SLNode *target, SLfloat angleDeg0, SLfloat angleDeg1, SLfloat angleDeg2, SLfloat angleDeg3, const SLVec3f &axis)
SLNodeAnimTrack * createNodeAnimTrackForScaling(SLNode *target, const SLVec3f &endScale)
void apply(SLfloat time, SLfloat weight=1.0f, SLfloat scale=1.0f)
SLfloat nextKeyframeTime(SLfloat time)
void applyToNode(SLNode *node, SLfloat time, SLfloat weight=1.0f, SLfloat scale=1.0f)
SLNodeAnimTrack * createNodeAnimTrackForEllipse(SLNode *target, SLfloat radiusA, SLAxis axisA, SLfloat radiusB, SLAxis axisB)
SLNodeAnimTrack * createNodeAnimTrackForRotation2(SLNode *target, SLfloat angleDeg0, SLfloat angleDeg1, const SLVec3f &axis)
The SLCurveBezier class implements a Bezier curve interpolation.
Specialized SLNode that represents a single joint (or bone) in a skeleton.
Specialized animation track for node animations.
void animatedNode(SLNode *target)
void interpolationCurve(SLCurve *curve)
SLTransformKeyframe * createNodeKeyframe(SLfloat time)
void translationInterpolation(SLAnimInterpolation interp)
SLNode represents a node in a hierarchical scene graph.
SceneView class represents a dynamic real time 3D view onto the scene.
void set(std::string path, const std::vector< char > &data)