Skip to content

Commit

Permalink
Merge pull request #14 from deiteris/main
Browse files Browse the repository at this point in the history
Check device index to avoid crash with Space Calibrator and stuff
  • Loading branch information
Eirenliel committed Feb 3, 2022
2 parents 04b6dab + e980a38 commit 875577b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ControllerDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ vr::EVRInitError SlimeVRDriver::ControllerDevice::Activate(uint32_t unObjectId)

void SlimeVRDriver::ControllerDevice::PositionMessage(messages::Position &position)
{
if (this->device_index_ == vr::k_unTrackedDeviceIndexInvalid)
return;

// Setup pose for this frame
auto pose = this->last_pose_;
//send the new position and rotation from the pipe to the tracker object
Expand Down
3 changes: 3 additions & 0 deletions src/HMDDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ void SlimeVRDriver::HMDDevice::Update()

void SlimeVRDriver::HMDDevice::PositionMessage(messages::Position &position)
{
if (this->device_index_ == vr::k_unTrackedDeviceIndexInvalid)
return;

// Setup pose for this frame
auto pose = this->last_pose_;
//send the new position and rotation from the pipe to the tracker object
Expand Down
3 changes: 3 additions & 0 deletions src/TrackerDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ void SlimeVRDriver::TrackerDevice::Update()

void SlimeVRDriver::TrackerDevice::PositionMessage(messages::Position &position)
{
if (this->device_index_ == vr::k_unTrackedDeviceIndexInvalid)
return;

// Setup pose for this frame
auto pose = this->last_pose_;
//send the new position and rotation from the pipe to the tracker object
Expand Down
3 changes: 3 additions & 0 deletions src/TrackingReferenceDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ vr::DriverPose_t SlimeVRDriver::TrackingReferenceDevice::GetPose()

void SlimeVRDriver::TrackingReferenceDevice::PositionMessage(messages::Position &position)
{
if (this->device_index_ == vr::k_unTrackedDeviceIndexInvalid)
return;

// Setup pose for this frame
auto pose = this->last_pose_;
//send the new position and rotation from the pipe to the tracker object
Expand Down

0 comments on commit 875577b

Please sign in to comment.