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 }
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 }