A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
BaseGrippableStoryVolume.cpp
Go to the documentation of this file.
1// Copyright(c) 2018 PixoVR, LLC. All Rights Reserved.
2
3
5
7{
9
10 BoxCollisionComponent = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxCollision"));
12 BoxCollisionComponent->SetBoxExtent(FVector(30.f, 30.f, 30.f));
13
14 SetIsActive(true);
15}
16
18{
19 if (bIsActive != bNewIsActive)
20 {
21 bIsActive = bNewIsActive;
22
23 if (bIsActive)
24 {
25 BoxCollisionComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
26 }
27 else
28 {
29 BoxCollisionComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision);
30 }
31 }
32}
33
35{
36 if (!AlwaysActive)
37 {
38 Super::ObjectDeactivated_Implementation();
39 }
40}
@ OnlyOnGripEvent
EHandGripLogic HandGripLogic
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "GrippableObject")
UStaticMeshComponent * StaticMeshComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
UBoxComponent * BoxCollisionComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
ABaseGrippableStoryVolume()
void SetIsActive(bool bNewIsActive)
Setter for bIsActive property, also updates collision state for BoxCollisionComponent.
virtual void ObjectDeactivated_Implementation() override
Implementation of the ObjectDeactivated function from the IPixoVRStoryObject interface.
bool AlwaysActive
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bIsActive
Determines whether the volume is active, use SetIsActive to update its value.