本文整理汇总了C++中FPhysSubstepTask类的典型用法代码示例。如果您正苦于以下问题:C++ FPhysSubstepTask类的具体用法?C++ FPhysSubstepTask怎么用?C++ FPhysSubstepTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FPhysSubstepTask类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TermBody_AssumesLocked
void FPhysScene::TermBody_AssumesLocked(FBodyInstance* BodyInstance)
{
if (PxRigidBody* PRigidBody = BodyInstance->GetPxRigidBody_AssumesLocked())
{
#if WITH_SUBSTEPPING
FPhysSubstepTask* PhysSubStepper = PhysSubSteppers[SceneType_AssumesLocked(BodyInstance)];
PhysSubStepper->RemoveBodyInstance_AssumesLocked(BodyInstance);
#endif
}
// Remove body from any pending deferred addition / removal
for(FDeferredSceneData& Deferred : DeferredSceneData)
{
int32 FoundIdx = INDEX_NONE;
if(Deferred.AddInstances.Find(BodyInstance, FoundIdx))
{
Deferred.AddActors.RemoveAtSwap(FoundIdx);
Deferred.AddInstances.RemoveAtSwap(FoundIdx);
}
}
#if WITH_PHYSX
RemoveActiveBody(BodyInstance, PST_Sync);
RemoveActiveBody(BodyInstance, PST_Async);
#endif
}
示例2: SceneType_AssumesLocked
bool FPhysScene::GetKinematicTarget_AssumesLocked(const FBodyInstance* BodyInstance, FTransform& OutTM) const
{
#if WITH_PHYSX
if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic_AssumesLocked())
{
#if WITH_SUBSTEPPING
uint32 BodySceneType = SceneType_AssumesLocked(BodyInstance);
if (IsSubstepping(BodySceneType))
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[BodySceneType];
return PhysSubStepper->GetKinematicTarget_AssumesLocked(BodyInstance, OutTM);
}
else
#endif
{
PxTransform POutTM;
bool validTM = PRigidDynamic->getKinematicTarget(POutTM);
if (validTM)
{
OutTM = P2UTransform(POutTM);
return true;
}
}
}
#endif
return false;
}
示例3: SetKinematicTarget
void FPhysScene::SetKinematicTarget(FBodyInstance * BodyInstance, const FTransform & TargetTransform)
{
TargetTransform.DiagnosticCheckNaN_All();
#if WITH_PHYSX
if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic())
{
#if WITH_SUBSTEPPING
if (IsSubstepping())
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
PhysSubStepper->SetKinematicTarget(BodyInstance, TargetTransform);
}
else
#endif
{
const PxTransform PNewPose = U2PTransform(TargetTransform);
check(PNewPose.isValid());
SCOPED_SCENE_WRITE_LOCK(PRigidDynamic->getScene());
PRigidDynamic->setKinematicTarget(PNewPose);
}
}
#endif
}
示例4: TermBody
void FPhysScene::TermBody(FBodyInstance * BodyInstance)
{
#if WITH_SUBSTEPPING
if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic())
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
PhysSubStepper->RemoveBodyInstance(BodyInstance);
}
#endif
}
示例5: TermBody
void FPhysScene::TermBody(FBodyInstance* BodyInstance)
{
#if WITH_SUBSTEPPING
if (PxRigidBody * PRigidBody = BodyInstance->GetPxRigidBody())
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
PhysSubStepper->RemoveBodyInstance(BodyInstance);
}
#endif
#if WITH_PHYSX
RemoveActiveBody(BodyInstance, PST_Sync);
RemoveActiveBody(BodyInstance, PST_Async);
#endif
}
示例6: AddTorque
void FPhysScene::AddTorque(FBodyInstance * BodyInstance, const FVector & Torque)
{
#if WITH_PHYSX
if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic())
{
#if WITH_SUBSTEPPING
if (IsSubstepping())
{
FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
PhysSubStepper->AddTorque(BodyInstance, Torque);
}
else
#endif
{
SCOPED_SCENE_WRITE_LOCK(PRigidDynamic->getScene());
PRigidDynamic->addTorque(U2PVector(Torque), PxForceMode::eFORCE, true);
}
}
#endif
}
示例7: 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
}
示例8: SceneType
void FPhysScene::AddTorque(FBodyInstance* BodyInstance, const FVector& Torque, 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->AddTorque(BodyInstance, Torque);
}
else
#endif
{
SCOPED_SCENE_WRITE_LOCK(PRigidBody->getScene());
PRigidBody->addTorque(U2PVector(Torque), PxForceMode::eFORCE, true);
}
}
#endif
}