本文整理汇总了C++中FTransform::Accumulate方法的典型用法代码示例。如果您正苦于以下问题:C++ FTransform::Accumulate方法的具体用法?C++ FTransform::Accumulate怎么用?C++ FTransform::Accumulate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTransform
的用法示例。
在下文中一共展示了FTransform::Accumulate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoCustomNavigableGeometryExport
bool UDestructibleComponent::DoCustomNavigableGeometryExport(FNavigableGeometryExport& GeomExport) const
{
#if WITH_APEX
if (ApexDestructibleActor == NULL)
{
return false;
}
NxDestructibleActor* DestrActor = const_cast<NxDestructibleActor*>(ApexDestructibleActor);
const FTransform ComponentToWorldNoScale(ComponentToWorld.GetRotation(), ComponentToWorld.GetTranslation(), FVector(1.f));
TArray<PxShape*> Shapes;
Shapes.AddUninitialized(8);
PxRigidDynamic** PActorBuffer = NULL;
PxU32 PActorCount = 0;
if (DestrActor->acquirePhysXActorBuffer(PActorBuffer, PActorCount
, NxDestructiblePhysXActorQueryFlags::Static
| NxDestructiblePhysXActorQueryFlags::Dormant
| NxDestructiblePhysXActorQueryFlags::Dynamic))
{
uint32 ShapesExportedCount = 0;
while (PActorCount--)
{
const PxRigidDynamic* PActor = *PActorBuffer++;
if (PActor != NULL)
{
const FTransform PActorGlobalPose = P2UTransform(PActor->getGlobalPose());
const PxU32 ShapesCount = PActor->getNbShapes();
if (ShapesCount > PxU32(Shapes.Num()))
{
Shapes.AddUninitialized(ShapesCount - Shapes.Num());
}
const PxU32 RetrievedShapesCount = PActor->getShapes(Shapes.GetData(), Shapes.Num());
PxShape* const* ShapePtr = Shapes.GetData();
for (PxU32 ShapeIndex = 0; ShapeIndex < RetrievedShapesCount; ++ShapeIndex, ++ShapePtr)
{
if (*ShapePtr != NULL)
{
const PxTransform LocalPose = (*ShapePtr)->getLocalPose();
FTransform LocalToWorld = P2UTransform(LocalPose);
LocalToWorld.Accumulate(PActorGlobalPose);
switch((*ShapePtr)->getGeometryType())
{
case PxGeometryType::eCONVEXMESH:
{
PxConvexMeshGeometry Geometry;
if ((*ShapePtr)->getConvexMeshGeometry(Geometry))
{
++ShapesExportedCount;
// @todo address Geometry.scale not being used here
GeomExport.ExportPxConvexMesh(Geometry.convexMesh, LocalToWorld);
}
}
break;
case PxGeometryType::eTRIANGLEMESH:
{
// @todo address Geometry.scale not being used here
PxTriangleMeshGeometry Geometry;
if ((*ShapePtr)->getTriangleMeshGeometry(Geometry))
{
++ShapesExportedCount;
if ((Geometry.triangleMesh->getTriangleMeshFlags()) & PxTriangleMeshFlag::eHAS_16BIT_TRIANGLE_INDICES)
{
GeomExport.ExportPxTriMesh16Bit(Geometry.triangleMesh, LocalToWorld);
}
else
{
GeomExport.ExportPxTriMesh32Bit(Geometry.triangleMesh, LocalToWorld);
}
}
}
default:
{
UE_LOG(LogPhysics, Log, TEXT("UDestructibleComponent::DoCustomNavigableGeometryExport(): unhandled PxGeometryType, %d.")
, int32((*ShapePtr)->getGeometryType()));
}
break;
}
}
}
}
}
ApexDestructibleActor->releasePhysXActorBuffer();
INC_DWORD_STAT_BY(STAT_Navigation_DestructiblesShapesExported, ShapesExportedCount);
}
#endif // WITH_APEX
// we don't want a regular geometry export
return false;
}