当前位置: 首页>>代码示例>>C++>>正文


C++ FPhysSubstepTask类代码示例

本文整理汇总了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
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:26,代码来源:PhysScene.cpp

示例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;
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:28,代码来源:PhysScene.cpp

示例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
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:25,代码来源:PhysScene.cpp

示例4: TermBody

void FPhysScene::TermBody(FBodyInstance * BodyInstance)
{
#if WITH_SUBSTEPPING
	if (PxRigidDynamic * PRigidDynamic = BodyInstance->GetPxRigidDynamic())
	{
		FPhysSubstepTask * PhysSubStepper = PhysSubSteppers[SceneType(BodyInstance)];
		PhysSubStepper->RemoveBodyInstance(BodyInstance);
	}
#endif
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:10,代码来源:PhysScene.cpp

示例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
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:14,代码来源:PhysScene.cpp

示例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
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:21,代码来源:PhysScene.cpp

示例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
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:21,代码来源:PhysScene.cpp

示例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
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:22,代码来源:PhysScene.cpp


注:本文中的FPhysSubstepTask类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。