本文整理汇总了C++中CChoreoEvent::PreventTagOverlap方法的典型用法代码示例。如果您正苦于以下问题:C++ CChoreoEvent::PreventTagOverlap方法的具体用法?C++ CChoreoEvent::PreventTagOverlap怎么用?C++ CChoreoEvent::PreventTagOverlap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChoreoEvent
的用法示例。
在下文中一共展示了CChoreoEvent::PreventTagOverlap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReconcileGestureTimes
void CChoreoChannel::ReconcileGestureTimes()
{
// Sort gesture events within channel by starting time
CUtlRBTree< CChoreoEvent * > sortedGestures( 0, 0, ChoreEventStartTimeLessFunc );
int i;
// Sort items
int c = GetNumEvents();
for ( i = 0; i < c; i++ )
{
CChoreoEvent *e = GetEvent( i );
Assert( e );
if ( e->GetType() != CChoreoEvent::GESTURE )
continue;
sortedGestures.Insert( e );
}
// Now walk list of gestures
if ( !sortedGestures.Count() )
return;
CChoreoEvent *previous = NULL;
for ( i = sortedGestures.FirstInorder(); i != sortedGestures.InvalidIndex(); i = sortedGestures.NextInorder( i ) )
{
CChoreoEvent *event = sortedGestures[ i ];
if ( !previous )
{
// event->SetStartTime( 0.0f );
}
else if ( previous->GetSyncToFollowingGesture() )
{
// TODO: ask the sequence for what tags to match
CEventAbsoluteTag *pEntryTag = event->FindEntryTag( CChoreoEvent::PLAYBACK );
CEventAbsoluteTag *pExitTag = previous->FindExitTag( CChoreoEvent::PLAYBACK );
if (pEntryTag && pExitTag)
{
float entryTime = pEntryTag->GetAbsoluteTime( );
// get current decay rate of previous gesture
float duration = previous->GetDuration();
float decayTime = (1.0 - pExitTag->GetPercentage()) * duration;
// adjust the previous gestures end time to current apex + existing decay rate
previous->RescaleGestureTimes( previous->GetStartTime(), entryTime + decayTime, true );
previous->SetEndTime( entryTime + decayTime );
// set the previous gestures end tag to the current apex
pExitTag->SetAbsoluteTime( entryTime );
event->PreventTagOverlap( );
previous->PreventTagOverlap( );
}
// BUG: Tracker 3298: ywb 1/31/04
// I think this fixes the issue with abutting past NULL gestures on paste:
// Here's the bug report:
// -------------------------
// When copying and pasteing posture and gesture clips in face poser the beginings of the clips stretch
// to the begining of the scene even if there is a null gesture in place at the begining.
// -------------------------
/*
else if ( pEntryTag && !Q_stricmp( previous->GetName(), "NULL" ) )
{
// If the previous was a null event, then do a bit of fixup
event->SetStartTime( previous->GetEndTime() );
event->PreventTagOverlap( );
}
*/
// The previous event decays from it's end dispaly end time to the current event's display start time
// The next event starts just after the display end time of the previous event
}
previous = event;
}
if ( previous )
{
CChoreoScene *scene = previous->GetScene();
if ( scene )
{
// HACK: Could probably do better by allowing user to drag the blue "end time" bar
//float finish = scene->FindStopTime();
//previous->RescaleGestureTimes( previous->GetStartTime(), finish );
//previous->SetEndTime( finish );
}
}
/*
c = 0;
for ( i = sortedGestures.FirstInorder(); i != sortedGestures.InvalidIndex(); i = sortedGestures.NextInorder( i ) )
{
CChoreoEvent *event = sortedGestures[ i ];
Msg( "event %i start %f disp %f dispend %f end %f\n",
c + 1,
//.........这里部分代码省略.........