Files
o3de/Gems/EMotionFX/Code/Tests/TestAssetCode/MotionEvent.cpp
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

66 lines
2.6 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "Tests/TestAssetCode/MotionEvent.h"
#include <EMotionFX/Source/TwoStringEventData.h>
#include <AzCore/std/smart_ptr/shared_ptr.h>
namespace EMotionFX
{
// These functions make various configurations of events
void MakeNoEvents(MotionEventTrack* /*track*/)
{
}
void MakeOneRangedEvent(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> data = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("subject", "params");
track->AddEvent(0.25f, 0.75f, data);
}
void MakeOneEvent(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> data = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("subject", "params");
track->AddEvent(0.25f, data);
}
void MakeTwoEvents(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> data = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("subject", "params");
track->AddEvent(0.25f, data);
track->AddEvent(0.75f, data);
}
void MakeThreeEvents(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> data = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("subject", "params");
track->AddEvent(0.25f, data);
track->AddEvent(0.75f, data);
track->AddEvent(1.25f, data);
}
void MakeThreeRangedEvents(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> data = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("subject", "params");
track->AddEvent(0.25f, 0.5f, data);
track->AddEvent(0.75f, 1.0f, data);
track->AddEvent(1.25f, 1.5f, data);
}
void MakeTwoLeftRightEvents(MotionEventTrack* track)
{
AZStd::shared_ptr<const TwoStringEventData> leftEventData = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("Left", "params", "Right");
AZStd::shared_ptr<const TwoStringEventData> rightEventData = GetEMotionFX().GetEventManager()->FindOrCreateEventData<TwoStringEventData>("Right", "params", "Left");
track->AddEvent(0.0f, leftEventData);
track->AddEvent(1.0f, rightEventData);
track->AddEvent(2.0f, leftEventData);
track->AddEvent(3.0f, rightEventData);
}
} // end namespace EMotionFX