MCPcopy Create free account
hub / github.com/carbonengine/trinity / Start

Method Start

trinity/Controllers/Actions/Tr2ActionPlayMeshAnimation.cpp:36–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void Tr2ActionPlayMeshAnimation::Start( ITr2ActionController& controller )
37{
38 if( m_animation.empty() )
39 {
40 return;
41 }
42 if( HasDelayedBinding() )
43 {
44 LinkDestination( controller );
45 }
46 ITr2GrannyAnimationOwnerPtr owner = BlueCastPtr( m_destinationType == DestinationType::OWNER ? controller.GetOwner() : m_destination.GetBoundObject() );
47 if( !owner )
48 {
49 return;
50 }
51 auto ac = owner->GetAnimationController();
52 if( !ac )
53 {
54 return;
55 }
56 if( !m_mask.empty() )
57 {
58 ac->AddAnimationLayerWithTrackMask( m_mask.c_str(), m_mask.c_str() );
59 }
60 ac->PlayLayerAnimationByName( m_mask.empty() ? nullptr : m_mask.c_str(), m_animation.c_str(), m_playAction == PLAY, std::max( m_loops, 0 ), m_delay, m_speed, false );
61}
62
63void Tr2ActionPlayMeshAnimation::Stop( ITr2ActionController& controller )
64{

Callers

nothing calls this directly

Calls 6

emptyMethod · 0.80
GetBoundObjectMethod · 0.80
GetOwnerMethod · 0.45

Tested by

no test coverage detected