Skip to content

Instantly share code, notes, and snippets.

@Adamcbrz
Last active April 22, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adamcbrz/ccae907086b8beca8931edc2c6816611 to your computer and use it in GitHub Desktop.
Save Adamcbrz/ccae907086b8beca8931edc2c6816611 to your computer and use it in GitHub Desktop.
Tutorial Tracker: Constructor
ATracker::ATracker()
{
// 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;
// Initialize VR
vr::EVRInitError peError;
vrSystem = vr::VR_Init(&peError, vr::EVRApplicationType::VRApplication_Other);
// Setup trackerID to -1 so we can test when it is set
trackerID = -1;
// Create Components
sceneComponent = CreateAbstractDefaultSubobject<USceneComponent>(TEXT("Scene"));
RootComponent = sceneComponent;
cameraComponent = CreateAbstractDefaultSubobject<UCameraComponent>(TEXT("Camera"));
cameraComponent->AttachTo(sceneComponent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment