本文整理汇总了C++中FByteBulkData::SetBulkDataAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ FByteBulkData::SetBulkDataAlignment方法的具体用法?C++ FByteBulkData::SetBulkDataAlignment怎么用?C++ FByteBulkData::SetBulkDataAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FByteBulkData
的用法示例。
在下文中一共展示了FByteBulkData::SetBulkDataAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBinaryData
FByteBulkData* UPhysicsSerializer::GetBinaryData(FName Format, const TArray<FBodyInstance*>& Bodies, const TArray<class UBodySetup*>& BodySetups, const TArray<class UPhysicalMaterial*>& PhysicalMaterials)
{
if (!FParse::Param(FCommandLine::Get(), TEXT("PhysxSerialization")))
{
return nullptr;
}
#if PLATFORM_MAC
return nullptr; //This is not supported right now
#endif
QUICK_SCOPE_CYCLE_COUNTER(STAT_GetBinaryData);
const bool bContainedData = BinaryFormatData.Contains(Format);
FByteBulkData* Result = &BinaryFormatData.GetFormat(Format);
if (!FParse::Param(FCommandLine::Get(), TEXT("NoPhysxAlignment")))
{
Result->SetBulkDataAlignment(PHYSX_SERIALIZATION_ALIGNMENT);
}
if (!bContainedData)
{
#if WITH_EDITOR
#if WITH_PHYSX
TArray<uint8> OutData;
FDerivedDataPhysXBinarySerializer* DerivedPhysXSerializer = new FDerivedDataPhysXBinarySerializer(Format, Bodies, BodySetups, PhysicalMaterials, FGuid::NewGuid()); //TODO: Maybe it's worth adding this to the DDC. For now there's a lot of complexity with the guid invalidation so I've left it out.
if (DerivedPhysXSerializer->CanBuild())
{
DerivedPhysXSerializer->Build(OutData);
#endif
if (OutData.Num())
{
Result->Lock(LOCK_READ_WRITE);
FMemory::Memcpy(Result->Realloc(OutData.Num()), OutData.GetData(), OutData.Num());
Result->Unlock();
}
}
else
#endif
{
UE_LOG(LogPhysics, Warning, TEXT("Attempt to use binary physics data but we are unable to."));
}
}
return Result->GetBulkDataSize() > 0 ? Result : nullptr;
}