本文整理汇总了C++中UPrimitiveComponent::IgnoreActorWhenMoving方法的典型用法代码示例。如果您正苦于以下问题:C++ UPrimitiveComponent::IgnoreActorWhenMoving方法的具体用法?C++ UPrimitiveComponent::IgnoreActorWhenMoving怎么用?C++ UPrimitiveComponent::IgnoreActorWhenMoving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPrimitiveComponent
的用法示例。
在下文中一共展示了UPrimitiveComponent::IgnoreActorWhenMoving方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NotifyDrop_Implementation
void UGripMotionControllerComponent::NotifyDrop_Implementation(const FBPActorGripInformation &NewDrop, bool bSimulate)
{
if (bIsServer)
{
if (NewDrop.Actor)
{
NewDrop.Actor->RemoveTickPrerequisiteComponent(this);
this->IgnoreActorWhenMoving(NewDrop.Actor, false);
NewDrop.Actor->SetReplicateMovement(NewDrop.bOriginalReplicatesMovement);
}
else if (NewDrop.Component)
{
NewDrop.Component->RemoveTickPrerequisiteComponent(this);
if (NewDrop.Component->GetOwner())
{
this->IgnoreActorWhenMoving(NewDrop.Component->GetOwner(), false);
NewDrop.Component->GetOwner()->SetReplicateMovement(NewDrop.bOriginalReplicatesMovement);
}
}
}
DestroyPhysicsHandle(NewDrop);
UPrimitiveComponent *root = NewDrop.Component;
if (!root && NewDrop.Actor)
{
root = Cast<UPrimitiveComponent>(NewDrop.Actor->GetRootComponent());
if (root)
{
root->IgnoreActorWhenMoving(this->GetOwner(), false);
root->SetSimulatePhysics(bSimulate);
root->WakeAllRigidBodies();
root->SetEnableGravity(true);
}
}
else if (root)
{
root->IgnoreActorWhenMoving(this->GetOwner(), false);
root->SetSimulatePhysics(bSimulate);
root->WakeAllRigidBodies();
root->SetEnableGravity(true);
}
}
示例2: MoveIgnoreActorRemove
void APawn::MoveIgnoreActorRemove(AActor* ActorToIgnore)
{
UPrimitiveComponent* RootPrimitiveComponent = Cast<UPrimitiveComponent>(GetRootComponent());
if( RootPrimitiveComponent )
{
RootPrimitiveComponent->IgnoreActorWhenMoving(ActorToIgnore, false);
}
}
示例3: GripActor
bool UGripMotionControllerComponent::GripActor(
AActor* ActorToGrip,
const FTransform &WorldOffset,
bool bWorldOffsetIsRelative,
FName OptionalSnapToSocketName,
TEnumAsByte<EGripCollisionType> GripCollisionType,
bool bAllowSetMobility,
float GripStiffness,
float GripDamping,
bool bTurnOffLateUpdateWhenColliding
)
{
if (!bIsServer || !ActorToGrip)
{
UE_LOG(LogTemp, Warning, TEXT("VRGripMotionController grab function was passed an invalid or already gripped actor"));
return false;
}
UPrimitiveComponent *root = Cast<UPrimitiveComponent>(ActorToGrip->GetRootComponent());
if (!root)
{
UE_LOG(LogTemp, Warning, TEXT("VRGripMotionController tried to grip an actor without a UPrimitiveComponent Root"));
return false; // Need a primitive root
}
// Has to be movable to work
if (root->Mobility != EComponentMobility::Movable)
{
if (bAllowSetMobility)
root->SetMobility(EComponentMobility::Movable);
else
{
UE_LOG(LogTemp, Warning, TEXT("VRGripMotionController tried to grip an actor set to static mobility and bAllowSetMobility is false"));
return false; // It is not movable, can't grip it
}
}
root->IgnoreActorWhenMoving(this->GetOwner(), true);
// So that events caused by sweep and the like will trigger correctly
ActorToGrip->AddTickPrerequisiteComponent(this);
FBPActorGripInformation newActorGrip;
newActorGrip.GripCollisionType = GripCollisionType;
newActorGrip.Actor = ActorToGrip;
newActorGrip.bOriginalReplicatesMovement = ActorToGrip->bReplicateMovement;
newActorGrip.Stiffness = GripStiffness;
newActorGrip.Damping = GripDamping;
newActorGrip.bTurnOffLateUpdateWhenColliding = bTurnOffLateUpdateWhenColliding;
if (OptionalSnapToSocketName.IsValid() && root->DoesSocketExist(OptionalSnapToSocketName))
{
// I inverse it so that laying out the sockets makes sense
FTransform sockTrans = root->GetSocketTransform(OptionalSnapToSocketName, ERelativeTransformSpace::RTS_Component);
newActorGrip.RelativeTransform = sockTrans.Inverse();
newActorGrip.RelativeTransform.SetScale3D(ActorToGrip->GetActorScale3D());
}
else if (bWorldOffsetIsRelative)
newActorGrip.RelativeTransform = WorldOffset;
else
newActorGrip.RelativeTransform = WorldOffset.GetRelativeTransform(this->GetComponentTransform());
NotifyGrip(newActorGrip);
GrippedActors.Add(newActorGrip);
return true;
}