本文整理汇总了C++中FPhysSubstepTask::AddForceAtPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ FPhysSubstepTask::AddForceAtPosition方法的具体用法?C++ FPhysSubstepTask::AddForceAtPosition怎么用?C++ FPhysSubstepTask::AddForceAtPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPhysSubstepTask
的用法示例。
在下文中一共展示了FPhysSubstepTask::AddForceAtPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddForceAtPosition
void FPhysScene::AddForceAtPosition(FBodyInstance * BodyInstance, const FVector & Force, const FVector & Position)
{
#if WITH_PHYSX
if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic())
{
#if WITH_SUBSTEPPING
if (IsSubstepping())
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
PhysSubStepper->AddForceAtPosition(BodyInstance, Force, Position);
}
else
#endif
{
SCOPED_SCENE_WRITE_LOCK(PRigidDynamic->getScene());
PxRigidBodyExt::addForceAtPos(*PRigidDynamic, U2PVector(Force), U2PVector(Position), PxForceMode::eFORCE, true);
}
}
#endif
}
示例2: AddForceAtPosition
void FPhysScene::AddForceAtPosition(FBodyInstance* BodyInstance, const FVector& Force, const FVector& Position, bool bAllowSubstepping)
{
#if WITH_PHYSX
if (PxRigidBody * PRigidBody = BodyInstance->GetPxRigidBody())
{
#if WITH_SUBSTEPPING
uint32 BodySceneType = SceneType(BodyInstance);
if (bAllowSubstepping && IsSubstepping(BodySceneType))
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[BodySceneType];
PhysSubStepper->AddForceAtPosition(BodyInstance, Force, Position);
}
else
#endif
{
SCOPED_SCENE_WRITE_LOCK(PRigidBody->getScene());
PxRigidBodyExt::addForceAtPos(*PRigidBody, U2PVector(Force), U2PVector(Position), PxForceMode::eFORCE, true);
}
}
#endif
}