本文整理汇总了C++中ActorPtr::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorPtr::Get方法的具体用法?C++ ActorPtr::Get怎么用?C++ ActorPtr::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorPtr
的用法示例。
在下文中一共展示了ActorPtr::Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAnimation
AnimationPtr ModelActorFactory::CreateAnimation(
Actor& rootActor,
const ModelAnimationMap* animationData,
AlphaFunction alpha,
float durationSeconds)
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gModel);
AnimationPtr animation(Animation::New(durationSeconds));
animation->SetDefaultAlphaFunction(alpha);
for(EntityAnimatorMapIter it = animationData->animators.begin(); it != animationData->animators.end(); ++it)
{
const EntityAnimatorMap& entityAnimator(*it);
// find actor for this animator
ActorPtr animatedActor = rootActor.FindChildByName(entityAnimator.GetEntityName());
if (!animatedActor)
{
// If we can't find the actor, it may not have been instantiated, may
// be a sibling or parent of rootActor or may have been removed.
continue;
}
Dali::Actor targetActor(animatedActor.Get());
Dali::KeyFrames posKFHandle = entityAnimator.GetPositionKeyFrames();
if(posKFHandle)
{
const KeyFrames& positionKeyFrames = GetImplementation(posKFHandle);
if(positionKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::POSITION),
positionKeyFrames, alpha, durationSeconds);
}
}
Dali::KeyFrames scaleKFHandle = entityAnimator.GetScaleKeyFrames();
if(scaleKFHandle)
{
const KeyFrames& scaleKeyFrames = GetImplementation(scaleKFHandle);
if(scaleKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::SCALE), scaleKeyFrames, alpha, durationSeconds);
}
}
Dali::KeyFrames rotationKFHandle = entityAnimator.GetRotationKeyFrames();
if(rotationKFHandle)
{
const KeyFrames& rotationKeyFrames = GetImplementation(rotationKFHandle);
if(rotationKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
{
animation->AnimateBetween(Property(targetActor, Dali::Actor::ROTATION), rotationKeyFrames, alpha, durationSeconds);
}
}
}
return animation;
}
示例2: BindBonesToMeshActors
void ModelActorFactory::BindBonesToMeshActors(ActorPtr rootActor, ActorPtr actorPtr)
{
MeshActor* meshActor = dynamic_cast<MeshActor*>(actorPtr.Get());
if(meshActor)
{
meshActor->BindBonesToMesh(rootActor);
}
// Descend to all child actors, not just mesh actors
const ActorContainer& children = actorPtr->GetChildren();
for ( ActorConstIter iter = children.begin(); iter != children.end(); ++iter)
{
ActorPtr childActor = const_cast<Actor*>(&GetImplementation(*iter));
BindBonesToMeshActors(rootActor, childActor);
}
}
示例3: RecurseNew
ActorPtr ModelActorFactory::RecurseNew(ModelDataPtr modelData, Dali::Entity entity)
{
ActorPtr actorPtr;
if(entity.HasMeshes())
{
actorPtr = Internal::MeshActor::New(modelData, entity);
}
else
{
// Root with no mesh, or bone/joint actor (with no mesh)
actorPtr = Internal::Actor::New();
actorPtr->SetName(entity.GetName());
Matrix transform(entity.GetTransformMatrix());
Vector3 position;
Quaternion rotation;
Vector3 scale;
transform.GetTransformComponents(position, rotation, scale);
actorPtr->SetPosition(position);
actorPtr->SetRotation(rotation);
actorPtr->SetScale(scale);
}
actorPtr->SetParentOrigin(ParentOrigin::CENTER);
actorPtr->SetAnchorPoint(AnchorPoint::CENTER);
if (entity.HasChildren())
{
for (EntityConstIter iter = entity.GetChildren().begin(); iter != entity.GetChildren().end(); ++iter)
{
Dali::Entity childEntity = (*iter);
ActorPtr child = RecurseNew(modelData, childEntity);
actorPtr->Add(*child.Get());
}
}
return actorPtr;
}