Hi, all
I have created a new branch (animation) for attribute animation system. In the system, all attribute in an Animatable object(Node, Scene, Component, UIElement) can be animated.
For example, we can apply an animation to light’s color attribute like this:
[code]
Node* lightNode = scene_->CreateChild(“DirectionalLight”);
lightNode->SetDirection(Vector3(0.6f, -1.0f, 0.8f)); // The direction vector does not need to be normalized
Light* light = lightNode->CreateComponent();
light->SetLightType(LIGHT_DIRECTIONAL);
/// Create light color animation
SharedPtr<AttributeAnimation> colorAnimation(new AttributeAnimation(context_));
colorAnimation->SetValueType(VAR_COLOR);
colorAnimation->AddKeyFrame(0.0f, Color::WHITE);
colorAnimation->AddKeyFrame(1.0f, Color::RED);
colorAnimation->AddKeyFrame(2.0f, Color::GREEN);
colorAnimation->AddKeyFrame(3.0f, Color::WHITE);
light->SetAttributeAnimation("Color", colorAnimation);[/code]
This is a simple usage for attribute system.
Also we can create an animation file, it include all animation for a scene, it can be loaded and apply a scene.
Current the animation system is beginning, If you have good idea on it, please tell us. thank you.