Files
UnrealEngineUWP/Engine/Source/Runtime/GeometryCache/Private/GeometryCacheTrackTransformAnimation.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

44 lines
1.3 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "GeometryCacheModulePrivatePCH.h"
#include "GeometryCacheTrackTransformAnimation.h"
GEOMETRYCACHE_API UGeometryCacheTrack_TransformAnimation::UGeometryCacheTrack_TransformAnimation(const FObjectInitializer& ObjectInitializer /*= FObjectInitializer::Get()*/) : UGeometryCacheTrack(ObjectInitializer)
{
}
SIZE_T UGeometryCacheTrack_TransformAnimation::GetResourceSize(EResourceSizeMode::Type Mode)
{
SIZE_T ResourceSize = 0;
ResourceSize += UGeometryCacheTrack::GetResourceSize(Mode);
ResourceSize += MeshData.GetResourceSize();
return ResourceSize;
}
void UGeometryCacheTrack_TransformAnimation::Serialize(FArchive& Ar)
{
UGeometryCacheTrack::Serialize(Ar);
Ar << MeshData;
}
const bool UGeometryCacheTrack_TransformAnimation::UpdateMeshData(const float Time, const bool bLooping, int32& InOutMeshSampleIndex, FGeometryCacheMeshData*& OutMeshData)
{
// If InOutMeshSampleIndex equals -1 (first creation) update the OutVertices and InOutMeshSampleIndex
if (InOutMeshSampleIndex == -1)
{
OutMeshData = &MeshData;
InOutMeshSampleIndex = 0;
return true;
}
return false;
}
void UGeometryCacheTrack_TransformAnimation::SetMesh(const FGeometryCacheMeshData& NewMeshData)
{
MeshData = NewMeshData;
NumMaterials = NewMeshData.BatchesInfo.Num();
}