本文整理汇总了C++中UStaticMeshComponent::SetCollisionResponseToAllChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ UStaticMeshComponent::SetCollisionResponseToAllChannels方法的具体用法?C++ UStaticMeshComponent::SetCollisionResponseToAllChannels怎么用?C++ UStaticMeshComponent::SetCollisionResponseToAllChannels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UStaticMeshComponent
的用法示例。
在下文中一共展示了UStaticMeshComponent::SetCollisionResponseToAllChannels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FRotator
// Sets default values
AKrofna_CPP::AKrofna_CPP()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
UStaticMeshComponent *Krofna = CreateDefaultSubobject<UStaticMeshComponent,UStaticMeshComponent>(TEXT("krofnica"));
URotatingMovementComponent *Rotacija = CreateDefaultSubobject<URotatingMovementComponent, URotatingMovementComponent>(TEXT("rotaciona komponenta"));
UPointLightComponent *Svetlo1 = CreateDefaultSubobject <UPointLightComponent, UPointLightComponent>(TEXT("Svetlo1"));
UPointLightComponent *Svetlo2 = CreateDefaultSubobject <UPointLightComponent, UPointLightComponent>(TEXT("Svetlo2"));
USphereComponent *Kolizija = CreateDefaultSubobject <USphereComponent, USphereComponent>(TEXT("Kolizija"));
Kolizija->SetSphereRadius(65.f);
Kolizija->Activate(true);
Kolizija->bGenerateOverlapEvents = true;
Kolizija->SetRelativeLocation(FVector(0,0,18.f));
this->RootComponent = Krofna;
Kolizija->AttachTo(RootComponent);
Svetlo1->AttachTo(RootComponent);
Svetlo2->AttachTo(RootComponent);
Svetlo1->SetRelativeLocation(FVector(0, 0, 65));
Svetlo2->SetRelativeLocation(FVector(0, 0, -45));
Svetlo1->SetLightColor(FLinearColor(0.65f, 1.f, 0.875f));
Svetlo2->SetLightColor(FLinearColor(0.45f, 1.f, 0.82f));
this->DisableComponentsSimulatePhysics();
Krofna->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Overlap);
static ConstructorHelpers::FObjectFinder<UStaticMesh> Krofna_SM(TEXT("StaticMesh'/Game/StarterContent/Shapes/Shape_Torus.Shape_Torus'"));
Krofna->SetStaticMesh(Krofna_SM.Object);
static ConstructorHelpers::FObjectFinder<UMaterial> Krofna_M(TEXT("Material'/Game/StarterContent/Materials/M_Metal_Gold.M_Metal_Gold'"));
Krofna->SetMaterial(0, Krofna_M.Object);
Rotacija->SetActive(true);
Rotacija->RotationRate = FRotator(120,120,120);
this->SetActorEnableCollision(true);
OnActorBeginOverlap.AddDynamic(this, &AKrofna_CPP::OnBeginOverlap);
}