Skip to content

Commit

Permalink
[Vision Glass] Beam extends all the way to the pointer
Browse files Browse the repository at this point in the history
It is easy to get lost while using the Vision Glass because the
controllers are not drawn in the 3D world and the narrow
field of view means that the beam is not always visible to the user.

This change extends the beam so it reaches all the way to
the pointer, making the UI more understandable.
  • Loading branch information
felipeerias committed May 23, 2024
1 parent 9d3cf56 commit 0457118
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/visionglass/cpp/DeviceDelegateVisionGlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ DeviceDelegateVisionGlass::GetControllerModelName(const int32_t) const {
return "Vision Glass";
}

void
DeviceDelegateVisionGlass::SetHitDistance(const float distance) {
// Scale the beam so it reaches all the way to the pointer.
auto beamTransform = vrb::Matrix::Identity();
beamTransform.ScaleInPlace(vrb::Vector(1.0, 1.0, distance));
m.controller->SetBeamTransform(kControllerIndex, beamTransform);
}

void
DeviceDelegateVisionGlass::ProcessEvents() {}

Expand Down
1 change: 1 addition & 0 deletions app/src/visionglass/cpp/DeviceDelegateVisionGlass.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class DeviceDelegateVisionGlass : public DeviceDelegate {
void BindEye(const device::Eye) override;
void EndFrame(const FrameEndMode aMode) override;
bool IsControllerLightEnabled() const override;
void SetHitDistance(const float) override;
// DeviceDelegateVisionGlass interface
void InitializeJava(JNIEnv* aEnv, jobject aActivity);
void ShutdownJava();
Expand Down

0 comments on commit 0457118

Please sign in to comment.