本文整理汇总了C++中Animation::addChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::addChannel方法的具体用法?C++ Animation::addChannel怎么用?C++ Animation::addChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::addChannel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cloneInto
void AnimationTarget::cloneInto(AnimationTarget* target, NodeCloneContext &context) const
{
if (_animationChannels)
{
for (std::vector<Animation::Channel*>::const_iterator it = _animationChannels->begin(); it != _animationChannels->end(); ++it)
{
Animation::Channel* channel = *it;
GP_ASSERT(channel);
GP_ASSERT(channel->_animation);
Animation* animation = context.findClonedAnimation(channel->_animation);
if (animation != NULL)
{
Animation::Channel* channelCopy = new Animation::Channel(*channel, animation, target);
animation->addChannel(channelCopy);
}
else
{
// Clone the animation and register it with the context so that it only gets cloned once.
animation = channel->_animation->clone(channel, target);
context.registerClonedAnimation(channel->_animation, animation);
}
}
}
}
示例2: clone
Animation* Animation::clone(Channel* channel, AnimationTarget* target)
{
GP_ASSERT(channel);
Animation* animation = new Animation(getId());
Animation::Channel* channelCopy = new Animation::Channel(*channel, animation, target);
animation->addChannel(channelCopy);
// Release the animation because a newly created animation has a ref count of 1 and the channels hold the ref to animation.
animation->release();
GP_ASSERT(animation->getRefCount() == 1);
// Clone the clips
if (_defaultClip)
{
animation->_defaultClip = _defaultClip->clone(animation);
}
if (_clips)
{
for (std::vector<AnimationClip*>::iterator it = _clips->begin(); it != _clips->end(); ++it)
{
AnimationClip* newClip = (*it)->clone(animation);
animation->addClip(newClip);
}
}
return animation;
}
示例3: clone
Animation* Animation::clone(Channel* channel, AnimationTarget* target)
{
Animation* animation = new Animation(getId());
Animation::Channel* channelCopy = new Animation::Channel(*channel, animation, target);
animation->addChannel(channelCopy);
// Release the animation because a newly created animation has a ref count of 1 and the channels hold the ref to animation.
animation->release();
assert(animation->getRefCount() == 1);
return animation;
}