本文整理汇总了C++中UPrimitiveComponent::GetCollisionShape方法的典型用法代码示例。如果您正苦于以下问题:C++ UPrimitiveComponent::GetCollisionShape方法的具体用法?C++ UPrimitiveComponent::GetCollisionShape怎么用?C++ UPrimitiveComponent::GetCollisionShape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPrimitiveComponent
的用法示例。
在下文中一共展示了UPrimitiveComponent::GetCollisionShape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TickGrip
//.........这里部分代码省略.........
else
{
GrippedActors[i].bColliding = false;
if (actor->bReplicateMovement)
actor->SetReplicateMovement(false);
}
}
else
{
if (!GrippedActors[i].bColliding)
{
root->SetWorldTransform(WorldTransform, true);
}
}
}
else if (GrippedActors[i].GripCollisionType == EGripCollisionType::InteractiveHybridCollisionWithSweep)
{
// Need to use without teleport so that the physics velocity is updated for when the actor is released to throw
//if (bIsServer)
//{
FBPActorPhysicsHandleInformation * GripHandle = GetPhysicsGrip(GrippedActors[i]);
if (!GrippedActors[i].bColliding)
{
// Make sure that there is no collision on course before turning off collision and snapping to controller
if (bIsServer && actor && actor->bReplicateMovement)
{
FCollisionQueryParams QueryParams(NAME_None, false, this->GetOwner());
FCollisionResponseParams ResponseParam;
root->InitSweepCollisionParams(QueryParams, ResponseParam);
QueryParams.AddIgnoredActor(actor);
QueryParams.AddIgnoredActors(root->MoveIgnoreActors);
if (GetWorld()->SweepTestByChannel(root->GetComponentLocation(), WorldTransform.GetLocation(), root->GetComponentQuat(), ECollisionChannel::ECC_Visibility, root->GetCollisionShape(), QueryParams, ResponseParam))
{
GrippedActors[i].bColliding = true;
}
else
{
GrippedActors[i].bColliding = false;
}
}
// If still not colliding
if (!GrippedActors[i].bColliding)
{
if (bIsServer && actor->bReplicateMovement) // So we don't call on on change event over and over locally
actor->SetReplicateMovement(false);
if (bIsServer && GripHandle)
{
DestroyPhysicsHandle(GrippedActors[i]);
if(GrippedActors[i].Actor)
GrippedActors[i].Actor->DisableComponentsSimulatePhysics();
else
root->SetSimulatePhysics(false);
}
root->SetWorldTransform(WorldTransform, false);
}
else
{
if (bIsServer && GrippedActors[i].bColliding && GripHandle)
UpdatePhysicsHandleTransform(GrippedActors[i], WorldTransform);
}